Bug#568838: Init script finishes before /dev entries created causing boot to fail
Alexander Clouter
alex at digriz.org.uk
Fri Apr 9 10:48:50 UTC 2010
Hi,
I also have been battling with this race condition for the past few
years. I have a non-complicated non-RAID (although I do see this on my
software RAID boxen too) where /usr, /var and /home are part of an LVM
however my root is not.
My /etc/fstab typically looks like:
----
LABEL=swap none swap sw 0 0
LABEL=root / auto relatime 0 1
LABEL=usr /usr auto relatime,nodev 0 2
LABEL=var /var auto relatime,nodev,nosuid 0 2
LABEL=home /home auto relatime,nodev,nosuid,noexec 0 2
tmpfs /tmp tmpfs nodev,nosuid,noexec,size=32M 0 0
tmpfs /var/tmp tmpfs nodev,nosuid,noexec,size=8M 0 0
varrun /var/run tmpfs nodev,nosuid,noexec,size=512k 0 0
varlock /var/lock tmpfs nodev,nosuid,noexec,size=96k 0 0
#/dev/hda /media/cdrom0 auto ro,user,noauto 0 0
#/dev/hdf /media/cdrom1 auto ro,user,noauto 0 0
#/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
----
When my box boots I can often stumble onto:
----
Setting up LVM Volume Groups Reading all physical volumes. This may
take a while...
Found volume group "lvm-oghma" using metadata type lvm2
3 logical volume(s) in volume group "lvm-oghma" now active
.
Checking file systems...fsck 1.41.3 (12-Oct-2008)
/sbin/fsck.xfs: XFS file system.
/sbin/fsck.xfs: XFS file system.
/sbin/fsck.xfs: LABEL=home does not exist
fsck died with exit status 8
failed (code 8).
File system check failed. A log is being saved in /var/log/fsck/checkfs if that location is writable. Please repair the file sy
A maintenance shell will now be started. CONTROL-D will terminate this shell and resume system boot. (warning).
Give root password for maintenance
(or type Control-D to continue):
----
This happens about 80% of the time on some kit, 10% on others.
Sometimes it grumbles that LABEL=usr or LABEL=var does not exist instead
so it is very obviously a race condition. Looking at what could be
going on, /etc/rcS.d/S26lvm2 shoots through without pausing and so udev
is in a state where it has not quite created all the softlinks in
/dev/disk/by-label in time for when /etc/rcS.d/S30checkfs.sh kicks in.
This is trivially fixed by amendment to /etc/init.d/lvm2 that 'StalkR'
suggested, and is done by the patch I have attached.
Now when my boxes boot I get:
----
Setting up LVM Volume Groups Reading all physical volumes. This may
take a while...
Found volume group "lvm-oghma" using metadata type lvm2
3 logical volume(s) in volume group "lvm-oghma" now active
.
Checking file systems...fsck 1.41.3 (12-Oct-2008)
/sbin/fsck.xfs: XFS file system.
/sbin/fsck.xfs: XFS file system.
/sbin/fsck.xfs: XFS file system.
done.
Setting kernel variables (/etc/sysctl.conf)...done.
Mounting local filesystems...Filesystem "dm-0": Disabling barriers, not supported by the underlying device
XFS mounting filesystem dm-0
Filesystem "dm-1": Disabling barriers, not supported by the underlying device
XFS mounting filesystem dm-1
[snipped]
----
Please include this, get it pushed into 'lenny' too and 'squeeze' as it
really is a nasty showstopper that makes booting of servers potentially
very unreliable.
Cheers
--
Alexander Clouter
.sigmonster says: What foods these morsels be!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lvm-race-fix.patch
Type: text/x-diff
Size: 303 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-lvm-maintainers/attachments/20100409/467be476/attachment.patch>
More information about the pkg-lvm-maintainers
mailing list