All of lore.kernel.org
 help / color / mirror / Atom feed
* search and boot using GPT GUID values
@ 2010-04-06  8:22 Simon Kitching
  2010-04-06 17:58 ` Isaac Dupree
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Kitching @ 2010-04-06  8:22 UTC (permalink / raw)
  To: grub-devel

Hi All,

I've been experimenting with booting linux from a GPT-formatted drive on
a BIOS-based x86 pc.

=== (1)
Is there a grub "search" command variant to find the (hdx,y) value for a
GPT partition GUID? (I can't see one).

If not, do you think this would be a useful thing? I might be interested
in trying to code this up.

Yes, search.fs_uuid can also be used; AFAICS there isn't a *huge*
advantage to using partition GUID here, but it fits well with (2) below.

=== (2)
When linux is started without an initrd, the root= param supports only
   * root=major:minor
   * root=number         where number is major<<n + minor
   * root=/dev/sd{n}{p}  
      where n depends on the order in which linux discovers the disks,
      and p is the partition index.

None of these options are robust against hardware changes that change
the linux disk enumeration order. When an initrd is used, then
UUID/LABEL can work around this but without initrd these are not
available.

So what do you think about
  (a) adding root=GUID as a kernel option
  (b) optionally using the search command from (1) above
so that something like the following can be done:

      set ROOTGUID=ABCD1234ABCD5678
      search.gpt_guid $ROOTGUID
      linux /mykernel root=$ROOTGUID

It seems to me that both the grub and kernel parts are reasonably
simple. The kernel just needs to be enhanced to store the GUID value on
the relevant device objects as it creates them. File do_mounts.c already
iterates over all devices to handle "/dev/sda1" style paths, so this can
just be enhanced to check the new GUID value too. And the "guidmap"
command should be really trivial.

Note that root=GUID can be implemented with just support for
partition-schemes compiled in to the linux kernel (which is usual; GPT
support is there by default). The GUID is just an array of 16 bytes in
the partition table, and linux scans the partition tables already.

This solution also appears to be reasonably cross-platform, as GPT is a
platform-independent and bootloader-independent specification.

Supporting filesystem UUID in the kernel without an initrd just isn't
going to happen; it requires filesystem drivers.

===
Any thoughts?

Regards,
Simon





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: search and boot using GPT GUID values
  2010-04-06  8:22 search and boot using GPT GUID values Simon Kitching
@ 2010-04-06 17:58 ` Isaac Dupree
  2010-04-10  8:40   ` Simon Kitching
  0 siblings, 1 reply; 4+ messages in thread
From: Isaac Dupree @ 2010-04-06 17:58 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Simon Kitching

On 04/06/10 04:22, Simon Kitching wrote:
> So what do you think about
>    (a) adding root=GUID as a kernel option

That's something you need to ask Linux folks, not GRUB folks.  For 
non-initrd usage, it sounds plausible to me that you'd have a chance of 
achieving some linux-kernel-change (as long as you restrict the 
code-bloat to when GPT or a similar partition-table-format-with-uuids is 
enabled in the kernel-config).  But it ought to work in common initrds 
too, not just non-initrd mode! (Distributors, such as Debian, I think 
are the people who arrange initrds currently...)  So you have a few 
people to chase down, and ask, and possibly follow up by sending patches 
to, etc... good luck! Be ingenious in response to flames!

>    (b) optionally using the search command from (1) above
> so that something like the following can be done:

gpt-guid has been discussed on this GRUB list quite recently -- did you 
see Vladmir's post?
http://www.mail-archive.com/grub-devel@gnu.org/msg15345.html

-Isaac



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: search and boot using GPT GUID values
  2010-04-06 17:58 ` Isaac Dupree
@ 2010-04-10  8:40   ` Simon Kitching
  2010-04-21  7:17     ` gburanov
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Kitching @ 2010-04-10  8:40 UTC (permalink / raw)
  To: grub-devel

On Tue, 2010-04-06 at 13:58 -0400, Isaac Dupree wrote:
> On 04/06/10 04:22, Simon Kitching wrote:
> > So what do you think about
> >    (a) adding root=GUID as a kernel option
> 
> That's something you need to ask Linux folks, not GRUB folks.  For 
> non-initrd usage, it sounds plausible to me that you'd have a chance of 
> achieving some linux-kernel-change (as long as you restrict the 
> code-bloat to when GPT or a similar partition-table-format-with-uuids is 
> enabled in the kernel-config).  But it ought to work in common initrds 
> too, not just non-initrd mode! (Distributors, such as Debian, I think 
> are the people who arrange initrds currently...)  So you have a few 
> people to chase down, and ask, and possibly follow up by sending patches 
> to, etc... good luck! Be ingenious in response to flames!

Yes, I'm willing to have a go at the linux side of this (and have my
flame-proof underwear ready). I just wanted to see if anyone here was
going to tell me this (or some equivalent functionality) already exists,
or it was a stupid idea for other reasons.

Good point about having to fix with-initrd case as well as
without-initrd; it certainly would be inconsistent otherwise.

I don't expect to make *rapid* progress on this, but IMO it's worth a
try.

> 
> >    (b) optionally using the search command from (1) above
> > so that something like the following can be done:
> 
> gpt-guid has been discussed on this GRUB list quite recently -- did you 
> see Vladmir's post?
> http://www.mail-archive.com/grub-devel@gnu.org/msg15345.html
> 

Thanks for the link; I just subscribed recently and had missed that
thread. That is exactly the functionality I was looking for, and I'm
glad the general concept seems to meet with support (although there were
some concerns about the details of the proposed patch). I'll test George
Buranov's patch and add feedback on that thread.

Regards,
Simon





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: search and boot using GPT GUID values
  2010-04-10  8:40   ` Simon Kitching
@ 2010-04-21  7:17     ` gburanov
  0 siblings, 0 replies; 4+ messages in thread
From: gburanov @ 2010-04-21  7:17 UTC (permalink / raw)
  To: grub-devel

Great that somebody agrees with me on the GUIDs =)

In you have problems with compile/testing, feel free to reply here (or to my mail directly). I ahave made some fixes to it.

Again, I am talking about integration it to the GRUB. This is MUST HAVE feature, at least for UEFI support

--
This message was sent on behalf of gburanov@gmail.com at openSubscriber.com
http://www.opensubscriber.com/message/grub-devel@gnu.org/13731119.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-21 11:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-06  8:22 search and boot using GPT GUID values Simon Kitching
2010-04-06 17:58 ` Isaac Dupree
2010-04-10  8:40   ` Simon Kitching
2010-04-21  7:17     ` gburanov

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.