LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 08-26-2009, 06:10 AM   #1
galapogos
Member
 
Registered: May 2008
Posts: 227

Rep: Reputation: 30
HDD device name in Mandriva 2009


Hi,

I've discovered that when I install Mandriva 2009 on a SATA HDD, regardless of whether I choose AHCI or IDE in the system BIOS, Mandriva will detect the HDD as /dev/sda, instead of /dev/sda under AHCI and /dev/hda under IDE. This is different from RHEL5, where the HDD could be detected as /dev/sda or /dev/hda depending on system BIOS settings. May I know why and how this is achieved in Mandriva? Is it in the kernel configuration or something else? I notice that Mandriva 2009 loads the ata_piix kernel module when system BIOS is set to IDE, and ahci module when it's set to AHCI.

I ask because I have another custom kernel(2.6.22.19) that faces a problem booting up on ICH9 machines when the system BIOS settings change from AHCI to IDE. The custom kernel is compiled with rootdev as /dev/sda, so whenever system BIOS is changed to IDE, it will kernel panic as it can't find /dev/sda(HDD is instead /dev/hda).

This is despite the fact that I've built in both ahci and ata_piix directly into the kernel(not as modules). However, it seems to boot up fine on another ICH7 machine. AFAIK ata_piix supports ICH5-8, so I suspect this is why it works on the ICH7 machine and not the ICH9 machine. However, I'm wondering why Mandriva's ata_piix loads correctly in ICH9. Anyway, I'm guessing if I could make the system/kernel detect the HDD as /dev/sda regardless of BIOS settings, that would solve the problem I think, so I'm trying to find a way to make my kernel load ata_piix correctly.

Does anyone know how?

Thanks.

Last edited by galapogos; 08-26-2009 at 06:27 AM.
 
Old 08-29-2009, 01:54 AM   #2
ongte
Member
 
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mageia, CentOS, Ubuntu
Posts: 468

Rep: Reputation: 72
For at least the last 2 years the kernel has stopped using /dev/hd* for any IDE devices. All IDE devices are now supported directly by libata that detects all IDE/SATA/SAS/SCSI storage as /dev/sd*.

Can't remember which kernel version onward specifically. But I do remember it's been that way since Mandriva 2008.0.

Anyhow, you an avoid this problem by using a Label or UUID to specify the partition instead of using the device name. (This is the way most modern distros do it)
 
Old 08-29-2009, 02:45 AM   #3
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
Hi ongte,

Thanks for the reply. Yup, I believe it started from 2.6.20 onwards as far as I can tell. However, RHEL5 is using a pretty old kernel(2.6.18-92.el5), so it still resolves it as /dev/hda. After some research I figured out that it's the old kernel's inability to support ICH9 under IDE mode. The kernel option "ide0=noprobe ide1=noprobe" seems to solve it on a fresh RHEL5 installation, but on some machines that have pre-existing RHEL5 installations with custom GRUB configurations, I am experiencing a kernel panic once I include the kernel option.

How would I use a label/UUID in either grub or lilo? I've no experience doing so. Would it matter what the rootdev of the kernel file is set to or would the root= option of the grub/lilo configuation override it?

Thanks again.
 
Old 08-29-2009, 11:28 AM   #4
ongte
Member
 
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mageia, CentOS, Ubuntu
Posts: 468

Rep: Reputation: 72
Hi galapogos,

For the rootdev, you don't actually have to specify anything in the kernel at all.
The root= kernel parameter should be used to specify the root device in /boot/grub/menu.lst

You can use this parameter to specify a label like this:
root=LABEL=/

Or a UUID like this:
root=UUID=ee753fb2-1786-11ddxxxxx-xxxxxx-xxxx

You can check & set the label of your ext3 root partition with:
# e2label /dev/sda2
(Assuming your root is at /dev/sda2 of course)

If I remember correctly. RHEL5 should already use labels. Check in your /etc/fstab to see if the partitions are referred to by LABEL or device file.
If you change a label, make sure you update your fstab file accordingly.

If you wanna use UUID instead. You can use the command below to find the UUID:
# dumpe2fs /dev/sda2 | grep UUID

Cheers.
 
Old 08-29-2009, 01:19 PM   #5
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
Thanks. This question is for a different problem I have. What about LILO though? I assume it's the same procedure?

i.e. I set the label of the ext2 partition with e2label, then specify the root= option in lilo.conf, run lilo, and reboot?
 
Old 08-29-2009, 10:07 PM   #6
ongte
Member
 
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mageia, CentOS, Ubuntu
Posts: 468

Rep: Reputation: 72
Yup. Same procedure for LILO.
 
Old 09-02-2009, 11:48 PM   #7
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
Sorry, I'm still quite confused as to how to do this.

Let's say I've labelled my drive using e2label as "mydrive"

What do I put in lilo.conf under the "root=" option? When I tried replacing my current "root=/dev/sda1" in my per-label option with "root=LABEL=/" and ran lilo, it complained of a syntax error.

And is there anything else I must do?

btw my drive does not make use of fstab or mtab.

Last edited by galapogos; 09-02-2009 at 11:57 PM.
 
Old 09-03-2009, 06:56 AM   #8
ongte
Member
 
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mageia, CentOS, Ubuntu
Posts: 468

Rep: Reputation: 72
Leave the 'root=/dev/sda1' line alone. Add this line under it.
Code:
append="root=LABEL=mydrive"
 
Old 09-06-2009, 11:28 PM   #9
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
I've just tried that, and I'm still getting a kernel panic.

Here's the few lines of output before it panics

