SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
With the continued growth of SATA devices, I have really been having problems with my boot loader. In the old days, it was pretty easy to make sure that the IDE devices stayed put. However, now everything is an sd device. Specifying a root directory of /dev/sda1 in lilo is no longer a sure thing. If you have a USB device plugged in or an ESATA device, your sd devices are no longer guaranteed to stay put.
In reading through the lilo documentation, it appears that you can specify root devices by UUID or even by LABEL.
However, at the present time this is not working for me and I get a kernel panic that it can not find my root device when trying either of these methods.
I stumbled across something that said that this was not possible in Slackware? Is this true?
Also, does grub support this type of thing. I really don't want to use grub if I can avoid it. I am very old school and having been using lilo since Slackware first came out. But it is imperative that I find a solution.
How about a udev rule? I am just not sure when these get loaded and if it would be available to the boot loader.
I have looked everywhere and I can't seem to get a definitive answer on this. I am shocked that this is not more of an issue to more people.
Any input, advice or work arounds would be greatly appreciated.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Thanks for the answers. Definitely gave me some things to try. Mostly this has to do with SATA add-on cards. I think with a kernel recompile I could probably force it to load the drivers for the main board first followed by the add-on cards and probably get around this.
That being said, it is a bit of pain to fix this problem in this manner.
Astrogeek, I have tried to use the append command without any luck. Perhaps someone can see where I have made a mistake.
As you can see, the labels have taken and are posted. Here is 4 different boot entries that I have in lilo.conf:
image = /boot/vmlinuz
root = /dev/sda1
label = Original
read-only # Partitions should be mounted read-only for checking
image = /boot/vmlinuz
image = /boot/vmlinuz
append = "root=UUID=df76cd54-093b-4d0e-8d37-b789a1259250"
image = /boot/vmlinuz
append = "root=UUID=df76cd54093b4d0e8d37b789a1259250"
Only the first one works. All others give me a kernel panic with something similar to:
VFS: Cannot open root device "UUID=..." or unknown-block(0,0)
Has anyone gotten this to work with lilo on slackware actually? I read a blurb somewhere that for whatever reason this won't work on slackware. Is it worth it to try grub? Or am I better off to just retool the kernel to try to get sATA drives to load in the proper order?
Thanks again for your help. Your suggestions so far were very helpful.
Do your cards all use different drivers? If so, then just change the module order in /boot/initrd-tree/load_kernel_modules and re-create your initrd.gz file. (I think you can do the same thing via the order that you give modules in mkinitrd's -m option.)
In grub, you can swap drives around. For instance, my Windows drive (hey, ya gotta be able to play games) is not the first drive on my machine. My grub config file has...
...which swaps the first and fifth drive on my machine for the boot environment. The thing that threw me for a long time was that grub still referred to the original order for all of its commands; that's why the rootnoverify uses (hd4,0) instead of (hd0,0).
I know that Pat and the gang don't care for grub, but I've found it flexible and fairly easy to use.
Huge thanks to everyone that responded. I am extremely impressed with the knowledge of the responses as well as the quickness. I have this set up now and running exactly as I intended.
I thought I would provide a quick summary of what I ended up doing to get this working. As I mentioned previously, I am a bit old school. I have been using Slackware almost since it first came out. I have never used, nor needed to use initrd before. I always compile a custom kernel with the drivers I need in the kernel. So just a quick howto for those that may come across this in the future.
Assigning root device by name in lilo with Slackware
Using a device label or name to specify your root (and other) drives is much easier and more dynamic than using the assigned sd device. In the old days with hd devices it was very easy to control how the device numbers were assigned. However, with sd devices becoming more popular with add on cards for both SATA and ESATA devices, it is much more difficult to control how these device numbers are assigned when you add a card or a drive. By using disk labels, this is no longer an issue. Here are some simple steps to make this work. Replace the /dev/sd? and names to suit your needs.
While I don't know the exact how's and why's, it is necessary to use initrd in order to specify your root device by name. initrd is simply a small filesystem loaded into RAM. This is actually pretty simple to do. Under /boot, there is a utility called mkinitrd. Basically you need to run this, with everything needed to get your root drive up. In my case, I needed a file system (ext4) and a SATA driver (sata_sis). The following is what I used:
mkinitrd -c -k 126.96.36.199 -m ext4 -m sata_sis
The -c tells mkinitrd to clear all previous modules out. The -k tells it what kernel version to use. The -m loads a module/driver. For more information on all of this there is a readme under /boot called README.initrd. Also there is a man page for mkinitrd
Name your volume
You need to name your volume. It is possible to do this with UUID's as well, but using names is a lot easier. Using a utility called e2label that you can use on ext formatted disks
e2label /dev/sda1 root
Pretty straight forward, /dev/sda1 is the device, root is the name it will be assigned.
Modify lilo.conf and load
Edit the file under /etc/lilo.conf to add a new boot entry. I always add a new entry when I am testing, so that if things go really wrong, I can fallback on the original boot loader that was known to be working. This is highly recommended whether you are trying a new kernel or anything. These are the two entries I have. Linux is the tester and Fallback is the original setup at install.
Note that the image is different. This isn't necessary, but probably something that you want to do, even if vml_pref just links to the generic kernel.
Make sure you run lilo to load the boot loader. (I forget this step every once in a while...)
Similar to the boot loader, you will also need to update the fstab so that the drives are remounted properly as well. Simply replace the device designation (/dev/sda1) with LABEL=root (or whatever name you are using. Here is a sample of my fstab. Notice that I have named all my drives to make them device designation independent.
That is it! Now the boot loader will always mount the volume named "root" as the root device.
Here is a print of my current blkid as well. As you can see, once I added external SATAs and some other drives after installing slackware, my root device is actually assigned sdd1. I could care less now though.
Also, one last thing, you can only label ext devices using e2label. There may be a way to label other devices, but I don't know of any, except the swap device. To label a swap device, you will need to turn it off first and then remake it and name it.