FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 11-18-2010, 04:42 PM
"Serge E. Hallyn"
 
Default Bug#603944: retry mounting of root

Package: initramfs-tools
Version: 0.98

When using multipath, it is possible that mountroot() will race with
udev's renaming of /dev/disk/by-uuid/{rootfs-uuid} from /dev/sd?? to
/dev/mapper/something. After multipath has grabbed the /dev/sd?? and
until udev completes the rename, mounting
/dev/disk/by-uuid/{rootfs-uuid} will fail with -EBUSY.

Here is a patch I've been using successfully for awhile. Colin Watson
has suggested that:

> A poll/retry loop is generally a suboptimal way to do this kind of
> thing; what we really want is to wait for udev to tell us that it has
> finished with the event that triggered renaming of the device.

which does seem cleaner.

thanks,
-serge

diff -Nru initramfs-tools-0.98ubuntu2/debian/changelog initramfs-tools-0.98ubuntu3/debian/changelog
--- initramfs-tools-0.98ubuntu2/debian/changelog 2010-08-20 03:48:58.000000000 -0500
+++ initramfs-tools-0.98ubuntu3/debian/changelog 2010-08-24 22:31:31.000000000 -0500
@@ -1,3 +1,14 @@
+initramfs-tools (0.98ubuntu3) maverick; urgency=low
+
+ * Add retries to mountroot(). This is particularly needed when we
+ use multipath, because it is possible that mountroot() will race
+ with udev's renaming of /dev/disk/by-uuid/{rootfs-uuid} from
+ /dev/sd?? to /dev/mapper/something. After multipath has grabbed
+ the /dev/sd?? and until udev completes the rename, mounting
+ /dev/disk/by-uuid/{rootfs-uuid} will fail with -EBUSY.
+
+ -- Serge Hallyn <serge.hallyn@canonical.com> Tue, 24 Aug 2010 22:17:57 -0500
+
initramfs-tools (0.98ubuntu2) maverick; urgency=low

* The ramzswap device changed its interface so that the disk size needs to
diff -Nru initramfs-tools-0.98ubuntu2/scripts/local initramfs-tools-0.98ubuntu3/scripts/local
--- initramfs-tools-0.98ubuntu2/scripts/local 2010-08-20 03:48:58.000000000 -0500
+++ initramfs-tools-0.98ubuntu3/scripts/local 2010-08-24 22:16:17.000000000 -0500
@@ -86,10 +86,19 @@
# FIXME This has no error checking
[ -n "${FSTYPE}" ] && modprobe ${FSTYPE}

- # FIXME This has no error checking
# Mount root
- mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
- mountroot_status="$?"
+ tries=0
+ ret=1
+ while [ $tries -lt 10 -a $ret -ne 0 ]; do
+ mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ echo "failed attempt $tries to mount $ROOT as root"
+ sleep 1
+ tries=$((tries+1))
+ fi
+ done
+ mountroot_status=$ret
if [ "$LOOP" ]; then
if [ "$mountroot_status" != 0 ]; then
if [ ${FSTYPE} = ntfs ] || [ ${FSTYPE} = vfat ]; then



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20101118174249.GA24893@hallyn.com">http://lists.debian.org/20101118174249.GA24893@hallyn.com
 

Thread Tools




All times are GMT. The time now is 07:31 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org