View previous topic :: View next topic |
Author |
Message |
Jonathan_R n00b
Joined: 21 Mar 2011 Posts: 17
|
Posted: Sat Aug 03, 2013 2:50 pm Post subject: GRUB and UUID |
|
|
I have been searching the net on the subject and can't find anything conclusive on the subject. The questions is, do I need initrd to use UUID in GRUB. I did not grub-static. I do have my fstab set to UUID and my grub.conf has root=<uuid some long string>. I have read some that say you have to have initrd and some say you don't need it. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54214 Location: 56N 3W
|
Posted: Sat Aug 03, 2013 3:04 pm Post subject: |
|
|
Jonathan_R,
Maybe. First, understand that all block devices have a UUID. This UUID describes a different object to the filesystem that the block device may contain. The filesystem has its own but different UUID.
With a GPT partition table, you have been able to use the block device UUID for some time (e.g. the UUID for /dev/sda1). The kernel code is being updated for MSDOS Partitions too. Try a recent kernel if you feel lucky :)
If you want to use the filesystem UUID, you still need the userspace mount command or busbox in an initrd. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Jonathan_R n00b
Joined: 21 Mar 2011 Posts: 17
|
Posted: Sat Aug 03, 2013 3:14 pm Post subject: |
|
|
Thanks for the quick reply. I am not doing GPT. Just a simple partition layout. sda2=/ sdb2=/home sda1=swap sdb1=swap Now, as I mentioned, I have these as UUID in my fstab. I did not use the genkernel. Last time I did that I kept having kernel panics. I am using 3.8.13. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54214 Location: 56N 3W
|
Posted: Sat Aug 03, 2013 3:36 pm Post subject: |
|
|
Jonathan_R,
Try it. Run /sbin/blkid to discover all of your blkIDs.
Find the blockid for /dev/sda2, not for / and put root=UUID=ba840a47-ca9a-4a8f-a867-9ab816c4537f use your UUID, not mine, into grub.conf
If it does not boot, boot the the grub sceen, press e then edit the kernel line to revert to root=/dev/sda2
This only changes the in memory grub.conf, revert the change properly once it boots. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Goverp Veteran
Joined: 07 Mar 2007 Posts: 1994
|
Posted: Sun Aug 04, 2013 8:40 am Post subject: Re: GRUB and UUID |
|
|
Jonathan_R wrote: | I have been searching the net on the subject and can't find anything conclusive on the subject. The questions is, do I need initrd to use UUID in GRUB. I did not grub-static. I do have my fstab set to UUID and my grub.conf has root=<uuid some long string>. I have read some that say you have to have initrd and some say you don't need it. |
Which GRUB are you using - "legacy" - i.e. grub-0.97-r12, or later versions "grub2"?
"legacy grub" knows nothing about UUIDs. The grub.conf line containing "root=..." is the kernel boot parameter list, and grub does nothing with it. The kernel is responsible for locating the root file system. The kernel can handle neither root=UUID=... nor root=LABEL=... However, a lot of initramfs (initrd) setups contain an init script that uses findfs to locate the root file system and do support UUIDs and LABELs.
AFAIK, grub2 does support UUIDs (and GPT and stuff), but I've not delved into it. _________________ Greybeard |
|
Back to top |
|
|
mv Watchman
Joined: 20 Apr 2005 Posts: 6747
|
Posted: Sun Aug 04, 2013 1:40 pm Post subject: Re: GRUB and UUID |
|
|
Goverp wrote: | The kernel can handle neither root=UUID=... nor root=LABEL=... |
The kernel can handle PARTUUID, but this requires that you use a special way to partition your harddisk (IIRC GPT) - it won't work with the usual DOS-compatbile partition table.
Quote: | AFAIK, grub2 does support UUIDs (and GPT and stuff), but I've not delved into it. |
Grub2 does support UUIDs e.g. to determine where the kernel image lies. However, grub2 has no possibility to guess how your kernel will name that partition, so this will not help you for the root=... kernel argument (although you could write some code doing some educated guessing with grub2, but I doubt that you can do something reliable without a ramdisk). |
|
Back to top |
|
|
srs5694 Guru
Joined: 08 Mar 2004 Posts: 434 Location: Woonsocket, RI
|
Posted: Sun Aug 04, 2013 4:54 pm Post subject: Re: GRUB and UUID |
|
|
Goverp wrote: | AFAIK, grub2 does support UUIDs (and GPT and stuff), but I've not delved into it. |
GRUB 2 definitely does support GPT. It works best with a BIOS Boot Partition. |
|
Back to top |
|
|
|