[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: LVM devices and symlinks



Neil T. Dantam wrote:
> I'm having an issue (not quite a problem) creating LVM logical
> volumes.  It seems that the way device files and symlinks are created
> has changed between Squeeze and Wheezy (or I have some bad
> configuration).

As far as I can tell these features have not changed between Squeeze
and Wheezy.  They are the same on my machines.

>   Old (working) Behavior
>   ----------------------
> Performing an `lvcreate -L10G -nLVNAME VGNAME` would create:
> 
> 1. New device file /dev/dm-N
> 2. Symlink /dev/mapper/VGNAME-LVNAME -> /dev/dm-N
> 3. Symlink /dev/VGNAME/LVNAME -> /dev/dm-N
> 
> And everything was great.

Yes.

>   New (broken) Behavior
>   --------------------
> Performing an `lvcreate -L10G -nLVNAME VGNAME` creates:
> 
> 1. New device file /dev/mapper/VGNAME-LVNAME
> (and apparently nothing else)

Uhm.  No.  It creates the others too.

> Then, lvcreate tries to open /dev/VGNAME-LVNAME, which fails because
> of no symlink with:
>     /dev/VGNAME/LVNAME: not found: device not cleared
>     Aborting. Failed to wipe start of new LV.

Works for me:

  root@despair:~# lvcreate -L100M -ntest v1
    Logical volume "test" created
  root@despair:~# ls -l /dev/mapper/v1-test /dev/v1/test
  lrwxrwxrwx 1 root root 8 Dec 10 22:59 /dev/mapper/v1-test -> ../dm-10
  lrwxrwxrwx 1 root root 8 Dec 10 22:59 /dev/v1/test -> ../dm-10

This is with version 2.02.95-5 but Wheezy has 2.02.95-4 and the
changelog shows only local differences.  I will say shouldn't matter
unless proven otherwise.

>   Workarounds
>   -----------
> Here are a few workarounds I've figured out:
> 
> 1. Give lvcreate the '-Z n' flag.  This does create a usable logical
>    volume, but won't work with snapshots.
> 2. Manually create a symlink 
>    '/dev/VGNAME/LVNAME -> /dev/mapper/VGNAME-LVNAME'
>    before running lvcreate 
> 3. Give lvcreate the '--noudevsync' option.  In this case, lvcreate
>    makes a symlink for
>    '/dev/VGNAME/LVNAME -> /dev/mapper/VGNAME-LVNAME'
>    on its own (apparently).

What version of udev are you using?  I could see this being a udev issue.

> Also, on a reboot of the machine, the device files end up in the
> original configuration, with both /dev/mapper/VGNAME-LVNAME and
> /dev/VGNAME/LVNAME as symlinks pointing to /dev/dm-N.

I did not understand what you said here.  After a reboot everything is
okay?  Or after a reboot you are then missing the symlinks that you
manually created?  (The latter makes sense since /dev is dynamic.)

> While those workarounds are enough to get by, it would be nice to
> understand the underlying issue here.  Can anyone shed some light on
> this?

Other than saying that your behavior is not the same as what I see.
Something seems to be wrong with your system.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: