LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-18-2016, 11:39 PM   #1
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
lilo.conf: is "root=" recommended when using initrd?


In a lilo.conf should the options "root = " and "initrd = " be used in the same image block?

In Slackware64-14.2 the README.initrd file contains an example lilo.conf file ...
Code:
# Linux bootable partition config begins
image = /boot/vmlinuz-generic-4.4.14
  initrd = /boot/initrd.gz
  root = /dev/sda6
  label = Lnx4414
  read-only
# Linux bootable partition config ends
A more recent version of the file also shows the "root = " setting used with "initrd = " in the example.

My understanding was that "root = " wasn't necessary and actually shouldn't be used with initrd. It wasn't necessary because the root partition is included in the initrd.

It shouldn't be used together in the lilo.conf because of problems in the /boot/initrd-tree/init program with setting/passing/parsing the $ROOTDEV parameter. GazL identified the section of code involved in this post.

In the same thread from 2012 Alien Bob mentions not using "root = ".
Quote:
Originally Posted by Alien Bob View Post
Did anyone yet try to remove the "root=" line in your lilo.conf ? I have been deleting that line for years as it is not needed, even confusing, when using an initrd.
I'm getting failures when booting in Slackware64-14.2 with RAID and LUKS-encrypted root directory. It doesn't mount root file system as it's mapped as the init created "luks<base name>" instead of the name in lilo.conf or the initrd. In my case device /dev/md12 is mapped as device luksmd12. It unlocks the device then tries to mount device cryptroot which is the root name in initrd and lilo.conf.

EDIT: To Clarifiy ... I only get these failures above when including the "root = " parameter in lilo.conf. Otherwise the system boots without a problem.

What is the current best practice for using these two parameters in lilo.conf and do the current examples in documentation agree with the current best practice?

Last edited by TracyTiger; 09-19-2016 at 01:12 AM. Reason: Clarification of when failures occur.
 
Old 09-18-2016, 11:58 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Does your /boot/initrd-tree/etc/mdadm.conf file contain anything other than comments?
 
Old 09-19-2016, 12:44 AM   #3
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Original Poster
Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by Richard Cranium View Post
Does your /boot/initrd-tree/etc/mdadm.conf file contain anything other than comments?
Yes I direct the contents of the current RAID configuration there.

Code:
mdadm --detail --scan > /etc/mdadm.conf
This results in a file containing "ARRAY" lines.

I believe I'm following best practices regarding RAID with linux partition types of "da - Non-FS data" and block devices in /etc/fstab identified by UUID. My arrays containing from 2 to 5 disk partitions always assemble. I don't have any problems as long as I don't identify a root device for an image block in lilo.conf.

EDIT: I edited my original post to clarify that I'm only having boot failures when using the "root = " parameter.

EDIT-2: I finally correctly read your question. The file /boot/initrd-tree/etc/mdadm.conf also has the ARRAY lines of the system. Same data as /etc/mdadm.conf.

Last edited by TracyTiger; 09-19-2016 at 01:43 AM. Reason: Correctly read question asked of me.
 
Old 09-19-2016, 01:08 AM   #4
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,448
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Quote:
Originally Posted by TracyTiger View Post
In a lilo.conf should the options "root = " and "initrd = " be used in the same image block?

In Slackware64-14.2 the README.initrd file contains an example lilo.conf file ...
Code:
# Linux bootable partition config begins
image = /boot/vmlinuz-generic-4.4.14
  initrd = /boot/initrd.gz
  root = /dev/sda6
  label = Lnx4414
  read-only
# Linux bootable partition config ends
A more recent version of the file also shows the "root = " setting used with "initrd = " in the example.
This is the way I have always done it.
Quote:
Originally Posted by TracyTiger View Post
What is the current best practice for using these two parameters in lilo.conf and do the current examples in documentation agree with the current best practice?
There is nothing in the documentation which says that the two options should not be used together.

Using both has never caused any problems for me.
 
Old 09-19-2016, 01:32 AM   #5
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Original Poster
Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by rkelsen View Post
This is the way I have always done it.

There is nothing in the documentation which says that the two options should not be used together.

Using both has never caused any problems for me.
Have you used both in lilo.conf with RAID and/or LUKS on the root disk?
 