Code:
VFS: Cannot open root device "LABEL=mydrive" or unknown block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
0800 sda driver: sd
0801 sda1
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block (0,0)
My append line in lilo.conf is as follows
Code:
append = "init=/bin/sh root=LABEL=mydrive"
 
Old 09-07-2009, 06:02 AM   #10
ongte
Member
 
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mageia, CentOS, Ubuntu
Posts: 468

Rep: Reputation: 72
Hard for me to help you here cuz I haven't used lilo in a long long time. GRUB has been the standard linux bootloader for many years now. Is there any particular reason you're sticking with lilo?

The error seems like it's not a lilo error. But rather the kernel not understanding the option.
 
Old 09-07-2009, 06:23 AM   #11
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
Mostly due to legacy. I've no experience with GRUB other than with some distros(and even then I never touch/modify it), and LILO seems to be easy to make invisible/transparent, which is what I need.
 
Old 09-07-2009, 07:27 AM   #12
ernie
Senior Member
 
Registered: Nov 2001
Location: Toledo, Ohio - USA
Distribution: Mageia 1
Posts: 1,079
Blog Entries: 4

Rep: Reputation: 70
In your append= line you include the boot command root=LABEL=mydrive:
Quote:
Originally Posted by galapogos
append = "init=/bin/sh root=LABEL=mydrive"
Have you labeled the drive partition as mydrive? With that boot command, you are directing the boot loader to look for the partition labeled mydrive.

Did you follow the direction from reply number 4 in this thread?
Quote:
Originally Posted by ongte
You can check & set the label of your ext3 root partition with:
# e2label /dev/sda2
(Assuming your root is at /dev/sda2 of course)
The synopses from the e2label man page is:

SYNOPSIS
e2label device [ new-label ]


In this synopsis, e2label is the command, device is a placeholder for the partition's device identification (e.g.:/dev/sda2), and new-label is a placeholder for the name with which the partition will be labeled.

To use this command, replace device with the hard drive partition, so if your root (/) partition is the second partition on the first hard drive, replace the device placeholder with /dev/sda2, and the new-label placeholder with mydrive.

The object here is to apply a label name to the root (/) partition that matches the label name you include in the root=LABEL= boot command. If you label the root (/) partition "/" (e2label /dev/sda2 /), include the boot command root=LABEL=/ in your append= line in /etc/lilo.conf.

HTH,

Last edited by ernie; 09-07-2009 at 07:44 AM. Reason: spelling and clarity
 
Old 09-07-2009, 07:48 AM   #13
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
Hi ernie,

Thanks. Yes I did follow the instructions. Perhaps I should clarify how I did it. The SATA drive in question is hot-plugged to a PC with Mandriva Linux 2009 installed, and recognized as /dev/sdb. So, I simply used "e2label /dev/sdb1 mydrive". This seems to work, because now everytime I plug this drive into the Mandriva box, a menu pops up on the task bar informing me that the "mydrive" partition is detected.


So, do I use root=LABEL=mydrive as ongte suggested, or root=LABEL=/ like you're suggesting?

Thanks again.
 
Old 09-08-2009, 04:53 AM   #14
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
ok so i tried labeling my drive as / and using root=LABEL=/ and it still gives me kernel panic.
 
Old 09-08-2009, 11:06 AM   #15
ernie
Senior Member
 
Registered: Nov 2001
Location: Toledo, Ohio - USA
Distribution: Mageia 1
Posts: 1,079
Blog Entries: 4

Rep: Reputation: 70
Sorry, I did not initially read the entire thread, so I missed the original question. Mandriva finds your partitions by using their UUID's, so it does not matter which bus the drive resides on (SATA or IDE). Since this capability is built into the kernel, you should be able to use UUIS's with RHEL too. I suggest you try configuring lilo to use the partition's UUID.

To get the partition's UUID, use the following command, as root:
Code:
$ dumpe2fs /dev/sda2 | grep UUID
Execution returns the following output:
Code:
dumpe2fs 1.41.4 (27-Jan-2009)
Filesystem UUID:          3d83af85-be30-xxxx-xxxx-xxxxxxxxxxxx
The UUID from this output is:
Code:
3d83af85-be30-xxxx-xxxx-xxxxxxxxxxxx
Note: I have obfuscated the UUID in this post with "x" characters. You will use the UUID returned when you run the dumpe2fs command on the RHEL system.

Once you have the UUID, you can edit /etc/lilo.conf to change your append= line, removing append="root=LABEL=mydrive", replacing it with root=UUID=ee753fb2-1786-11ddxxxxx-xxxxxx-xxxx in /etc/lilo.conf.

Notes: Replace ee753fb2-1786-11ddxxxxx-xxxxxx-xxxx with the UUID returned by dumpe2fs.

Remember to save your changes to /etc/lilo.conf, then run the lilo command as root in a terminal window, (or console screen) to update the lilo boot manager in the MBR.

I have attempted to make this information as clear and simple as possible in the hope it will be useful to others reading this thread who may not be technically knowledgeable.

HTH,
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Gcc in Mandriva 2009? anirbanghosh Mandriva 1 08-01-2009 07:51 AM
IS Mandriva 2009.1 GA bdelany Linux - Newbie 2 06-19-2009 08:39 AM
Mandriva Linux 2009.1 *Spring) released to the public today - 29, April 2009 ernie Mandriva 13 06-12-2009 06:58 PM
Mandriva 2009.2 sam-c Mandriva 2 05-04-2009 07:11 AM
Mandriva Linux 2009 Spring (2009.1) has been officially released! tux99 Mandriva 1 04-30-2009 11:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration