Re: Having Grub2 use UUID instead of (hd0,1)?

2010-01-10 Thread Nate Bargmann
* Tom H  [2010 Jan 09 23:56 -0600]:

> Apologies for the delayed reply. I do not understand your hda message
> when upgrading grub2 and if running grub-mkdevicemap gives you an sda
> map. Did you run grub-mkdevicemap while booted with Sidux running and
> upgrade grub2 with Debian running?

I did both while running the Sidux kernel in place of the Debian one. 
That is the only Sidux package I am using.  The error seems harmless as
I recently upgraded the grub-pc package, saw the same HDA error, but
grub.cfg was properly written and booting worked as normal.

Regardless, I think my original problem was an incorrect device.map for
the Sidux kernel.  Once that was corrected, all seems to work.

- Nate >>

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://n0nb.us/index.html


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2010-01-09 Thread Tom H
> I just did an update on the laptop and I get the following output from
> aptitude when upgrading the Grub2 packages:

> Setting up grub-common (1.98~20100101-1) ...
> Installing new version of config file /etc/grub.d/00_header ...
> Setting up grub-pc (1.98~20100101-1) ...
> /usr/sbin/grub-probe: error: cannot stat `/dev/hda'
> Invalid device `/dev/hda':
> Try ``/usr/sbin/grub-setup --help'' for more information.
> Generating grub.cfg ...

> It the finds the splash image and the kernels on the various partitions
> correctly.

> Checking device.map, I see that it has not changed since Dec 28 when I
> last created it (see one of my previous mails to this list) and
> grub.cfg has the various "set root=(hd0,x)" lines set correctly.

>> Please back up your device.map and run "grub-mkdevicemap". If it
>> doesn't re-create a proper device.map, you should file a bug. A
>> "(/dev/sda,1)  /dev/sda1" line is definitely wrong. AFAIK,
>> "grub-mkdevicemap" should return (for example)
>> 
>> (hd0)   /dev/sda
>> (hd1)   /dev/sdb
>> ...
>> 
>> No partitions and no system device within the parenthesis of the grub device.