Old 09-19-2016, 01:52 AM   #6
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,448
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Quote:
Originally Posted by TracyTiger View Post
Have you used both in lilo.conf with RAID and/or LUKS on the root disk?
No.

The document you're questioning doesn't mention anything about either of those special circumstances.

In fact, the very first example it gives doesn't even specify a root partition... in which case it is not only recommended, but necessary to have both lines in your lilo.conf.
 
Old 09-19-2016, 01:58 AM   #7
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Original Poster
Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by rkelsen View Post
No. The document you're questioning doesn't mention anything about either of those special circumstances.
Thanks for the response. The document on the install disk README_CRYPT.TXT also shows a lilo example using both parameters when the root disk is encrypted.
 
Old 09-19-2016, 03:02 AM   #8
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,448
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
The examples in the documentation are general in nature. You will almost always need to modify them if you have a special use case.

But this is all a bit of a storm in a teacup, given that GPT partitions & UEFI are taking over the world...
 
Old 09-19-2016, 04:36 AM   #9
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Original Poster
Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
The examples in the documentation are general in nature. You will almost always need to modify them if you have a special use case.
What you call a "special use case" I see as just one of the normal features of Slackware. There are README files for RAID, LVM, and encryption encouraging their use. I want to use these features of Slackware and configure them correctly.

These "special use cases" are mostly adequately documented in my opinion. I'm just having difficulty with the lilo configuration that accompanies these Slackware features. My experience isn't matching up with the documentation as I understand it.

Perhaps I'm having problems with lilo and the documentation because I'm doing something wrong. I want to learn the correct way, so I'm asking.
 
