You are not logged in.

#1 2015-04-05 19:40:26

DaAlx
Member
Registered: 2015-04-05
Posts: 3

[solved] lvm fails at boot time / lvm pv scan hangs (often)

Hi,

I switched from ubuntu to Archlinux two weeks ago and  about half of my boot attempts fail because of some problems with my lvm-volumes

My setup

I have  my root partition on /dev/sda2 and an lvm partition /dev/sda3 containing logical volumes for /var /home and /boot

If booting succeeds   these volumes appear as
/dev/mapper/VolGroup01-varVol
/dev/mapper/VolGroup01-homeVol
/dev/mapper/VolGroup01-bootVol

If my booting fails,  My screen shows

startin version 218
/dev/sda2: clean, blabla files, blabla blocks
A start job is running for LVM PV scan on devices 8:3

This last message (together with 3 start jobs for dev-disk-by-x2duuid-SOMENUMBERS) appears for 90 seconds and then emergency mode is started
After logging in for maintenance   /dev/mapper only contains "control" but not my logical volumes
module dm_mod is loaded
dmesg does not seem to show anything related to lvm or sda3
and /var/log contains only empty files (btmp, lastlog, wtmp)


Where can I find informations about this problem?
Any suggestions how to solve this problem?

Last edited by DaAlx (2015-04-06 12:45:17)

Offline

#2 2015-04-06 00:34:06

SirMyztiq
Member
Registered: 2015-03-24
Posts: 118

Re: [solved] lvm fails at boot time / lvm pv scan hangs (often)

DaAlx wrote:

Hi,

I switched from ubuntu to Archlinux two weeks ago and  about half of my boot attempts fail because of some problems with my lvm-volumes

My setup

I have  my root partition on /dev/sda2 and an lvm partition /dev/sda3 containing logical volumes for /var /home and /boot

If booting succeeds   these volumes appear as
/dev/mapper/VolGroup01-varVol
/dev/mapper/VolGroup01-homeVol
/dev/mapper/VolGroup01-bootVol

If my booting fails,  My screen shows

startin version 218
/dev/sda2: clean, blabla files, blabla blocks
A start job is running for LVM PV scan on devices 8:3

This last message (together with 3 start jobs for dev-disk-by-x2duuid-SOMENUMBERS) appears for 90 seconds and then emergency mode is started
After logging in for maintenance   /dev/mapper only contains "control" but not my logical volumes
module dm_mod is loaded
dmesg does not seem to show anything related to lvm or sda3
and /var/log contains only empty files (btmp, lastlog, wtmp)


Where can I find informations about this problem?
Any suggestions how to solve this problem?

Hello,

Disclaimer: Without any logs to see what is happening, this is just an educated guess because it sounds like what happened to me. Try getting the logs during the emergency shell process.

I've run into an  issue myself with LVM. From what I understand, the pvscan processes get stuck waiting for a udev sync that no longer exists because udev is restarted while pvscan processes are running in the background. There hasn't been an official solution but I modified udev hook with this (can be found in /usr/lib/initcpio/hooks/udev):

while [ "$(pgrep -f pvscan)" ]; do
sleep 0.1
done

which forces udev to wait until the LVM processes finish before telling it to die. It is hacky and poor for a long term solution because we have lvm code in the udev hook is bad design but I haven't had that issue any more.

You can also try

In /etc/mkinitcpio.conf, you must change your HOOKS list:
HOOKS="base udev autodetect modconf block lvm2 filesystems keyboard fsck" is a hook list for script
HOOKS="base systemd autodetect modconf block sd-lvm2 filesystems keyboard fsck" is a hook list for systemd

but that stopped working for a few people on 3.19.

Here is the bug report to keep you up to date:
https://bugs.archlinux.org/task/41833#comment133971

Last edited by SirMyztiq (2015-04-06 00:36:46)

Offline

#3 2015-04-06 12:43:54

DaAlx
Member
Registered: 2015-04-05
Posts: 3

Re: [solved] lvm fails at boot time / lvm pv scan hangs (often)

Thank you for this quick help. In fact I first tried out your second tip:  Using the sytemd hook instead of the udev hook  seems to work perfectly well for me (at least for  the about 10 boots I did so far)

Offline

Board footer

Powered by FluxBB