> I just ran `grub-makedevicemap' and it recreated /boot/grub/device.map
> which contains the single line:

> (hdo)   /dev/sda

> Which is that same as the previous copy I generated on Dec 28 and is
> correct for the running kernel which has a `df' output that lists
> '/dev/sda1' as '/' and '/dev/sda6' as '/home' which is correct.  Since
> my kernel stanzas use UUID the Sidux and Debian kernels can call the
> partitions whatever they want (with a Debian kernel the partitions will
> be named '/dev/hda1' and '/dev/hda6'.

> What is puzzling is the error reported upon the Grub2 upgrade.  Where
> did it come up with '/dev/hda' given that all disk identifiers with
> the running kernel as of the update are of '/dev/sd*'?

> As of now my laptop appears to be updating and booting correctly.  My
> issue may have been related to an outdated '/boot/grub/device.map'
> after I started using the Sidux kernels. Should I switch back to a
> Debian kernel and update Grub2, then the process will probably fail
> unless the device.map file contains "(hd0)   /dev/hda".
>
> Here is a corner case where it would be nice if the device.map file
> could point to a UUID, but since those seem to exist only on a
> partition level, it's likely not possible since I'm installing Grub to
> the MBR. Another alternative would be for the Debian kernels to treat
> all disks as /dev/sd* as do a lot of other distributions.

Apologies for the delayed reply. I do not understand your hda message
when upgrading grub2 and if running grub-mkdevicemap gives you an sda
map. Did you run grub-mkdevicemap while booted with Sidux running and
upgrade grub2 with Debian running?


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2010-01-02 Thread Nate Bargmann
* Tom H  [2009 Dec 28 22:19 -0600]:

I just did an update on the laptop and I get the following output from
aptitude when upgrading the Grub2 packages:

Setting up grub-common (1.98~20100101-1) ...
Installing new version of config file /etc/grub.d/00_header ...
Setting up grub-pc (1.98~20100101-1) ...
/usr/sbin/grub-probe: error: cannot stat `/dev/hda'
Invalid device `/dev/hda':
Try ``/usr/sbin/grub-setup --help'' for more information.
Generating grub.cfg ...

It the finds the splash image and the kernels on the various partitions
correctly.

Checking device.map, I see that it has not changed since Dec 28 when I
last created it (see one of my previous mails to this list) and
grub.cfg has the various "set root=(hd0,x)" lines set correctly.

> Please back up your device.map and run "grub-mkdevicemap". If it
> doesn't re-create a proper device.map, you should file a bug. A
> "(/dev/sda,1)   /dev/sda1" line is definitely wrong. AFAIK,
> "grub-mkdevicemap" should return (for example)
> 
> (hd0)   /dev/sda
> (hd1)   /dev/sdb
> ...
> 
> No partitions and no system device within the parenthesis of the grub device.

I just ran `grub-makedevicemap' and it recreated /boot/grub/device.map
which contains the single line:

(hdo)   /dev/sda


Which is that same as the previous copy I generated on Dec 28 and is
correct for the running kernel which has a `df' output that lists
'/dev/sda1' as '/' and '/dev/sda6' as '/home' which is correct.  Since
my kernel stanzas use UUID the Sidux and Debian kernels can call the
partitions whatever they want (with a Debian kernel the partitions will
be named '/dev/hda1' and '/dev/hda6'.

What is puzzling is the error reported upon the Grub2 upgrade.  Where
did it come up with '/dev/hda' given that all disk identifiers with
the running kernel as of the update are of '/dev/sd*'?

As of now my laptop appears to be updating and booting correctly.  My
issue may have been related to an outdated '/boot/grub/device.map'
after I started using the Sidux kernels.  Should I switch back to a
Debian kernel and update Grub2, then the process will probably fail
unless the device.map file contains "(hd0)   /dev/hda".

Here is a corner case where it would be nice if the device.map file
could point to a UUID, but since those seem to exist only on a
partition level, it's likely not possible since I'm installing Grub to
the MBR.  Another alternative would be for the Debian kernels to treat
all disks as /dev/sd* as do a lot of other distributions.

HNY,

- Nate >>

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://n0nb.us/index.html


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Tom H
>> Do both the "set root" and "search" lines point to the partition where /boot 
>> is?
>> To check the UUID of /boot:
>> grub-probe -t fs_uuid /boot

> Yes.


>> [And (just in case), unlike grub1, for grub2 sda1<-->(hd0,1), 
>> sda2<-->(hd0,2).]

For the sake of thread-completeness, to check the grub device of /boot
grub-probe -t drive /boot


> Today I decided to remove the device.map file and then I could issue:
> `grub-install '(hd0)''
> and it installed to the MBR and a subsequent `update-grub' put the
> 'set root=(hd0,1)' line in grub.cfg correctly even though I was running
> the Sidux kernel and `df' shows my root partition to be /dev/sda1.  I
> did a system restart try a new Sidux kernel and the reboot went fine.
> 'grub.cfg' has all the UUIDs correct for each partition.
> The next test will be whenever the grub packages are updated which is
> usually where this all goes awry as somehow (/dev/sda,1) gets into
> grub.cfg instead of (hd0,1). This is where I think that if Grub would
> just use the UUID that kind of mixup would be much less likely.

Please back up your device.map and run "grub-mkdevicemap". If it
doesn't re-create a proper device.map, you should file a bug. A
"(/dev/sda,1)   /dev/sda1" line is definitely wrong. AFAIK,
"grub-mkdevicemap" should return (for example)

(hd0)   /dev/sda
(hd1)   /dev/sdb
...

No partitions and no system device within the parenthesis of the grub device.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Nate Bargmann
* Tom H  [2009 Dec 28 20:18 -0600]:
> I am going through this thread backwards, with apologies...
> 
> Do both the "set root" and "search" lines point to the partition where /boot 
> is?
> 
> To check the UUID of /boot:
> grub-probe -t fs_uuid /boot

Yes.

> [And (just in case), unlike grub1, for grub2 sda1<-->(hd0,1), 
> sda2<-->(hd0,2).]

Today I decided to remove the device.map file and then I could issue:

`grub-install '(hd0)''

and it installed to the MBR and a subsequent `update-grub' put the 
'set root=(hd0,1)' line in grub.cfg correctly even though I was running
the Sidux kernel and `df' shows my root partition to be /dev/sda1.  I
did a system restart try a new Sidux kernel and the reboot went fine. 
'grub.cfg' has all the UUIDs correct for each partition.

The next test will be whenever the grub packages are updated which is
usually where this all goes awry as somehow (/dev/sda,1) gets into
grub.cfg instead of (hd0,1).  This is where I think that if Grub would
just use the UUID that kind of mixup would be much less likely.

- Nate >>

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://n0nb.us/index.html


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Nate Bargmann
* Tom H  [2009 Dec 28 19:55 -0600]:

> >From /usr/lib/grub/grub-mkconfig_lib (which is sourced by all files in
> /etc/grub.d):
> 
> 
> # If there's a filesystem UUID that GRUB is capable of identifying, use it;
> # otherwise set root as per value in device.map.
> echo "set root=`${grub_probe} --device ${device} --target=drive`"
> if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2>
> /dev/null`" ; then
> echo "search --no-floppy --fs-uuid --set ${fs_uuid}"
> fi
> 
> 
> If you do not want the "set root..." line, comment it out.
> 
> If you want the "set root" line to use UUIDs, change "--target=drive"
> to "--target=fs_uuid" (and possibly add "UUID=" after "root=" like the
> "linux" line).
> 
> You _might_ also have to add an "insmod fs_uuid" line above the "set root=" 
> one.

Interesting and thanks much for the sleuth work.  Seems as though this
should be configurable via /etc/default/grub which may make for a nice
wishlist bug report.  I'll have to check into that.

- Nate >>

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://n0nb.us/index.html


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Tom H
> Is it possible to tell Grub2 to use the UUID of the partition
> /boot/grub resides instead of its default (hd0,1) notation? The reason
> I ask is that I am using a custom kernel that treats all drives as sda,
> but Debian's Grub2 pukes on it. Specifically, installing and updating
> Grub results in "/dev/sda" in /boot/grub.cfg and then boot fails as
> grub evidently sees it as an IDE drive, which it is. It seems as
> though if Grub could use UUI internally as the kernel does, this issue
> would be resolved. So far my Googler has come up empty.

I am going through this thread backwards, with apologies...

Do both the "set root" and "search" lines point to the partition where /boot is?

To check the UUID of /boot:
grub-probe -t fs_uuid /boot

[And (just in case), unlike grub1, for grub2 sda1<-->(hd0,1), sda2<-->(hd0,2).]


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Tom H
> I'm not sure that's what the OP was asking for, though, because I'm
> unclear as to how he could have a kernel that treats all drives as sda..

> Sounds pretty risky to me.

This is standard behaviour for Fedora and Ubuntu. The kernel uses
libata for both SATA and PATA.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Tom H
>> Hmm, didn't need to do anything special. The default config for grub2 in
>> squeeze and sid has this:
>> ,[ /etc/default/grub ]
>> | # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to 
>> Linux
>> | #GRUB_DISABLE_LINUX_UUID=true

> That's not what I'm asking about.  My kernels use UUID just fine and I
> don't want that to change.  I'm asking about having Grub use the UUID
> instead of (hd0,1), etc.

> In other words, and I should have done this initially, look at this
> snippet from /boot/grub/grub.cfg:

> ### BEGIN /etc/grub.d/00_header ###
> set default=0
> insmod ext2
> set root=(hd1,1)
> search --no-floppy --fs-uuid --set 85f5c3de-852d-43bf-a8cd-9001efb0d93c

> Lines 4 and 5 seem to be in conflict with each other.  Why have a "set
> root=(hd1.1)" line when the "search" line that follows specifies the
> correct UUID?  My question was, how can I tell the scripts to not issue
> the "set root" line and just use the "search" line with the UUID?  Will
> Grub2 work with just the UUID (it would seem the Ubunutu folks should
> have solved this already)?  To me it seems that using UUID should be
> preferred.

> While I like the probing features and automatic configuration in
> general, I'd prefer that the more critical settings be overridden by my
> required static defaults.

>From /usr/lib/grub/grub-mkconfig_lib (which is sourced by all files in
/etc/grub.d):


# If there's a filesystem UUID that GRUB is capable of identifying, use it;
# otherwise set root as per value in device.map.
echo "set root=`${grub_probe} --device ${device} --target=drive`"
if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2>
/dev/null`" ; then
echo "search --no-floppy --fs-uuid --set ${fs_uuid}"
fi


If you do not want the "set root..." line, comment it out.

If you want the "set root" line to use UUIDs, change "--target=drive"
to "--target=fs_uuid" (and possibly add "UUID=" after "root=" like the
"linux" line).

You _might_ also have to add an "insmod fs_uuid" line above the "set root=" one.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Chris Jones
On Mon, Dec 28, 2009 at 07:14:14AM EST, Nate Bargmann wrote:
> * Chris Jones  [2009 Dec 28 05:49 -0600]:

[..]

> > unclear as to how he could have a kernel that treats all drives as
> > sda..

> All Ubuntu kernels treat any drive as an sd? and since I'm
> experimenting with a Sidux kernel to get the PREEMPT capability to
> improve desktop performance, it does the same thing.  Actually, it
> seems as though by treating every drive as an sd? that a lot of these
> sorts of issues are solved.

> > Sounds pretty risky to me.

Oh, OK.. they still have distinct identifiers, sda, sdb.. etc. right?

> I don't know why.  The CD recording software has done that for years
> regardless of whether the writer is actually an IDE or SCSI device.

To the casual onlooker, what you initially wrote made it sound as if
your kernel referred to all drives as /dev/sda .. I was merely hinting
that you probably needed to give a bit more detail about this.

> > The good news is that I read somewhere that the grub folks now have
> > dedicated someone to documenting the program ;-)

> That would be most helpful.  

I think I got this from the #grub irc channel, from s/o who appeared to
be a reliable source.

> I've yet to try your suggestion as this weekend was one full of
> shoveling snow and other winter time duties. I will play with it once
> Ma Nature leaves us alone for a while.

Not holding my breath.. doesn't look promising, does it..? :-)

As to my suggestion, that's something else I got from the irc channel
and it did the trick for my USB stick clone. 

I'm quite sure that update-grub does not tamper with the stanzas that
you create manually in /etc/grub.d/40_custom, so if you don't specify a
"set root=" there, the gen'd /boot/grub/grub.cfg should only contain
references to the UUID.

CJ


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Andrei Popescu
On Mon,28.Dec.09, 15:04:01, Andrei Popescu wrote:
> On Mon,28.Dec.09, 06:24:19, Nate Bargmann wrote:
>  
> > Lines 4 and 5 seem to be in conflict with each other.  Why have a "set
> > root=(hd1.1)" line when the "search" line that follows specifies the
> > correct UUID?  My question was, how can I tell the scripts to not issue
> > the "set root" line and just use the "search" line with the UUID?  Will
> > Grub2 work with just the UUID (it would seem the Ubunutu folks should
> > have solved this already)?  To me it seems that using UUID should be
> > preferred.
> 
> According to the thread at [0] it seems grub should work fine with 
> either of the two lines (and you can even use the label instead of UUID) 
> and the 'search ... --set' actually overrides the 'set root' directive.
> 
> Why the 'set root' is still kept beats me...

...oops forgot the [0]

[0] http://forums.linuxmint.com/viewtopic.php?f=46&t=38599&p=221676

Regards,
Andrei
-- 
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic


signature.asc
Description: Digital signature


Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Andrei Popescu
On Mon,28.Dec.09, 06:24:19, Nate Bargmann wrote:
 
> Lines 4 and 5 seem to be in conflict with each other.  Why have a "set
> root=(hd1.1)" line when the "search" line that follows specifies the
> correct UUID?  My question was, how can I tell the scripts to not issue
> the "set root" line and just use the "search" line with the UUID?  Will
> Grub2 work with just the UUID (it would seem the Ubunutu folks should
> have solved this already)?  To me it seems that using UUID should be
> preferred.

According to the thread at [0] it seems grub should work fine with 
either of the two lines (and you can even use the label instead of UUID) 
and the 'search ... --set' actually overrides the 'set root' directive.

Why the 'set root' is still kept beats me...

Regards,
Andrei
-- 
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic


signature.asc
Description: Digital signature


Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Nate Bargmann
* Andrei Popescu  [2009 Dec 28 04:42 -0600]:
> Hmm, didn't need to do anything special. The default config for grub2 in 
> squeeze and sid has this:
> 
> 
> ,[ /etc/default/grub ]
> | # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to 
> Linux
> | #GRUB_DISABLE_LINUX_UUID=true
> `

That's not what I'm asking about.  My kernels use UUID just fine and I
don't want that to change.  I'm asking about having Grub use the UUID
instead of (hd0,1), etc.

In other words, and I should have done this initially, look at this
snippet from /boot/grub/grub.cfg:

### BEGIN /etc/grub.d/00_header ###
set default=0
insmod ext2
set root=(hd1,1)
search --no-floppy --fs-uuid --set 85f5c3de-852d-43bf-a8cd-9001efb0d93c
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  insmod gfxterm
  insmod vbe
  if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
  fi
fi
set locale_dir=/boot/grub/locale
set lang=en
insmod gettext
set timeout=10
### END /etc/grub.d/00_header ###


Lines 4 and 5 seem to be in conflict with each other.  Why have a "set
root=(hd1.1)" line when the "search" line that follows specifies the
correct UUID?  My question was, how can I tell the scripts to not issue
the "set root" line and just use the "search" line with the UUID?  Will
Grub2 work with just the UUID (it would seem the Ubunutu folks should
have solved this already)?  To me it seems that using UUID should be
preferred.

While I like the probing features and automatic configuration in
general, I'd prefer that the more critical settings be overridden by my
required static defaults.

- Nate >>

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://n0nb.us/index.html


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Nate Bargmann
* Chris Jones  [2009 Dec 28 05:49 -0600]:
> I am able to boot a clone of my "lenny" system that lives on a USB stick
> and I actually had to manually remove the "set root=" statement, because
> it was confusing grub2 - namely a "set root=(hd1,1) .. or hd2, or hd3..
> or sda, sdb, sdc.. always resulted in some message or other to the
> effect that there was no such partition.

That's what I'm running into.

> I'm not sure that's what the OP was asking for, though, because I'm
> unclear as to how he could have a kernel that treats all drives as sda..

All Ubuntu kernels treat any drive as an sd? and since I'm
experimenting with a Sidux kernel to get the PREEMPT capability to
improve desktop performance, it does the same thing.  Actually, it
seems as though by treating every drive as an sd? that a lot of these
sorts of issues are solved.

> Sounds pretty risky to me.

I don't know why.  The CD recording software has done that for years
regardless of whether the writer is actually an IDE or SCSI device.

> The good news is that I read somewhere that the grub folks now have
> dedicated someone to documenting the program ;-)

That would be most helpful.  I've yet to try your suggestion as this
weekend was one full of shoveling snow and other winter time duties.  I
will play with it once Ma Nature leaves us alone for a while.

- Nate >>

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Ham radio, Linux, bikes, and more: http://n0nb.us/index.html


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Chris Jones
On Mon, Dec 28, 2009 at 05:40:52AM EST, Andrei Popescu wrote:
> On Fri,25.Dec.09, 16:19:13, Nate Bargmann wrote:
> > Is it possible to tell Grub2 to use the UUID of the partition
> > /boot/grub resides instead of its default (hd0,1) notation?  The reason
> > I ask is that I am using a custom kernel that treats all drives as sda,
> > but Debian's Grub2 pukes on it.  Specifically, installing and updating
> > Grub results in "/dev/sda" in /boot/grub.cfg and then boot fails as
> > grub evidently sees it as an IDE drive, which it is.  It seems as
> > though if Grub could use UUI internally as the kernel does, this issue
> > would be resolved.  So far my Googler has come up empty.
> 
> Hmm, didn't need to do anything special. The default config for grub2 in 
> squeeze and sid has this:
> 
> 
> ,[ /etc/default/grub ]
> | # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to 
> Linux
> | #GRUB_DISABLE_LINUX_UUID=true
> `

But you still end up with an initial "set root=(hd0,1)" or such like at
the beginning of you grub.cfg stanzas. Which to me does not make sense,
since the ensuing "search" and "linux" statements refer to the UUID of
the partition, and are sufficient to find you kernel and boot it. 

And either the "search" or maybe the "linux" statement, if successful,
appear to point grub to the correct place, since it is also able to find
the initrd image.

I am able to boot a clone of my "lenny" system that lives on a USB stick
and I actually had to manually remove the "set root=" statement, because
it was confusing grub2 - namely a "set root=(hd1,1) .. or hd2, or hd3..
or sda, sdb, sdc.. always resulted in some message or other to the
effect that there was no such partition.

I'm not sure that's what the OP was asking for, though, because I'm
unclear as to how he could have a kernel that treats all drives as sda..

Sounds pretty risky to me.

The good news is that I read somewhere that the grub folks now have
dedicated someone to documenting the program ;-)