Old 09-19-2016, 05:26 AM   #10
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
If you look at /usr/src/linux/Documentation/initrd.txt you'll notice that the linux documentation actually says one should specify root=/dev/ram0 when using an initrd. Unfortunately, the slackware initrd's init script would break if you actually pass this value. The init script could probably do with something like the following to cope should someone actually follow the official docs.
Code:
  root=/dev/ram0)
      #  Ignore '/dev/ram0' and use value embedded in the initrd file.
    ;;
  root=/dev/*)
      ROOTDEV=$(echo $ARG | cut -f2 -d=)
    ;;
Anyway, short answer. Don't pass root= from lilo.conf if you're using an initrd. At best it's unnecessary and at worst it will cause problems for the logic in the initrd's init-script (which admittedly could use a little work).

Last edited by GazL; 09-19-2016 at 05:29 AM.
 
Old 09-19-2016, 01:33 PM   #11
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by TracyTiger View Post
Yes I direct the contents of the current RAID configuration there.

Code:
mdadm --detail --scan > /etc/mdadm.conf
This results in a file containing "ARRAY" lines.

I believe I'm following best practices regarding RAID with linux partition types of "da - Non-FS data" and block devices in /etc/fstab identified by UUID. My arrays containing from 2 to 5 disk partitions always assemble. I don't have any problems as long as I don't identify a root device for an image block in lilo.conf.

EDIT: I edited my original post to clarify that I'm only having boot failures when using the "root = " parameter.

EDIT-2: I finally correctly read your question. The file /boot/initrd-tree/etc/mdadm.conf also has the ARRAY lines of the system. Same data as /etc/mdadm.conf.
Actually, your first response answered the point that I was heading toward.
If you do have an mdadm.conf file in your initrd, it had better contain the information to build your arrays. A readable mdadm.conf file in your initrd that consists entirely of comments will supress the scan to auto-create the arrays.
 
Old 09-19-2016, 04:53 PM   #12
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Original Poster
Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by Richard Cranium View Post
A readable mdadm.conf file in your initrd that consists entirely of comments will supress the scan to auto-create the arrays.
So it's better to have the file missing from the initrd-tree than to have an existing file without information?

IF the mdadm.conf file is missing, in general is it better to have the linux partition types as the deprecated "fd - Linux raid auto" or as type "da -Non-FS data"?
 
Old 09-19-2016, 08:43 PM   #13
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by TracyTiger View Post
So it's better to have the file missing from the initrd-tree than to have an existing file without information?

IF the mdadm.conf file is missing, in general is it better to have the linux partition types as the deprecated "fd - Linux raid auto" or as type "da -Non-FS data"?
In answer to your first question, yes. There's this bit from the initrd init script:

Code:
  # Initialize RAID:
  if [ -x /sbin/mdadm ]; then
    # If /etc/mdadm.conf is present, udev should DTRT on its own;
    # If not, we'll make one and go from there:
    if [ ! -r /etc/mdadm.conf ]; then
      /sbin/mdadm -E -s >/etc/mdadm.conf
      /sbin/mdadm -S -s
      /sbin/mdadm -A -s
      # This seems to make the kernel see partitions more reliably:
      fdisk -l /dev/md* 1> /dev/null 2> /dev/null
    fi
  fi
...which leads me to state that the answer to your second question is no. It is merely sufficient to have an mdadm.conf file in your initrd that is correct or to not have one at all.

EDIT: The default /etc/mdadm.conf file that is installed is exactly wrong for the way the initrd's init script is written; it contains only comments.

Last edited by Richard Cranium; 09-19-2016 at 08:46 PM.
 
Old 09-20-2016, 11:31 PM   #14
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Original Poster
Rep: Reputation: 273Reputation: 273Reputation: 273
Summary

Thanks for the responses.

Since I posted this thread I installed Slackware64-14.2 three times; plain default, with RAID1 on root partition, and with LUKS encryption on root partition. I used various lilo.conf settings with and without using "root = " and "initrd = " together.

If everything else is configured correctly, the only system startup failure was when using both lilo.conf parameters (root,initrd) with LUKS encryption. In that case (when using /dev/sda2 as root) "lukssda2" is mapped (/dev/mapper/lukssda2) instead of the name chosen, cryptroot in this case.

(Workaround to finish startup ...At this point the system drops you into a shell and the problem can be fixed by closing the lukssda mapping, mapping and opening cryptroot then exiting to continue the system startup.)

Short of modifying a program or two, it would be nice if there was a note about not using both lilo.conf parameters in the "Encrypted root filesystem" section of the README_CRYPT.TXT document.

The use of both "root = " and "initrd = " in lilo when using RAID1 on the root partition without encryption doesn't appear to cause problems. There are other ways to mess up a RAID setup impacting bootup as LQ member Richard Cranium has explained in multiple posts over the years.

Regarding my initial question: "In a lilo.conf should the options "root = " and "initrd = " be used in the same image block?" The answer is best summed up by GazL's response.

Quote:
Don't pass root= from lilo.conf if you're using an initrd. At best it's unnecessary and at worst it will cause problems for the logic in the initrd's init-script (which admittedly could use a little work).
 
Old 09-20-2016, 11:52 PM   #15
STDOUBT
Member
 
Registered: May 2010
Location: Stumptown
Distribution: Slackware64
Posts: 583

Rep: Reputation: 242Reputation: 242Reputation: 242
Not to throw a spanner in the works, but I have been using a generic kernel+initrd+LUKS for years, and have always referenced both "root=" and "initrd=" in /etc/lilo.conf as directed in README_CRYPT.txt"
Code:
image = /boot/vmlinuz-generic-smp-3.2.29-smp
  initrd = /boot/initrd.gz
  root = /dev/cryptvg/root
  label = linux
  read-only
And I haven't yet run into trouble related to doing so. But then, I don't use a RAID array.
I'm also not overly tempted to experiment by removing "root=" and rebooting...
 
  


Reply



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
Kernel panic: lilo.conf: root="UUID=..." Azevedo Slackware 22 05-21-2017 07:13 AM
How to configure "lilo.conf" to boot FreeBSD, the 3rd OS besides Windows and Linux chuanweizuo Linux - General 1 02-13-2008 08:00 PM
How to configure "lilo.conf" to boot FreeBSD, the 3rd OS besides Windows and Linux chuanweizuo Linux - General 2 02-13-2008 07:19 AM
the "default" ( as we have in grub.conf ) option of lilo.conf ??? b0nd Linux - Newbie 4 09-14-2005 05:51 AM
What is "initrd" in grub.conf? captainstorm Linux - Newbie 2 07-30-2003 04:12 AM

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

All times are GMT -5. The time now is 08:37 PM.

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