using "LABEL=" instead of sd[letter] or hd[digit] in grub

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

using "LABEL=" instead of sd[letter] or hd[digit] in grub

Postby LewRockwellFAN » Sat Apr 10, 2010 20:13

Can I direct grub toward a partition label or, as a poor second choice, a UUID, so that it will still work no matter what other drives I have plugged in? Right now, I booted this invocation (is that the right term?) of Sabayon 5.2-32bit by entering /sdb1 in a command line (I suppose from GRUB) when it complained it couldn't deal with sda1, which, of course, is because that particular "a" wasn't there when this particular GRUB was installed, and the "a" it is looking for is called "b" for now at least.

Every tutorial I find seems either out of date or applying to simpler Linuxes and addresses editing grub.cfg which now begins:
"#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
"

/sbin/grub-mkconfig, /etc/default/grub, /sbin/grub2-install, and all the files in /etc/grub.d seem to be editable and have some interesting stuff inside but nothing that obviously (to me at least) says where to look to for bootable partitions.

Maybe there is a better place for this post but I didn't see section devoted to boot issues.
LewRockwellFAN
Young Hen
 
Posts: 33
Joined: Sat Dec 05, 2009 16:25

Re: using "LABEL=" instead of sd[letter] or hd[digit] in gru

Postby Fitzcarraldo » Sun May 23, 2010 10:22

You could try to make Grub2 use UUIDs instead of devices. Try replacing root=/dev/sd<l><n> with root=UUID=<uuid>. See the article Ubuntu Community Documentation - Grub2 for details.

You can find out the UUID of a specific partition by using the blkid command:

Code: Select all
# blkid /dev/sd<l><n>
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: using "LABEL=" instead of sd[letter] or hd[digit] in gru

Postby Thev00d00 » Mon May 24, 2010 12:11

Here at least it uses UUIDs by default.
Image
Please report Bugs on the Bugzilla, not forum
Please Adopt an Unanswered thread
Website / Blog : v00d00.net
twitter: Follow Me
G+: Circle Me
Thev00d00
Generally Awesome (tm)
 
Posts: 1472
Joined: Wed Feb 21, 2007 15:52
Location: United Kingdom

Re: using "LABEL=" instead of sd[letter] or hd[digit] in gru

Postby Fitzcarraldo » Mon May 24, 2010 17:07

Not for me:

Code: Select all
# cat grub.cfg | grep real_root
        linux   /kernel-genkernel-x86_64-2.6.33-sabayon ro BOOT_IMAGE=/kernel-genkernel-x86_64-2.6.33-sabayon root=/dev/ram0 ramdisk=8192 real_root=/dev/sda6 init=/linuxrc splash=silent,theme:sabayon vga=791 console=tty1 quiet resume=swap:/dev/sda5 real_resume=/dev/sda5
        linux   /kernel-genkernel-x86_64-2.6.33-sabayon ro single BOOT_IMAGE=/kernel-genkernel-x86_64-2.6.33-sabayon root=/dev/ram0 ramdisk=8192 real_root=/dev/sda6 init=/linuxrc splash=silent,theme:sabayon vga=791 console=tty1 quiet resume=swap:/dev/sda5 real_resume=/dev/sda5


Code: Select all
# eix -I sys-boot/grub
[U] sys-boot/grub
     Available versions:  *0.92-r1 0.94-r1 0.96-r1 0.96-r2 (~)0.96-r3 (~)0.97 0.97-r2 0.97-r3 0.97-r4 0.97-r5 0.97-r6 (~)0.97-r8 0.97-r9 0.97-r22[1] (~)1.97.2-r1[1] (~)1.97.2-r2[1] **1.98 (~)1.98-r1[1] (~)1.98-r2[1] **9999 {custom-cflags debug multislot ncurses netboot static truetype}                                                                             
     Installed versions:  1.98-r1[1](17:23:50 13/05/10)(multislot truetype -custom-cflags -debug -static)
     Homepage:            http://www.gnu.org/software/grub/
     Description:         GNU GRUB 2 boot loader

[I] sys-boot/grub-handler [1]
     Available versions:  0.2-r4
     Installed versions:  0.2-r4(20:08:57 30/03/10)
     Homepage:            http://www.sabayonlinux.org/
     Description:         Sabayon Linux GRUB utilities

[1] "sabayon" /var/lib/layman/sabayon

Found 2 matches.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom


Return to Beginners|Newbies Area

Who is online

Users browsing this forum: No registered users and 4 guests