* grub-probe, but in reverse?
@ 2009-07-29 18:35 Colin Watson
2009-07-29 21:03 ` Pavel Roskin
0 siblings, 1 reply; 6+ messages in thread
From: Colin Watson @ 2009-07-29 18:35 UTC (permalink / raw)
To: grub-devel
$ sudo grub-probe -d /dev/sda1 -t drive
(hd0,1)
I have a reason to want to do the reverse of this: I have a
libparted-based program that ensures that at least one partition on a
disk is marked active (needed for some BIOSes), and would like to call
it on the disk selected for installation of GRUB in d-i. Of course
libparted is only going to understand OS device names. If possible I'd
rather avoid reading device.map by hand to figure out how to map (hd0,1)
back to /dev/sda1. Is there any way to do this with the code as it
stands, and if not would it make sense to make it possible to pass GRUB
device names to grub-probe?
Thanks,
--
Colin Watson [cjwatson@ubuntu.com]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: grub-probe, but in reverse?
2009-07-29 18:35 grub-probe, but in reverse? Colin Watson
@ 2009-07-29 21:03 ` Pavel Roskin
2009-07-31 10:36 ` Colin Watson
0 siblings, 1 reply; 6+ messages in thread
From: Pavel Roskin @ 2009-07-29 21:03 UTC (permalink / raw)
To: The development of GRUB 2
On Wed, 2009-07-29 at 19:35 +0100, Colin Watson wrote:
> $ sudo grub-probe -d /dev/sda1 -t drive
> (hd0,1)
>
> I have a reason to want to do the reverse of this: I have a
> libparted-based program that ensures that at least one partition on a
> disk is marked active (needed for some BIOSes), and would like to call
> it on the disk selected for installation of GRUB in d-i. Of course
> libparted is only going to understand OS device names. If possible I'd
> rather avoid reading device.map by hand to figure out how to map (hd0,1)
> back to /dev/sda1. Is there any way to do this with the code as it
> stands, and if not would it make sense to make it possible to pass GRUB
> device names to grub-probe?
I think device.map is fundamentally unreliable and should be obsoleted.
I don't know where you are getting the GRUB device names, but I suggest
that you use UUID instead.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: grub-probe, but in reverse?
2009-07-29 21:03 ` Pavel Roskin
@ 2009-07-31 10:36 ` Colin Watson
2009-07-31 11:15 ` Vladimir 'phcoder' Serbinenko
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Colin Watson @ 2009-07-31 10:36 UTC (permalink / raw)
To: The development of GRUB 2
On Wed, Jul 29, 2009 at 05:03:44PM -0400, Pavel Roskin wrote:
> On Wed, 2009-07-29 at 19:35 +0100, Colin Watson wrote:
> > $ sudo grub-probe -d /dev/sda1 -t drive
> > (hd0,1)
> >
> > I have a reason to want to do the reverse of this: I have a
> > libparted-based program that ensures that at least one partition on a
> > disk is marked active (needed for some BIOSes), and would like to call
> > it on the disk selected for installation of GRUB in d-i. Of course
> > libparted is only going to understand OS device names. If possible I'd
> > rather avoid reading device.map by hand to figure out how to map (hd0,1)
> > back to /dev/sda1. Is there any way to do this with the code as it
> > stands, and if not would it make sense to make it possible to pass GRUB
> > device names to grub-probe?
>
> I think device.map is fundamentally unreliable and should be obsoleted.
> I don't know where you are getting the GRUB device names, but I suggest
> that you use UUID instead.
They're entered by users choosing where to install GRUB, whom we can
hardly expect to enter UUIDs by hand. Perhaps we can figure out how to
give them a select list of available choices, which could then include
UUIDs behind the scenes ...
--
Colin Watson [cjwatson@ubuntu.com]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: grub-probe, but in reverse?
2009-07-31 10:36 ` Colin Watson
@ 2009-07-31 11:15 ` Vladimir 'phcoder' Serbinenko
2009-07-31 16:15 ` Robert Millan
2009-07-31 16:19 ` Pavel Roskin
2 siblings, 0 replies; 6+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-07-31 11:15 UTC (permalink / raw)
To: The development of GRUB 2
On Fri, Jul 31, 2009 at 12:36 PM, Colin Watson<cjwatson@ubuntu.com> wrote:
> On Wed, Jul 29, 2009 at 05:03:44PM -0400, Pavel Roskin wrote:
>> On Wed, 2009-07-29 at 19:35 +0100, Colin Watson wrote:
>> > $ sudo grub-probe -d /dev/sda1 -t drive
>> > (hd0,1)
>> >
>> > I have a reason to want to do the reverse of this: I have a
>> > libparted-based program that ensures that at least one partition on a
>> > disk is marked active (needed for some BIOSes), and would like to call
>> > it on the disk selected for installation of GRUB in d-i. Of course
>> > libparted is only going to understand OS device names. If possible I'd
>> > rather avoid reading device.map by hand to figure out how to map (hd0,1)
>> > back to /dev/sda1. Is there any way to do this with the code as it
>> > stands, and if not would it make sense to make it possible to pass GRUB
>> > device names to grub-probe?
>>
>> I think device.map is fundamentally unreliable and should be obsoleted.
>> I don't know where you are getting the GRUB device names, but I suggest
>> that you use UUID instead.
>
> They're entered by users choosing where to install GRUB, whom we can
> hardly expect to enter UUIDs by hand. Perhaps we can figure out how to
> give them a select list of available choices, which could then include
> UUIDs behind the scenes ...
>
Asking for an input like "/dev/sda1" isn't a big change. Bug choice
list is of course better
> --
> Colin Watson [cjwatson@ubuntu.com]
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'phcoder' Serbinenko
Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: grub-probe, but in reverse?
2009-07-31 10:36 ` Colin Watson
2009-07-31 11:15 ` Vladimir 'phcoder' Serbinenko
@ 2009-07-31 16:15 ` Robert Millan
2009-07-31 16:19 ` Pavel Roskin
2 siblings, 0 replies; 6+ messages in thread
From: Robert Millan @ 2009-07-31 16:15 UTC (permalink / raw)
To: The development of GRUB 2
On Fri, Jul 31, 2009 at 11:36:02AM +0100, Colin Watson wrote:
> On Wed, Jul 29, 2009 at 05:03:44PM -0400, Pavel Roskin wrote:
> > On Wed, 2009-07-29 at 19:35 +0100, Colin Watson wrote:
> > > $ sudo grub-probe -d /dev/sda1 -t drive
> > > (hd0,1)
> > >
> > > I have a reason to want to do the reverse of this: I have a
> > > libparted-based program that ensures that at least one partition on a
> > > disk is marked active (needed for some BIOSes), and would like to call
> > > it on the disk selected for installation of GRUB in d-i. Of course
> > > libparted is only going to understand OS device names. If possible I'd
> > > rather avoid reading device.map by hand to figure out how to map (hd0,1)
> > > back to /dev/sda1. Is there any way to do this with the code as it
> > > stands, and if not would it make sense to make it possible to pass GRUB
> > > device names to grub-probe?
> >
> > I think device.map is fundamentally unreliable and should be obsoleted.
> > I don't know where you are getting the GRUB device names, but I suggest
> > that you use UUID instead.
>
> They're entered by users choosing where to install GRUB, whom we can
> hardly expect to enter UUIDs by hand. Perhaps we can figure out how to
> give them a select list of available choices, which could then include
> UUIDs behind the scenes ...
Please don't use UUIDs for this. UUIDs identify a dataset (filesystem), not
its container. It's feasible for someone to install GRUB to a partition that
doesn't have any filesystem, for example.
Colin, in your specific problem, I think the best solution is to avoid using
GRUB drives entirely. When in userland, they're meant for GRUB internal
consumption, and we don't make promises about them matching any given device
later on (when we run on BIOS).
Instead, just give a Linux device to grub-install. E.g.:
$ grub-install /dev/sda1
Does this work for you?
Alternatively, when using the Debian package you can just rely on its
recently-added grub-pc/install_devices template. But I'm missing context
to your problem so I'm not sure if this helps.
--
Robert Millan
The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
how) you may access your data; but nobody's threatening your freedom: we
still allow you to remove your data and not access it at all."
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: grub-probe, but in reverse?
2009-07-31 10:36 ` Colin Watson
2009-07-31 11:15 ` Vladimir 'phcoder' Serbinenko
2009-07-31 16:15 ` Robert Millan
@ 2009-07-31 16:19 ` Pavel Roskin
2 siblings, 0 replies; 6+ messages in thread
From: Pavel Roskin @ 2009-07-31 16:19 UTC (permalink / raw)
To: The development of GRUB 2
On Fri, 2009-07-31 at 11:36 +0100, Colin Watson wrote:
> They're entered by users choosing where to install GRUB, whom we can
> hardly expect to enter UUIDs by hand.
Likewise, we shouldn't expect them to enter drives in the GRUB notation,
such as "(hd0)".
> Perhaps we can figure out how to
> give them a select list of available choices, which could then include
> UUIDs behind the scenes ...
Yes, something like that. Users should be able to choose the disk by
its size, maker, Linux device name.
Maybe GRUB could support disk UUID eventually, but in the meantime, a
UUID of one of the partitions would do, as long as it's indeed unique.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-07-31 16:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-29 18:35 grub-probe, but in reverse? Colin Watson
2009-07-29 21:03 ` Pavel Roskin
2009-07-31 10:36 ` Colin Watson
2009-07-31 11:15 ` Vladimir 'phcoder' Serbinenko
2009-07-31 16:15 ` Robert Millan
2009-07-31 16:19 ` Pavel Roskin
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.