MandrivaThis Forum is for the discussion of Mandriva (Mandrake) Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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)
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?
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
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.
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)
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.
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.
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 06:44 AM.
Reason: spelling and clarity
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?
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.