Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Mz8oY-0005S6-H6 for mharc-grub-devel@gnu.org; Sat, 17 Oct 2009 08:55:18 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mz8oX-0005Q5-8t for grub-devel@gnu.org; Sat, 17 Oct 2009 08:55:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mz8oS-0005Iy-GL for grub-devel@gnu.org; Sat, 17 Oct 2009 08:55:16 -0400 Received: from [199.232.76.173] (port=52822 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mz8oS-0005Ih-99 for grub-devel@gnu.org; Sat, 17 Oct 2009 08:55:12 -0400 Received: from smarthost01.mail.zen.net.uk ([212.23.3.140]:42556) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mz8oR-0002CL-SW for grub-devel@gnu.org; Sat, 17 Oct 2009 08:55:12 -0400 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost01.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1Mz8oQ-0008T7-BC for grub-devel@gnu.org; Sat, 17 Oct 2009 12:55:10 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) for grub-devel@gnu.org id 1Mz8oN-0001gK-00; Sat, 17 Oct 2009 13:55:07 +0100 Date: Sat, 17 Oct 2009 13:55:07 +0100 From: Colin Watson To: The development of GRUB 2 Message-ID: <20091017125507.GS28534@riva.ucam.org> References: <4AD9B795.6000201@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AD9B795.6000201@parallels.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost01-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [patch] incorrect root device while /dev/ on tmpfs X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2009 12:55:17 -0000 On Sat, Oct 17, 2009 at 04:24:53PM +0400, Vasily Averin wrote: > While /dev mounted as tmpfs it does not contain /dev/disk/by-uuid directory, > 10_linux script did not check it properly and do not set root device via UUID. > Therefore following kernel boot can fail (incorrect root device) if device names > was changed. > > Attached path fixes this issue. Please review and commit it > diff -up ./util/grub.d/10_linux.in.tmpdevuuid ./util/grub.d/10_linux.in > --- ./util/grub.d/10_linux.in.tmpdevuuid 2009-08-29 20:05:06.000000000 +0400 > +++ ./util/grub.d/10_linux.in 2009-09-03 11:07:34.000000000 +0400 > @@ -36,7 +36,7 @@ case ${GRUB_DEVICE} in > esac > > if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ > - || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then > + || ( test -d /dev/disk/by-uuid && ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}") ; then > LINUX_ROOT_DEVICE=${GRUB_DEVICE} > else > LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} It seems to me that this eliminates the safety check to ensure that Linux actually recognises this UUID. If for some reason GRUB and Linux are out of sync in how they calculate UUIDs, this will probably result in an unbootable system. Would it help to double-check with blkid in this case, or something like that? -- Colin Watson [cjwatson@ubuntu.com]