Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1HpS21-0001na-T1 for mharc-grub-devel@gnu.org; Sat, 19 May 2007 12:43:49 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HpS20-0001mo-Us for grub-devel@gnu.org; Sat, 19 May 2007 12:43:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HpS1y-0001mc-Fr for grub-devel@gnu.org; Sat, 19 May 2007 12:43:47 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HpS1y-0001mZ-B5 for grub-devel@gnu.org; Sat, 19 May 2007 12:43:46 -0400 Received: from crypt.ethx.net ([82.165.27.140]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HpS1x-0005Wz-Hg for grub-devel@gnu.org; Sat, 19 May 2007 12:43:46 -0400 Received: from 62-31-146-25.cable.ubr12.azte.blueyonder.co.uk ([62.31.146.25] helo=xerces) by crypt.ethx.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1HpS1v-0001nv-Aa for grub-devel@gnu.org; Sat, 19 May 2007 17:43:43 +0100 Received: from sam by xerces with local (Exim 4.63) (envelope-from ) id 1HpS2Y-0002oD-H3 for grub-devel@gnu.org; Sat, 19 May 2007 17:44:22 +0100 Resent-From: sam@robots.org.uk Resent-Date: Sat, 19 May 2007 17:44:22 +0100 Resent-Message-ID: <20070519164422.GA10775@xerces> Resent-To: grub-devel@gnu.org From: Sam Morris To: Robert Millan In-Reply-To: <20070519153203.GA29790@aragorn> References: <1179054146.4014.9.camel@xerces> <20070513164407.GA11143@aragorn> <20070518065137.GA2485@aragorn> <1179535793.4466.3.camel@xerces> <20070519093336.GA19265@aragorn> <1179575266.4466.5.camel@xerces> <20070519121051.GA7186@aragorn> <1179580232.4542.8.camel@xerces> <20070519140848.GA27345@aragorn> <1179585253.4270.1.camel@xerces> <20070519153203.GA29790@aragorn> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-d5QclcjMn1kUMH+r6gj6" Message-Id: <1179590463.4270.24.camel@xerces> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Date: Sat, 19 May 2007 17:01:03 +0100 X-Evolution-Format: text/plain X-Evolution-Account: 1131928023.30735.16@xerces X-Evolution-Transport: sendmail:/// X-Evolution-Fcc: imap://sam@crypt.ethx.net/Sent Resent-Date: Sat, 19 May 2007 17:44:22 +0100 X-Spam-Bars: - X-detected-kernel: Linux 2.6 (newer, 3) Cc: grub-devel@gnu.org Subject: Re: fallback for "grub-probe -t partmap" failures 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, 19 May 2007 16:43:49 -0000 --=-d5QclcjMn1kUMH+r6gj6 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat, 2007-05-19 at 17:32 +0200, Robert Millan wrote: > (please keep CC to upsteam..) >=20 > So, do we put this in upstream grub CVS, or do we hold it off untill a > better fix is available ? I think falling back to 'pc raid gpt' is ok. Perhaps if the fallback is used, a warning could be displayed prompting the user to set GRUB_INSTALL_partmap_module in /etc/default/grub (the presence of which prevents grub-probe -t partmap from being run at all). Of course there is the question of how to handle lvm (assuming it has this same problem). I guess it could be included in the fallback list, but I am unfamiliar with the drawbacks with increasing the size of the generated core.img. I guess that as its size increases, the likelihood that it becomes too fragmented for all its blocks to be listed in the MBR increases? Maybe instead grub-install could be made more intelligent; if grub-probe -t partmap fails then fall back to 'pc gpt' and also examine the device's sysfs entry; if it's /sys/block/md[0-9]+ then add 'raid', if it's /sys/block/dm-[0-9]+ then add 'lvm'. As an aside, /sys/block/dm-[0-9] does not automatically mean LVM... it just means that the block device is a device-mapper device, so it could be dm-crypt, or using dmraid... perhaps some other check for LVM should happen before grub-install goes to /sys. Come to think of it, the initramfs-generators, initramfs and yaird, have this same problem. I wonder if their detection code can be re-used... Anyway, the sysfs path of the block device can be obtained fairly simply once you have the major/minor device numbers with code like this: find /sys -name dev | while read line; do if test "$(<$line)" =3D '9:0'; then echo $(dirname $line); break; fi; done Perhaps libsysfs even has a function to do this. If sysfs is not available then grub-install can directly poke around /dev, /proc/mounts and so on. --=20 Sam Morris http://robots.org.uk/ PGP key id 1024D/5EA01078 3412 EA18 1277 354B 991B C869 B219 7FDB 5EA0 1078 --=-d5QclcjMn1kUMH+r6gj6 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBGTx8/shl/216gEHgRAtGlAJ9tgqXXpM7ke6HIIUQmpimcMUNNegCgkzuD eLVMsrHrdhNItVYWGGsCsfU= =xCwb -----END PGP SIGNATURE----- --=-d5QclcjMn1kUMH+r6gj6--