Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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'm trying to better understand how does lilo works. I've a question about
root=root-device option in lilo.conf. Documentation says that if we omit that option it "defaults to the root-device setting contained in the kernel image".
I'm wondering whats the exact vale of that setting and how is it evaluated & set when we run lilo:
1.) from "normal" HDD installed system
2.) from Live CD/DVD
you may take a look at the kernel-sources to find the answer. Your question is not really lilo-related. The Option
Code:
root=/dev/sdxx
is a kernel-parameter. When you don't define a kernel-parameter in the configuration of your bootloader (or on the commandline), the kernel uses the default parameter. This is true for any kernel-parameter.
As of the "root" parameter. In the kernel-documentation (in the kernel-sources) you find a textfile named kernel-parameters.txt which leads you to the code in init/do_mount.c in the kernel-source. There you will find a detailed explanation as a comment.
I'm trying to better understand how does lilo works. I've a question about
root=root-device option in lilo.conf. Documentation says that if we omit that option it "defaults to the root-device setting contained in the kernel image".
I'm wondering whats the exact vale of that setting and how is it evaluated & set when we run lilo:
1.) from "normal" HDD installed system
2.) from Live CD/DVD
The Lilo configuration "root=" option identifies the disk to have the MBR overwritten. It has nothing to do with the root= kernel option.
reference: http://www.tldp.org/HOWTO/text/LILO
In the early days, the loaded kernel was directed to which disk was root by setting the device parameters in the kernel (I believe the command was "rdev") which modified the actual kernel binary. This was superseded by the more flexible root= option to the kernel, and over time the rdev utility dropped. It actually can't be used with most kernels as the kernel root is actually the ramdisk created from the initrd file.
reference: http://linux.about.com/library/cmd/blcmdl8_rdev.htm
A bootable CD/DVD is created using the mkisofs/genisoimage as the output file has to have the boot block set before the CD/DVD is written (I don't believe LILO can do it). An idea of the procedure is given in the reference, but I'm not sure of everything working the same on all systems (it ought to, but I haven't done it... and you can look up the syslinux boot reference). Using grub instead looks easier (but also look for a grub2 version, I'm not sure whether it is the same procedure)
reference: https://www.centos.org/docs/5/html/5...s-make-cd.html https://www.gnu.org/software/grub/ma...D_002dROM.html
The Lilo configuration "root=" option identifies the disk to have the MBR overwritten. It has nothing to do with the root= kernel option.
reference: http://www.tldp.org/HOWTO/text/LILO
...
I don't think you're right. The option which tells lilo in which partitions MBR to install the bootloader is the "boot=" option.
I'd recommend to refer to the lilo.conf manpage and also the tldp-tutorial you refer to speaks of the boot-parameter.
Hmmm.. I think you are right, and it looks like I'm wrong. There have been changes to Lilo (and I still need to dig into the changes with v22 and later) to see what the changes were. I'm used to using the root= in both places, and getting the correct MBR set.
The Lilo configuration "root=" option identifies the disk to have the MBR overwritten. It has nothing to do with the root= kernel option.
reference: http://www.tldp.org/HOWTO/text/LILO
This may be a typo, but it is not correct. I think that you meant to say, "The Lilo configuration boot= option...", but that still would not be accurate as you limit it to the MBR.
The lilo boot= option specifies the device to which the boot sector (or, boot record) is to be written. Most commonly this is of the form /dev/sdx, in which case the MBR of the drive will be written. However, it may also be a specific partition such as /dev/sda5, in which case the MBR is not written.
I think the lilo.conf man page may be a little confusing for some people as well...
Code:
boot=<boot-device>
Sets the name of the device (e.g. hard disk or partition) that contains the boot sector and where
the new boot sector should be written to. Notice: The boot-device should be the device with the
currently mounted root partition.
The first sentence is correct and complete. But there is really no reason to say that the boot-device in the lilo.conf file should be the currently mounted root partition. That conflicts with some common chain booting scenarios, for example, and precludes managing the boot record of one instance from another - something that I commonly do on multi-boot systems.
I cannot reconcile this part of the statement with my own lilo uses and suspect it is a leftover comment from the dim past... maybe if it said "is probably" or "is usually", instead of "should be" which infers that something is wrong if it isn't.
Last edited by astrogeek; 01-07-2016 at 04:30 PM.
Reason: typos, expanded comments
The notice is definitely old... and goes back to the issue of the bios functions not being able to load disk blocks that exceeded a 1024 cylinder boundary... (part of the reason for the /boot as a separate small partition too - originally I remember it having a relatively small root, with /usr, /var, /tmp mounted after the kernel started, and the kernel was stored in the root filesystem. the /dev, /etc, /lib, /sbin, and /bin held only what was needed to maintain/restore/mount /usr and any other filesystems.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.