Help with UDEV? - Hardware

This is a discussion on Help with UDEV? - Hardware ; I have an external drive in a USB connected enclosure. I need it to have a consistent location in the /dev/ tree (otherwise LVM2 gets confused). It seems that sometimes the drive is /dev/sda and sometimes (perhaps after connecting an ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Help with UDEV?

  1. Help with UDEV?

    I have an external drive in a USB connected enclosure. I need it to have a
    consistent location in the /dev/ tree (otherwise LVM2 gets confused). It
    seems that sometimes the drive is /dev/sda and sometimes (perhaps after
    connecting an iPod), the drive is /dev/sdb

    I suspect that I can correct this behaviour with UDEV. Can anyone give me
    some intructions on how to go about this?


  2. Re: Help with UDEV?

    On Sat, 20 Jan 2007 15:36:30 -0800, Whoever staggered into the Black Sun
    and said:
    > I have an external drive in a USB connected enclosure. I need it to
    > have a consistent location in the /dev/ tree (otherwise LVM2 gets
    > confused).


    Using LVM on a removable device is usually not a great idea. Only Linux
    can read LVM partitions, so you've just made the device non-removable.
    Anyway, how is LVM getting confused? vgscan/vgchange -a should pick
    everything up and put the LVs in under /dev/mapper/ or /dev/$VG_NAME/ .
    That assumes your lvm.conf is set to scan /dev/sd* and /dev/hd* , of
    course, and not just /dev/sda .

    > sometimes the drive is /dev/sda and sometimes the drive is /dev/sdb.
    > I suspect that I can correct this behaviour with udev.


    Check your udev rules in /etc/udev/rules.d/ . Gentoo, at least, has a
    set of rules that put disks in under /dev/disk/ sorted by various
    identifiers pulled from the mess in /sys. Labels, UUIDs, and hardware
    paths are all supported, and one of those might give you what you need.
    It'll be cumbersome, but it should work no matter which pseudo-SCSI
    things you have plugged in. HTH,

    --
    "Cheer up, things could be worse." So I cheered up, and sure enough,
    things got worse.
    Matt G|There is no Darkness in Eternity/But only Light too dim for us to see

  3. Re: Help with UDEV?



    On Sat, 20 Jan 2007, Dances With Crows wrote:

    > On Sat, 20 Jan 2007 15:36:30 -0800, Whoever staggered into the Black Sun
    > and said:
    >> I have an external drive in a USB connected enclosure. I need it to
    >> have a consistent location in the /dev/ tree (otherwise LVM2 gets
    >> confused).

    >
    > Using LVM on a removable device is usually not a great idea.


    Yeah. I realise that now.

    > Only Linux
    > can read LVM partitions, so you've just made the device non-removable.
    > Anyway, how is LVM getting confused?


    As far as I can tell, the device mapper seems to still think that my
    volume is on /dev/sda5 and I can't figure out how to get it to forget that
    and re-detect the LVM volume.

    vgscan and vgchnage give I/O errors for the volume group that is on the
    removable disk.


  4. Re: Help with UDEV?

    On Sat, 20 Jan 2007 22:44:00 -0800, Whoever staggered into the Black Sun
    and said:
    > On Sat, 20 Jan 2007, Dances With Crows wrote:
    >> Whoever wrote:
    >>> I have an external drive in a USB connected enclosure. I need it to
    >>> have a consistent location in the /dev/ tree (otherwise LVM2 gets
    >>> confused).

    >> Using LVM on a removable device is usually not a great idea.

    > Yeah. I realise that now.
    >
    >> Anyway, how is LVM getting confused?

    > As far as I can tell, the device mapper seems to still think that my
    > volume is on /dev/sda5 and I can't figure out how to get it to forget
    > that and re-detect the LVM volume.


    pvscan? Or maybe fiddle with the "scan" setting in lvm.conf such that
    it scans /dev/disk/by-uuid/* as well as /dev/sd* ? What is your scan
    setting, anyway? I think you may have to restart lvm after changing the
    config in that way--hope your / isn't on LVM. (That's one reason why
    they say not to put / on LVM!)

    > vgscan and vgchnage give I/O errors for the volume group that is on
    > the removable disk.


    Totally understandable if something in the chain can't find the PV.
    Actually, if I were you, I'd get the data off the external disk in some
    fashion, then reformat the thing without LVM. It'd probably be easier
    in the long run. HTH anyway,

    --
    Really, I'm not out to destroy Microsoft. That will just be a
    completely unintentional side effect.
    --Linus Torvalds
    Matt G|There is no Darkness in Eternity/But only Light too dim for us to see

+ Reply to Thread