[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fallback for "grub-probe -t partmap" failures

From: Sam Morris
Subject: Re: fallback for "grub-probe -t partmap" failures
Date: Sat, 19 May 2007 17:01:03 +0100

On Sat, 2007-05-19 at 17:32 +0200, Robert Millan wrote:
> (please keep CC to upsteam..)
> 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)" = '9:0'; then
            echo $(dirname $line);

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.

Sam Morris

PGP key id 1024D/5EA01078
3412 EA18 1277 354B 991B  C869 B219 7FDB 5EA0 1078

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]