LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Hardware (http://www.linuxquestions.org/questions/forumdisplay.php?f=18)
-   -   HDD device order of linux kernel (http://www.linuxquestions.org/questions/showthread.php?t=4175442603)

tilman1 12-22-2012 05:52 PM

HDD device order of linux kernel
 
Hello

Kernel: V3.6.10
Motherboard: P8Z77-V LX
Processor: i7-3774
HDDs:
IDE-HDD connected via JMicron IDE controller. The boot partition, the root partition, grub, and the kernel are on this drive.
USB-HDD containing data

Problem:
If the USB-HDD is connected, the kernel assignes the device sda to it. The kernel fails mount the root partition which expects it on the IDE-HDD as sda. If the USB-HDD is not connected, the IDE-HDD becomes sda, and the kernel boots allright.

Question:
How can I fix of the drive assignements ?
The USB-HDD is not always connected, and the kernel should in both cases.

Thanks

Tilman

TobiSGD 12-22-2012 06:00 PM

This issue is known and has two workarounds.
1. Use the UUIDs of the partitions in your bootloader configuartion and the /etc/fstab file.
2. The same, only with labels instead of UUIDs.

You can find the UUIDs of your partitions with the blkid command.

Ser Olmy 12-22-2012 09:57 PM

A third possibility: Use a kernel where the USB host controller driver is compiled as a module, and don't include that module in the initrd.

But I'd go with the UUID/Label solution.

tilman1 12-23-2012 11:30 AM

The issue is not resolved
1) I added the UUIDs to /etc/fstab. Once the kernel has come up, it is able to mount the partitions by UUID
2) grub (legacy) seems not to be able to forward the root partition to the kernel. I changed menu.lst (config file for grub) to
root (hd0,0)
kernel /boot/bzImage.3_6_10 root=UUID=31ce....

Thanks

Tilman

TobiSGD 12-23-2012 12:01 PM

Do you use an initrd? The kernel is not able to handle UUIDs by itself, so an initrd to translate UUIDs to actual partitions is mandatory.

tilman1 12-23-2012 12:35 PM

Quote:

Originally Posted by TobiSGD (Post 4855571)
Do you use an initrd? The kernel is not able to handle UUIDs by itself, so an initrd to translate UUIDs to actual partitions is mandatory.

Well, having googled in the meanwhile, I was sort of expecting that question -- No, I do not use an initrd. It is years ago, that I created my last initramfs -- are there some images readily available that I could just download ? I guess the distribution that is to be boot up after the kernel does not really matter....

Thanks

Tilman

TobiSGD 12-23-2012 12:52 PM

The initrd has to be setup especially for your system, so you can't just download one.
Usually distros come with their own set of tools to create initrds, so we need to know which distro you use to give you a hint about that.

tilman1 12-23-2012 04:08 PM

I am running gentoo.

TobiSGD 12-23-2012 04:14 PM

http://en.gentoo-wiki.com/wiki/Initr..._Root_Mounting

syg00 12-24-2012 03:11 AM

Been a while since I built a gentoo system, but initrd is (to me) anathema in such a build.
A quick search of the wiki shows grub2 as masked - install that instead, it supports UUID natively without the need of initrd setup code.

tilman1 01-02-2013 07:06 PM

I upgraded to grub2 and tried using the parameter "root=UUID=...".
This seems not to work either even though there are many google reference that claim it should. I get a kernel message indicating the VFS could not be mounted. Supposedly the UUID is passed as kernel argument to the kernel and the kernel does not parse it properly. Gtub probably does not process the root=UUID flag directly and mas it to an sdx -- at least, this is what I understand after reading about grub2 on the web.

a) Is there a flag in the kernel config that I need to enable to make the kernel parse a parameter in the format "root=UUID=.." ?
b) grub2 seems to offer at least 2 modes for generation of its config files: (a) generation by grub-mkconfig and (b) manually writting or adapting /boot/grub2/grub.conf. Can the UUID be given as input to the generation process of the config files ? The input for the generation is in /etc/default/grub -- if the UUID can be passed as input, I would expect it to go into this file.

Thanks Tilman

TobiSGD 01-02-2013 07:23 PM

Quote:

Originally Posted by tilman1 (Post 4861675)
Gtub probably does not process the root=UUID flag directly and mas it to an sdx -- at least, this is what I understand after reading about grub2 on the web.

Of course not. How should Grub know in which order the kernel will see the devices?

Quote:

a) Is there a flag in the kernel config that I need to enable to make the kernel parse a parameter in the format "root=UUID=.." ?
No. As stated earlier already, you need an initrd, the mapping will be done by the programs in it.


All times are GMT -5. The time now is 07:44 AM.