LVM issue with USB stick: Device /dev/sdc not found (or ignored by filtering).

Robert P. J. Day rpjday at crashcourse.ca
Sat Dec 11 07:41:37 UTC 2010


  (if i might follow up to my own post)

On Sat, 11 Dec 2010, Robert P. J. Day wrote:

>
>   as part of a tutorial on LVM, i want to add a small USB drive to a
> running system, turn it into a physical volume, add it to a volume
> group and so on, since this is way easier than asking there to be a
> second physical drive on the machine. after the tutorial is over, i
> can walk through what it takes to remove the drive from the system and
> everything will be back to normal.
>
>   i grabbed a random 2G USB drive, popped it into my ubuntu system.
> /var/log/messages shows it at /dev/sdc.  so far, so good.  but when i
> try to register that drive as a new physical volume with:
>
>   # pvcreate /dev/sdc
>
> i get:
>
>   Device /dev/sdc not found (or ignored by filtering).
>
> given that /var/log/messages clearly shows that it's there, i have to
> assume it's the "filtering" that's the issue. i see nothing in
> /etc/lvm/lvm.conf that would suggest that that device would be
> filtered out.
>
>   are there more detailed diagnostics i can check? i realize no one
> would realistically use a 2G USB stick for an LVM physical volume but
> it's just for a lab tutorial.  thoughts?

  ok, this is a bit weird.  i had some leftover junk regarding PVs
apparently registered on my system, so i rebooted without the USB
stick, then:

# pvs
  PV         VG   Fmt  Attr PSize   PFree
  /dev/sda5  lynx lvm2 a-   465.52g 52.00m
#

ok, that's correct, it's a single-PV layout.  i plug in the 2G USB
stick, and:

# pvs
  Couldn't find device with uuid 'Ervl7t-sT4r-b9dS-sHNp-ZqI3-IWUP-kFTnsj'.
  Couldn't find device with uuid 'Ervl7t-sT4r-b9dS-sHNp-ZqI3-IWUP-kFTnsj'.
  Couldn't find device with uuid 'Ervl7t-sT4r-b9dS-sHNp-ZqI3-IWUP-kFTnsj'.
  PV             VG       Fmt  Attr PSize   PFree
  /dev/sda5      lynx     lvm2 a-   465.52g  52.00m
  /dev/sdc1      CentOS55 lvm2 a-     1.81g   1.81g
  unknown device CentOS55 lvm2 a-   232.62g 183.62g
#

  whoa.  i can see that this USB stick is a leftover from a class i
taught a while back during which one of the students must have done
exactly what i was talking about -- turned the drive into a small LVM
PV on a CentOS 5.5 system.  so the /dev/sdc1 entry looks correct, but
i have no idea where that "unknown device" entry comes from -- how
does inserting a 2G USB drive suddenly produce a 232G physical volume?

  i popped out the USB drive, things were back to normal.  i put it
back in, i get those two entries back again.  i can only assume that,
somehow, the PV structure on the USB drive is corrupted so it's
showing up as that much larger device.

  thoughts?  the simple solution is just to reformat the USB drive,
but i'd like to know what might be happening here so i can avoid it in
the future.  thanks.

rday

-- 

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================




More information about the ubuntu-users mailing list