LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-06-2016, 03:55 AM   #1
Mulligun
LQ Newbie
 
Registered: Sep 2007
Posts: 13

Rep: Reputation: 0
Question Lilo and root option


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
 
Old 01-06-2016, 05:15 PM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello,

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.

Hope that helps

Markus
 
Old 01-07-2016, 05:59 AM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by Mulligun View Post
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
 
Old 01-07-2016, 03:33 PM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
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.

Markus
 
Old 01-07-2016, 04:00 PM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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.

I guess I've been using grub for too long...

Apologies.

Last edited by jpollard; 01-07-2016 at 04:34 PM.
 
Old 01-07-2016, 04:15 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206
Quote:
Originally Posted by jpollard View Post
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
 
Old 01-07-2016, 04:53 PM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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.

But as shown, my memory is faulty...

Last edited by jpollard; 01-07-2016 at 04:56 PM.
 
Old 01-07-2016, 05:00 PM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206
Quote:
Originally Posted by jpollard View Post
But as shown, my memory is faulty...
I know the feeling!

If it weren't for my computer RAM, I would have no memory at all!

Unfortunately we can't just swap out the bad sticks in our brains!
 
Old 01-07-2016, 05:22 PM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
I think of it as a database... with a small memory leak, but the indexes are still mostly valid.. just that they link to the wrong records sometimes.

 
1 members found this post helpful.
  


Reply

Tags
lilo, linux



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
[SOLVED] lilo unable to mount root-fs , lilo.conf curious95 Linux - Software 4 11-25-2012 08:55 AM
did not find any option for root password for root user in ubuntu 9.10 linux.ab Linux - Newbie 1 03-02-2010 02:58 AM
booting w/lilo, 2.4 or 2.6 option rdx Slackware 2 12-01-2007 12:28 PM
lilo root option merchtemeagle Linux - Software 9 07-11-2007 11:57 AM
No new kernel-option in LILO after editing lilo.conf corwax Debian 3 08-26-2003 08:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:30 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
Open Source Consulting | Domain Registration