Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel disc enumeration
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
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Fri Mar 05, 2010 1:01 pm    Post subject: Kernel disc enumeration Reply with quote

Sometimes, after performing an install and rebooting, the newly installed kernel enumerate discs differently from the livecd one. Why is that? Can I foresee the change? Normally it's not much of a problem, but recently I performed a remote install and because sdb became sda. My carefully written and double checked grub and fstab became invalid.
I had to walk a collegue through fixing it over the phone.
Back to top
View user's profile Send private message
Nacon
n00b
n00b


Joined: 01 Jan 2010
Posts: 28
Location: germany

PostPosted: Fri Mar 05, 2010 1:24 pm    Post subject: Uuid Reply with quote

You can replace your /dev/sda1 with the UUID of the disk to avoid the usage of /dev/sda or /dev/sdb.

Just get the UUID by running the "blkid" command:
Quote:

/dev/sda1: UUID="115bd492-d1z9-4c4d-b5a4-748de242d1a3" TYPE="ext4"


Your menu.lst should look similar to this:
/boot/grub/menu.lst wrote:

title Gentoo
kernel /boot/kernel root=UUID=115bd492-d1z9-4c4d-b5a4-748de242d1a3 rootfstype=ext4 ro quiet


The same for /etc/fstab, just insert your UUID instead of /dev/sda1.

The downside of this is, that you have a long string, which is not very friendly in terms of readability.
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Sun Mar 07, 2010 8:11 pm    Post subject: Reply with quote

Thanks, that's useful to know :)
Is this the "recommended" way of solving this issue?
It doesn't shed any light on why thet problem exists in the first place.
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Sun Mar 07, 2010 8:18 pm    Post subject: Reply with quote

Never used that actually.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Mar 07, 2010 8:21 pm    Post subject: Reply with quote

Nacon,

That doesn't work for me but my root is /dev/md3 which is a raid5 volume.
_________________
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
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Sun Mar 07, 2010 8:45 pm    Post subject: Reply with quote

Isn't the UUID a filesystem attribute rather than a disk identifier?

I mean, run mkfs on the same partition and you'll have a different UUID.

I use the /dev/disk/by-id/* symlinks within fstab, which offer more or less the same functionality as UUIDs, only you can't use them to specify the root block device to the kernel.
It's enough to save against "/dev/sda" and "/dev/sdb" switching, for example.
NeddySeagoon wrote:
Nacon,

That doesn't work for me but my root is /dev/md3 which is a raid5 volume.
In theory it should work, only you'd still need to tell the kernel how to assemble the raid array first (and as it's a filesystem attribute it can't be used to identify the array alements...).
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Mar 07, 2010 8:55 pm    Post subject: Reply with quote

Hopeless,

The array is autoassembled and that still happens before the kernel tries to mount root.
Code:
kernel (hd0,0)/2.6.33-gentoo root=/dev/md5 vga=0x317 video=vesafb:mtrr:3,ywrap
works
Code:
kernel (hd0,0)/2.6.33-gentoo root=UUID=ff5730d5-c28d-4276-b300-5b0b0fc60300 vga=0x317 video=vesafb:mtrr:3,ywrap
gets me a VFS panic.
_________________
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
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Sun Mar 07, 2010 9:08 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Hopeless,

The array is autoassembled and that still happens before the kernel tries to mount root.
Code:
kernel (hd0,0)/2.6.33-gentoo root=/dev/md5 vga=0x317 video=vesafb:mtrr:3,ywrap
works
Code:
kernel (hd0,0)/2.6.33-gentoo root=UUID=ff5730d5-c28d-4276-b300-5b0b0fc60300 vga=0x317 video=vesafb:mtrr:3,ywrap
gets me a VFS panic.
If you're interested in testing, you could try appending (for example) "md=d0,/dev/sdb1,/dev/sda1 raid=noautodetect" to your kernel command line, I found the raid autodetact a little flaky before so disabled it in kernel.

Another thing you could try, append rootdelay=10 to your command line, maybe the raid array just isn't assembled when the kernel scans for UUIDs?

Of course, the above would be even less convenient to actually use than what you already have...
I'm just curious, maybe the kernel doesn't automatically scan assembled raid arrays for UUIDs.
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Mar 07, 2010 9:20 pm    Post subject: Reply with quote

Hopeless,

I'll add in things on at a time, so I can test at normal boot time.
I've made some notes in grub.conf.

Can I use UUID to manually assemble the raid5?
If I have to use device names before I can use UUID, that defeats the purpose.
_________________
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
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Sun Mar 07, 2010 9:31 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Can I use UUID to manually assemble the raid5?
I don't think so, like I said above I believe the UUID is a filesystem attribute, therefore you'd only find one on the assembled array, not on the individual elements.
Of course, I could be wrong.
_________________
"You have to invite me in"
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Mar 08, 2010 8:18 pm    Post subject: Reply with quote

Hopeless,

It looks like you are right about UUIDs being filesystem attributes.

Also, rootdelay=10 with UUID and root on raid5 doesn't help. It only takes 10 seconds longer to work out that it can't mount root.
The error message listed all the partitions with their drivers, except for the raid sets which had their drivers listed as (??).

I'll try the manual assembly next.
_________________
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
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Mon Mar 08, 2010 10:32 pm    Post subject: Reply with quote

read somewhere you must set the UUID in mdadm.conf too, and use blkid /dev/md? to get UUID of the assembled array to put in mdadm.conf.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Mar 09, 2010 8:44 pm    Post subject: Reply with quote

krinn,

Thats PITA. It means I have to have an initrd as I have root on raid and mdadm.conf is on the root fs.
I kept root outside of LVM to avoid having to deal with an initrd.

I'll play with UUIDs on my netbook
_________________
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
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