LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-22-2012, 05:52 PM   #1
tilman1
Member
 
Registered: Mar 2007
Location: Stuttgart, Germany
Distribution: gentoo
Posts: 72

Rep: Reputation: 15
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
 
Old 12-22-2012, 06:00 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.
 
Old 12-22-2012, 09:57 PM   #3
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
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.
 
Old 12-23-2012, 11:30 AM   #4
tilman1
Member
 
Registered: Mar 2007
Location: Stuttgart, Germany
Distribution: gentoo
Posts: 72

Original Poster
Rep: Reputation: 15
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
 
Old 12-23-2012, 12:01 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.
 
Old 12-23-2012, 12:35 PM   #6
tilman1
Member
 
Registered: Mar 2007
Location: Stuttgart, Germany
Distribution: gentoo
Posts: 72

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by TobiSGD View Post
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
 
Old 12-23-2012, 12:52 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.
 
Old 12-23-2012, 04:08 PM   #8
tilman1
Member
 
Registered: Mar 2007
Location: Stuttgart, Germany
Distribution: gentoo
Posts: 72

Original Poster
Rep: Reputation: 15
I am running gentoo.
 
Old 12-23-2012, 04:14 PM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
http://en.gentoo-wiki.com/wiki/Initr..._Root_Mounting
 
Old 12-24-2012, 03:11 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.
 
Old 01-02-2013, 07:06 PM   #11
tilman1
Member
 
Registered: Mar 2007
Location: Stuttgart, Germany
Distribution: gentoo
Posts: 72

Original Poster
Rep: Reputation: 15
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 maüs 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
 
Old 01-02-2013, 07:23 PM   #12
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by tilman1 View Post
Gtub probably does not process the root=UUID flag directly and maüs 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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Set order of HDD controllers kripz Linux - Hardware 1 05-05-2010 09:11 AM
Boot a USB device through floppy in order to install LINUX alderfc7 Linux - Laptop and Netbook 3 04-25-2009 05:31 PM
Controlling kernel device loading order? katayamma Linux - General 1 06-20-2006 09:57 PM
HDD Order in 'Computer' AndrewZorn Linux - General 2 04-17-2005 02:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration