Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N3H5c-00057K-5B for mharc-grub-devel@gnu.org; Wed, 28 Oct 2009 18:34:00 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N3H5b-00056h-2z for grub-devel@gnu.org; Wed, 28 Oct 2009 18:33:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N3H5W-00053r-DQ for grub-devel@gnu.org; Wed, 28 Oct 2009 18:33:58 -0400 Received: from [199.232.76.173] (port=38519 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3H5W-00053o-BP for grub-devel@gnu.org; Wed, 28 Oct 2009 18:33:54 -0400 Received: from moutng.kundenserver.de ([212.227.126.188]:61144) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N3H5V-0002j2-Rg for grub-devel@gnu.org; Wed, 28 Oct 2009 18:33:54 -0400 Received: from [85.180.49.145] (e180049145.adsl.alicedsl.de [85.180.49.145]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0LhziI-1MQ8eY0rac-00nE7I; Wed, 28 Oct 2009 23:33:52 +0100 From: Felix Zielcke To: The development of GRUB 2 Content-Type: multipart/mixed; boundary="=-Y8290moRg/CsiMZ9x/zz" Date: Wed, 28 Oct 2009 23:33:51 +0100 Message-ID: <1256769231.12048.16.camel@fz.local> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 X-Provags-ID: V01U2FsdGVkX1/YAXX9ZwqPB6A+xU60tawfQjKcahd/hVzn7zM xK4MIB0Hfu8tafvG/+YS4JpDdqwooFmx085mCsatnuZDvSSK3B X+MGuugeU992l6nM39dSg== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] try to reread partition table in 10_linux 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: Wed, 28 Oct 2009 22:33:59 -0000 --=-Y8290moRg/CsiMZ9x/zz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit /dev/disk/by-uuid seems to be only created when the partition table gets reread after a new filesystem has been created. So here's a patch which does it with sfdisk. I wasn't sure if some devices like e.g. /dev/mapper/* should be ignored. mdraid devices can have partitions so they should be tried too. -- Felix Zielcke Proud Debian Maintainer and GNU GRUB developer --=-Y8290moRg/CsiMZ9x/zz Content-Disposition: attachment; filename="sfdisk.patch" Content-Type: text/x-patch; name="sfdisk.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit 2009-10-28 Felix Zielcke * util/grub.d/10_linux.in: Try to reread partition table with sfdisk before we check if UUIDs can be used. Index: util/grub.d/10_linux.in =================================================================== --- util/grub.d/10_linux.in (revision 2668) +++ util/grub.d/10_linux.in (working copy) @@ -35,6 +35,13 @@ case ${GRUB_DEVICE} in ;; esac +# Try to reread partition table. In case a fresh filesystem has been created +# /dev/disk/by-uuid doestn't yet exist. +if which sfdisk /dev/null ; then + GRUB_DEVICE_DISK=`echo ${GRUB_DEVICE} | sed -e "s/[0-9]*$//"` + sfdisk -R ${GRUB_DEVICE_DISK} 2>/dev/null +fi + if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then LINUX_ROOT_DEVICE=${GRUB_DEVICE} --=-Y8290moRg/CsiMZ9x/zz--