Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
root=LABEL={something} in Grub [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
tenspd137
Guru
Guru


Joined: 22 Aug 2006
Posts: 391

PostPosted: Sat May 03, 2008 9:54 pm    Post subject: root=LABEL={something} in Grub [SOLVED] Reply with quote

I was wondering if anyone knows how to get grub to recognize labels on disks? For example, I have an older workstation that uses SCSI disks, so when I use the install cd, the system sees them as /dev/sd[ef]. I have assigned the labels using tune2fs -L to use because when I reboot, the kernel sees them as /dev/sd[ab]. I have the following set up:

/dev/sda1 - labe is BOOT
/dev/sda3 - label is ROOT
/dev/sdb1 - label is SPARE1

and in fstab
Code:

...
LABEL=BOOT /boot ext3 defaults,noatime 1 2
LABEL=ROOT / ext3 noatime 0 1
LABEL=SPARE1 /spare1 ext3 defaults 0 1
...


After fixing the device.map in /boot/grub
Code:

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


In my grub.conf,
Code:

title Gentoo Linux 2.6.24-r7
root (hd0,0)
kernel /boot/kernel-2.6.24-gentoo-r7 root=LABEL=ROOT
....

The kernel panics with
VFS: Cannot open root device "LABEL=ROOT" or unknown block(2,0)

but
kernel /boot/kernel-2.6.24-gentoo-r7 root=/dev/sda3
works fine

Can I get it to accept a label? I only want to do this because I have had the unfortunate problem of disks breaking in multi disk systems, so when they are removed, all the drives are relabeled new /dev/sdX designations.

Just a question, not an emergency - thanks for any answers!


Last edited by tenspd137 on Sun Jun 01, 2008 9:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
yabbadabbadont
Advocate
Advocate


Joined: 14 Mar 2003
Posts: 4791
Location: 2 exits past crazy

PostPosted: Sat May 03, 2008 11:04 pm    Post subject: Reply with quote

Try using UUID instead and see if it works. You will, of course, need to get the UUID of your root partition. An easy way is to look in /dev/disk/by-uuid.

Here is mine as an example:
Code:
/home/daffy $ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 2008-05-03 15:45 0b1639fd-e7c6-4a2f-a163-3258ce26dc8b -> ../../sda7
lrwxrwxrwx 1 root root 10 2008-05-03 15:45 0c400f84-71f7-4faf-8229-39417ef34b39 -> ../../hda4
lrwxrwxrwx 1 root root 10 2008-05-03 15:45 174c42d0-10cd-436d-aa0d-d94bbe062a3e -> ../../hda3
lrwxrwxrwx 1 root root 10 2008-05-03 15:45 2eacc7c6-729a-46a8-a6f9-8cd1b148a411 -> ../../sda6
lrwxrwxrwx 1 root root 11 2008-05-03 15:45 4830c333-6657-4a91-b8b2-551cc88d4fe4 -> ../../sda10
lrwxrwxrwx 1 root root 10 2008-05-03 15:45 53106d93-9666-4fb1-8177-01cb23930d55 -> ../../sda5
lrwxrwxrwx 1 root root 10 2008-05-03 15:45 5c4dce4d-83ee-419b-a770-18fea9c83359 -> ../../sda8
lrwxrwxrwx 1 root root 10 2008-05-03 15:45 5e7ca13e-5fce-4477-a967-68c2213a8d74 -> ../../hda2
lrwxrwxrwx 1 root root 10 2008-05-03 15:45 90B5-E9EB -> ../../hda1
lrwxrwxrwx 1 root root 10 2008-05-03 15:45 ef102bc3-f432-48fc-9bfe-c0fe27cb35fc -> ../../sda9

In my case, /dev/hda3 is my root partition, so I would configure my grub.conf like so:
Code:
kernel /bzImage root=UUID=174c42d0-10cd-436d-aa0d-d94bbe062a3e vga=775 quiet


Edit: Actually, now that I've thought about it a bit more, I think that it might be the initrd (or initramfs) image that is interpreting the "root=" line. If so, you might be out of luck.
Back to top
View user's profile Send private message
tenspd137
Guru
Guru


Joined: 22 Aug 2006
Posts: 391

PostPosted: Sun Jun 01, 2008 9:54 pm    Post subject: Reply with quote

Sorry - thought I closed this one - I do believe you are right - I don't have an initramfs on this box, which is why I don't think it is working. Thanks for the reply!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum