All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Morris <sam@robots.org.uk>
To: Robert Millan <rmh@aybabtu.com>
Cc: grub-devel@gnu.org
Subject: Re: fallback for "grub-probe -t partmap" failures
Date: Sat, 19 May 2007 17:01:03 +0100	[thread overview]
Message-ID: <1179590463.4270.24.camel@xerces> (raw)
In-Reply-To: <20070519153203.GA29790@aragorn>

[-- Attachment #1: Type: text/plain, Size: 2104 bytes --]

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);
            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.

-- 
Sam Morris
http://robots.org.uk/

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-05-19 16:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1178710623.4102.37.camel@xerces>
     [not found] ` <20070509135853.GA31878@aragorn>
     [not found]   ` <1178719368.4102.48.camel@xerces>
     [not found]     ` <20070509151643.GB16077@aragorn>
     [not found]       ` <1178725065.4102.65.camel@xerces>
2007-05-09 16:13         ` "grub-probe -t partmap" doesn't work with software RAID Robert Millan
     [not found]           ` <1179004601.3922.4.camel@xerces>
     [not found]             ` <1179054146.4014.9.camel@xerces>
2007-05-13 16:44               ` Robert Millan
2007-05-18  6:51                 ` Robert Millan
     [not found]                   ` <1179535793.4466.3.camel@xerces>
2007-05-19  9:33                     ` Bug#422851: " Robert Millan
     [not found]                       ` <1179575266.4466.5.camel@xerces>
2007-05-19 12:10                         ` Robert Millan
     [not found]                           ` <1179580232.4542.8.camel@xerces>
2007-05-19 14:08                             ` Robert Millan
     [not found]                               ` <1179585253.4270.1.camel@xerces>
2007-05-19 15:32                                 ` fallback for "grub-probe -t partmap" failures Robert Millan
2007-05-19 16:01                                   ` Sam Morris [this message]
     [not found]                             ` <1179584038.4145.10.camel@xerces>
2007-05-19 15:51                               ` problem with RAID and LBA addressing Robert Millan
     [not found]                                 ` <1179590781.4270.28.camel@xerces>
2007-05-19 16:45                                   ` Robert Millan
2007-05-19 17:51                                     ` Yoshinori K. Okuji
2007-05-20  7:12                                       ` Robert Millan
2007-05-21 13:25                                     ` Amin Azez
2007-05-21 13:44                                       ` Sam Morris
2007-05-21 11:08                               ` Bug#423022: Bug#422851: "grub-probe -t partmap" doesn't work with software RAID Jeroen Dekkers
2007-05-21 12:23                                 ` Sam Morris
2007-05-21 13:13                                   ` Jeroen Dekkers
2007-05-21 18:35                                     ` Sam Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1179590463.4270.24.camel@xerces \
    --to=sam@robots.org.uk \
    --cc=grub-devel@gnu.org \
    --cc=rmh@aybabtu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.