Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GRUB and UUID
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
Jonathan_R
n00b
n00b


Joined: 21 Mar 2011
Posts: 17

PostPosted: Sat Aug 03, 2013 2:50 pm    Post subject: GRUB and UUID Reply with quote

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
Code:
emerge grub
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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54212
Location: 56N 3W

PostPosted: Sat Aug 03, 2013 3:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jonathan_R
n00b
n00b


Joined: 21 Mar 2011
Posts: 17

PostPosted: Sat Aug 03, 2013 3:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54212
Location: 56N 3W

PostPosted: Sat Aug 03, 2013 3:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
Goverp
Veteran
Veteran


Joined: 07 Mar 2007
Posts: 1993

PostPosted: Sun Aug 04, 2013 8:40 am    Post subject: Re: GRUB and UUID Reply with quote

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
Code:
emerge grub
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
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Sun Aug 04, 2013 1:40 pm    Post subject: Re: GRUB and UUID Reply with quote

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
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Sun Aug 04, 2013 4:54 pm    Post subject: Re: GRUB and UUID Reply with quote

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
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