Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] grub and UUID
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
kingfame_147
Apprentice
Apprentice


Joined: 11 Oct 2008
Posts: 171

PostPosted: Thu Aug 26, 2010 10:12 pm    Post subject: [SOLVED] grub and UUID Reply with quote

Hi,

does anybody has an idea why I can't use UUID with my grub?

Code:

title Gentoo Linux 2.6.35-r4
root (hd0,0)
kernel /boot/kernel-2.6.35-gentoo-r4 root=UUID=5ff86376-732b-48c1-a384-e2fbdd7a5727 video=2560x1600
savedefault


Code:

scooter ~ # grub --version
grub (GNU GRUB 0.97)


Code:

scooter by-uuid # blkid | grep sdb4
/dev/sdb4: UUID="5ff86376-732b-48c1-a384-e2fbdd7a5727" UUID_SUB="af3c37dc-4d8e-4a11-946d-ba8410c4937c" TYPE="btrfs"



I've no clue why it doesn"t work.


Thanks for your thoughts on that one.

Regards,
fame


Last edited by kingfame_147 on Sun Aug 29, 2010 8:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2664
Location: Slovenia

PostPosted: Thu Aug 26, 2010 10:17 pm    Post subject: Reply with quote

You're not using an initrd, that's your issue. UUID and LABEL stuff is not handled by the kernel, it's handled inside the initrd, which converts UUID or LABEL into the appropriate /dev/sdXY
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Aug 26, 2010 10:18 pm    Post subject: Reply with quote

kingfame_147,

The kernel does not understand UUID itself. You need an initrd to make that work, so you can call mount before the root filesystem is mounted.
_________________
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
kingfame_147
Apprentice
Apprentice


Joined: 11 Oct 2008
Posts: 171

PostPosted: Thu Aug 26, 2010 10:25 pm    Post subject: Reply with quote

I thought the gentoo kernel uses some kind of default initrd which is inside the kernel.

I used busybox some time ago to mount / as an aes encrypted device, but there were no UUID available per default, I had to create those links by myself inside the init script using blkid etc.
What kind of initrd should I use for that task? I only want to use UUID/LABEL, nothing more :)


Edit:
Ok, I found the gentoo initrd guide with the information I need. Thanks for the help.
I thought that those uuids are avaible per default, like in centos etc. I was wrong :)
Back to top
View user's profile Send private message
kingfame_147
Apprentice
Apprentice


Joined: 11 Oct 2008
Posts: 171

PostPosted: Fri Aug 27, 2010 12:03 pm    Post subject: Reply with quote

Hi,

back again with a new problem :D

I setup my busybox with a init script etc.
The problem now is that within the busybox the UUID from the root device isn't there. If I boot into the busybox and do a 'blkid' all devices are there expect the root device o_0 Therefore 'findfs' can't find the device with the given UUID. Any idea?

I'm using mdev like mentioned in the tutorial. /dev/sdb4 (which is my root device) is avaible in the busybox and I can boot normaly when using root=/dev/sdb4.
After booting the gentoo system blkid shows the UUID of the root device. Btw: The root device uses btrfs as the fs.

Regards,
fame
Back to top
View user's profile Send private message
AdmiralNemo
Apprentice
Apprentice


Joined: 25 Sep 2004
Posts: 247
Location: Overland Park, KS

PostPosted: Sat Aug 28, 2010 6:20 am    Post subject: Reply with quote

Check out the Initramfs article on the Gentoo Wiki. It discusses exactly what you want to do.
_________________
Help the Unanswered
Back to top
View user's profile Send private message
kingfame_147
Apprentice
Apprentice


Joined: 11 Oct 2008
Posts: 171

PostPosted: Sat Aug 28, 2010 8:54 am    Post subject: Reply with quote

AdmiralNemo wrote:
Check out the Initramfs article on the Gentoo Wiki. It discusses exactly what you want to do.


Did you read my last post?

I allready read that article. The problem is that in the busybox 'blkid' doesn't show my root device and therefore 'findfs' can't find the right device for the givcen UUID/LABEL.
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 8045
Location: ~Brussels - Belgique

PostPosted: Sat Aug 28, 2010 9:52 am    Post subject: Reply with quote

