Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] UUID with Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Kasumi_Ninja
Veteran
Veteran


Joined: 18 Feb 2006
Posts: 1825
Location: The Netherlands

PostPosted: Sun Jul 20, 2008 8:48 pm    Post subject: [HOWTO] UUID with Gentoo Reply with quote

UUID can come in handy for those of us who want a fixed entry in fstab for their hard drives and/or removable media. And best off all, it's very easy! Here's how to do it:

1) Make sure you are using an initrd image to boot Gentoo (UUID requires this). if you haven't a initrd image you can create one easily with genkernel:
Code:
genkernel --install --bootloader=grub --menuconfig --disklabel all

2) Find out your devices unique volume id (substitute /dev/sda with your drive):
Code:
vol_id -u /dev/sda

3) Replace the /dev/sd* entries in your fstab with UUID= entries. Example fstab entry:
Code:
UUID=f28284cc-e994-4b3c-be52-cb45c427f88f       none                    swap            sw                      0 0

4)Reboot
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered


Last edited by Kasumi_Ninja on Mon Jul 21, 2008 7:31 am; edited 2 times in total
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Sun Jul 20, 2008 8:55 pm    Post subject: Reply with quote

Not sure about 1) in your Howto... UUIDs should work without initrd too.

General issue with uuid/label in gentoo: https://bugs.gentoo.org/show_bug.cgi?id=225669
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Jul 20, 2008 8:57 pm    Post subject: Reply with quote

Moved from Kernel & Hardware to Documentation, Tips & Tricks.

Looks like it belongs here
_________________
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
yabbadabbadont
Advocate
Advocate


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

PostPosted: Sun Jul 20, 2008 8:59 pm    Post subject: Reply with quote

When running genkernel (the latest stable version) you have to include the "--disklabel" option, or the blkid command will not be included in the initramfs image. (and mounting by label/uuid will fail)

Edit: Also, it is not necessary to use genkernel to build your kernel for this, as long as you include loopback, ramdisk, and initrd support in your kernel, you can use genkernel to only build an initrd. "genkernel --disklabel initrd" will only build an initrd image. You can then use this image with uuid/label mounting. (this is what I did with my manually configured kernel)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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