CJ



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-28 Thread Andrei Popescu
On Fri,25.Dec.09, 16:19:13, Nate Bargmann wrote:
> Is it possible to tell Grub2 to use the UUID of the partition
> /boot/grub resides instead of its default (hd0,1) notation?  The reason
> I ask is that I am using a custom kernel that treats all drives as sda,
> but Debian's Grub2 pukes on it.  Specifically, installing and updating
> Grub results in "/dev/sda" in /boot/grub.cfg and then boot fails as
> grub evidently sees it as an IDE drive, which it is.  It seems as
> though if Grub could use UUI internally as the kernel does, this issue
> would be resolved.  So far my Googler has come up empty.

Hmm, didn't need to do anything special. The default config for grub2 in 
squeeze and sid has this:


,[ /etc/default/grub ]
| # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
| #GRUB_DISABLE_LINUX_UUID=true
`

Regards,
Andrei
-- 
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic


signature.asc
Description: Digital signature


Re: Having Grub2 use UUID instead of (hd0,1)?

2009-12-25 Thread Chris Jones
On Fri, Dec 25, 2009 at 05:19:13PM EST, Nate Bargmann wrote:
> Is it possible to tell Grub2 to use the UUID of the partition
> /boot/grub resides instead of its default (hd0,1) notation?  The reason
> I ask is that I am using a custom kernel that treats all drives as sda,
> but Debian's Grub2 pukes on it.  Specifically, installing and updating
> Grub results in "/dev/sda" in /boot/grub.cfg and then boot fails as
> grub evidently sees it as an IDE drive, which it is.  It seems as
> though if Grub could use UUI internally as the kernel does, this issue
> would be resolved.  So far my Googler has come up empty.
> 
> - Nate >>

# vol_id¹ --UUID /dev/sda1 # or whatever ..

Add this to /etc/grub.d/40_custom

search --no-floppy --fs-uuid --set fb796a23-e59e-4e15-ba92-15f0cd087714²
linux /boot/vmlinuz-2.6.26-1-686 
root=UUID=fb796a23-e59e-4e15-ba92-15f0cd087714² ro
initrd /boot/initrd.img-2.6.26-1-686

# update-grub³

Nowhere is there any /dev/ in the above and it works on my system.

CJ

¹ That's the command I use on 'lenny' - I had to use something else on a
  more recent system .. not sure what .. blkid, maybe?

² Replace by the output of vol_id --UUID

³ Or print the sample above and UUID and enter the commands manually via
  the grub2 editor




-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org