You are not logged in.

#1 2016-06-27 16:10:35

gym
Member
Registered: 2016-06-27
Posts: 13

lvm logic volume symlinks are missing from /dev/mapper

Hello Forum!

I just installed arch on my desktop with grub-uefi and partial drive encryption. I followed more or less this guide with some modification regarding the partition layout. My problem is that after boot the luks drive gets opened, but the mounting of all the logical lvm volumes inside it times out. I get the following error message for each:

[ TIME ] Timed out waiting for device dev-disk-by\...\id.device.

And than boot falls back to emergency mode. I noticed that the luks volume is opened correctly and it is present in /dev/mapper/lvm, however the LVM logical volume symlinks are missing. My partition setup is the following:

SDA (SSD):
sda1 /boot/efi fat32
sda2 /boot ext2
sda3 /root ext4
SDC (HDD):
sdc1 luks-crypted:
        lvm-volume:
               vg0-swap
               vg0-var
               vg0-home

And the /dev/mapper/vg0-... symlinks are missing. The /dev/dm-1 /dev/dm-2 /dev/dm-3 devices are present but the /dev/<vg> directory (the directory for the volume group) is also missing.

dmsetup -ls also correctly lists the logical volumes.

My /etc/default/grub contains:

GRUB_CMDLINE_LINUX="cryptdevice=/dev/sdc1:lvm:allow-discards"

And I have added "encrypt lvm2" to the HOOKS in /etc/mkinitcpio.conf.

The UUIDs in /etc/fstab are matching the "blkid /dev/dm-X" UUIDs,

I have installed arch on my laptop before, with lvm on luks using a similar method with no problems (with a somewhat simpler partition table) so I am clueless now. Any help or guidance is appriciated!

Thanks, Gym!

*EDIT:
I found the following error in the journalctl -b output before the timeout errors:

lvmetad[344]: Cannot lock lockfile [/run/lvmetad.pid], error was [Resource temporarily unavailable]
lvmetad[344]: Failed to acquire lock on /run/lvmetad.pid. Already running?

*EDIT2:
If i kill the lvmetad process the /usr/bin/lvmetad -f process gets automatically executed and all the missing symlinks are created, and "mount -a" mounts everything.
After disabling lvmetad in lvm.conf this no longer helps.

Last edited by gym (2016-06-27 16:57:01)

Offline

#2 2016-06-27 16:25:17

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: lvm logic volume symlinks are missing from /dev/mapper

If you mount everything by UUID, those missing symlinks won't matter, UUID is happy with dm-42.

lvmetad is something you could enable/disable in lvm.conf

If nothing else works you could create a custom hook that runs `vgscan --mknodes` that kinda forces LVM to create device nodes by itself if must be.

Or it could be udev related...

Offline

#3 2016-06-27 16:51:07

gym
Member
Registered: 2016-06-27
Posts: 13

Re: lvm logic volume symlinks are missing from /dev/mapper

I disabled lvmetad in the lvm.conf so i no longer have the lvmetad related error in journalctl, however the original error still persists.
mount -a does not mount the lvm partitions despite only using UUIDs in fstab.

I noticed that an lvmetad process still gets executed, and if i kill it it is automatically reexecuted. vgscan --mknodes hangs because it is "Unable to obtain global lock."

Offline

#4 2016-06-27 16:52:37

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: lvm logic volume symlinks are missing from /dev/mapper

Maybe a stupid question, but are your volumes active? IIRC there's something like "vgchange a y", though I'm probably not remembering it correctly.

Offline

#5 2016-06-27 16:58:37

gym
Member
Registered: 2016-06-27
Posts: 13

Re: lvm logic volume symlinks are missing from /dev/mapper

I tried "vgchange -a y vg0" and i got that "3 logilcal volumes in in vg0 now active" but nothing really changed.

Offline

#6 2016-06-27 17:12:24

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: lvm logic volume symlinks are missing from /dev/mapper

Hmm, locks again... what do you get for `df -h /run/`?

Not sure what's going on, sorry...

Offline

#7 2016-06-28 15:00:07

gym
Member
Registered: 2016-06-27
Posts: 13

Re: lvm logic volume symlinks are missing from /dev/mapper

So today in the morning I managed to successfully boot (without doing any modification) and installed i3 and a bunch of stuff rebooted 2-3 times in the process, all was working fine.

Now I tried to boot again and received the original error but only for the vg0-home partition. I don't know much about linux internals/lvm but this seems to me some locking issue with a race condition. Anyone seen anything similar before? Any idea how to debug this?

df -h /run shows that 668k/7.8G used.

Thanks!

*Edit:

in the /var/lock/lvm and /run/lock/lvm the P_global and V_vg0 files are present.
When i try to run vgscan -vvvv --mknodes it hangs at

#misc/lvm-flock.c:101               _do_flock /run/lock/lvm/P_global WB

Last edited by gym (2016-06-28 15:14:15)

Offline

#8 2016-06-28 15:15:04

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: lvm logic volume symlinks are missing from /dev/mapper

Maybe the HDD is failing, or maybe you have a bad sata cable. First sign of something like this is the number of reallocated sectors reported by SMART.

Offline

Board footer

Powered by FluxBB