Hello,

Did you tried genkernel ? It has an option to use UUIDs to determine root.

And no, genkernel is not only done for dummies ;)
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
skellr
l33t
l33t


Joined: 18 Jun 2005
Posts: 901
Location: The Village, Portmeirion

PostPosted: Sat Aug 28, 2010 10:56 am    Post subject: Reply with quote

If genkernel has support for btrfs that would be quick.

kingfame_147 wrote:
I'm using mdev like mentioned in the tutorial. /dev/sdb4 (which is my root device) is avaible in the busybox and I can boot normaly when using root=/dev/sdb4.
After booting the gentoo system blkid shows the UUID of the root device. Btw: The root device uses btrfs as the fs.


I can't help you with mdev. But another option is to copy the device nodes you need from /dev into your initramfs. cp -a should do it.

And a warning about using busybox. It gives little to no error messages! If you get stuck you might want to try creating your initramfs from the programs on your system like 'bash, blkid, btrfsctl, mount, etc...' They will tell you more about what is going on. Just use ldd to find the libs they need. They are 'big' but this isn't an embedded device. :)
Back to top
View user's profile Send private message
kingfame_147
Apprentice
Apprentice


Joined: 11 Oct 2008
Posts: 171

PostPosted: Sat Aug 28, 2010 11:08 am    Post subject: Reply with quote

skellr wrote:
If genkernel has support for btrfs that would be quick.

kingfame_147 wrote:
I'm using mdev like mentioned in the tutorial. /dev/sdb4 (which is my root device) is avaible in the busybox and I can boot normaly when using root=/dev/sdb4.
After booting the gentoo system blkid shows the UUID of the root device. Btw: The root device uses btrfs as the fs.


I can't help you with mdev. But another option is to copy the device nodes you need from /dev into your initramfs. cp -a should do it.

And a warning about using busybox. It gives little to no error messages! If you get stuck you might want to try creating your initramfs from the programs on your system like 'bash, blkid, btrfsctl, mount, etc...' They will tell you more about what is going on. Just use ldd to find the libs they need. They are 'big' but this isn't an embedded device. :)


That is WAY to mutch work. I only need the initrd for mount / with a UUID/LABEL :)

Copy the device nodes doesn't make sense, because then I can't use UUID/LABEL if the device node changes (booting with a usb device plugged in or something like that).
Back to top
View user's profile Send private message
skellr
l33t
l33t


Joined: 18 Jun 2005
Posts: 901
Location: The Village, Portmeirion

PostPosted: Sat Aug 28, 2010 11:31 am    Post subject: Reply with quote

kingfame_147 wrote:
Copy the device nodes doesn't make sense, because then I can't use UUID/LABEL if the device node changes (booting with a usb device plugged in or something like that).

I'd at least put /dev/btrfs-controll , or whatever it's named, in there. I wouldn't trust mdev to make it... yet.
Back to top
View user's profile Send private message
kingfame_147
Apprentice
Apprentice


Joined: 11 Oct 2008
Posts: 171

PostPosted: Sat Aug 28, 2010 11:47 am    Post subject: Reply with quote

skellr wrote:
kingfame_147 wrote:
Copy the device nodes doesn't make sense, because then I can't use UUID/LABEL if the device node changes (booting with a usb device plugged in or something like that).

I'd at least put /dev/btrfs-controll , or whatever it's named, in there. I wouldn't trust mdev to make it... yet.


That doesn't help :/ I'm wondering why there is no UUID of that btrfs filesystem if busybox is able to mount it.

I'll do a test: I'll make a btrfs pen drive and look if there is a UUID. If there is none it is definitly a btrfs related problem with the busybox.



Edit:
As I excepted: no UUID for the btrfs pendrive. Seems to be a busybox/btrfs issue. I'll try to talk to the busybox developer.
Back to top
View user's profile Send private message
kingfame_147
Apprentice
Apprentice


Joined: 11 Oct 2008
Posts: 171

PostPosted: Sat Aug 28, 2010 12:20 pm    Post subject: Reply with quote

Oook, it seems that the "bug" is solved in 1.17.1-r1. I tried it with that new version and the UUID is there :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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