Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

LILO won't boot other OS

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
luiznetto
Posts: 67
Joined: 2013-11-26 18:40

LILO won't boot other OS

#1 Post by luiznetto »

Hi everybody.

I am using LILO to boot Debian now. Here is my /etc/lilo.conf, which, as you probably know, is the general single configuration file for LILO:

Code: Select all

# /etc/lilo.conf
# Generated by me (Luiz Netto)
# Global options
lba32
#boot = /dev/sda
boot = /dev/disk/by-id/ata-WDC_WD800BEVS-22RST0_WD-WXE108X13461
verbose = 5
map = /boot/map
install = menu
menu-scheme = Wb:Yr:Wb:Wb
prompt
timeout = 18000
vga = normal

# Kernels to boot, available on the menu:

# Debian
root = /dev/sda3
image = /boot/vmlinuz-4.19.0-5-686
initrd = /boot/initrd.img-4.19.0-5-686
label = "Debian"
read-only
So far so good. It works perfectly. But the problem is, I have another operating system installed on sda1, Tiny Core to be more precise, and I want to make it available to boot on the LILO menu. Here is the present state of my hard drive:

Code: Select all

root@debian:/home/luiz/Debian/Debian_10/LILO# /sbin/fdisk -l
Disk /dev/sda: 74.5 GiB, 80026361856 bytes, 156301488 sectors
Disk model: WDC WD800BEVS-22
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x61b46271

Device     Boot    Start       End   Sectors  Size Id Type
/dev/sda1  *        2048  32770047  32768000 15.6G 83 Linux
/dev/sda2       32770048  36866047   4096000    2G 82 Linux swap / Solaris
/dev/sda3       36866048 156301311 119435264   57G 83 Linux
So Debian is on /dev/sda3, and Tiny Core on /dev/sda1. I've tried several different ways to change /etc/lilo.conf to boot Tiny Core in addition to Debian, they all failed. I had the same difficulties using Grub (legacy) and Grub2, and besides I am finding LILO convenient and easy to configure, so I want to stick to LILO.

I can boot both operating systems using GRUB2 command line, which I have on a separate disk. Here is how I boot Debian using the GRUB2 command line:

Code: Select all

grub> set root=(hd0,3)
grub> linux /boot/vmlinuz-4.19.0-5-686 root=/dev/sda3
grub> initrd /boot/initrd.img-4.19.0-5-686
grub> boot
and here is how I boot Tiny Core using the same command line:

Code: Select all

grub> set root=(hd0,1)
grub> linux /tce/boot/vmlinuz
grub> initrd /tce/boot/core.gz
grub> boot
Both work perfectly fine. So why can't I get LILO to do the same for me?

I want to use either LILO or Grub Legacy, I don't like Grub2 because it's bloated, hard to configure, ugly, and occupies too much space on the disk. I like the simplicity of LILO.

I've been trying to solve this problem for a long time, googling around fruitlessly; many of the posts I see are too old, don't apply to my case, are too difficult for me to understand and don't work. So I seek your help. Needless to say I will be immensely grateful to anyone who offers any valuable advice.

Thanks in advance.

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: LILO won't boot other OS

#2 Post by L_V »

Try this block to see:

Code: Select all

# Kernels to boot, available on the menu:

# Debian
root = /dev/sda3
image = /boot/vmlinuz-4.19.0-5-686
initrd = /boot/initrd.img-4.19.0-5-686
label = "Debian"
read-only

# TinyCore
root = /dev/sda1
image =  /tce/boot/vmlinuz
initrd =  /tce/boot/core.gz
label = "TinyCore"
read-only

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: LILO won't boot other OS

#3 Post by p.H »

luiznetto wrote:# Debian
root = /dev/sda3
Not good. The root specification should use a persistent scheme such as UUID= or LABEL=. /dev/sd* is not.
luiznetto wrote:I've tried several different ways to change /etc/lilo.conf to boot Tiny Core in addition to Debian, they all failed.
What have you tried ? How did it fail ?
L_V wrote:image = /tce/boot/vmlinuz
initrd = /tce/boot/core.gz
I don't think this would work. According to the GRUB 2 commands which work, the kernel image and initrd are in the /tce/boot directory relatively to /dev/sda1 root directory, although this is weird.
IIUC, /dev/sda1 should be mounted somewhere before running lilo and the path in lilo.conf should be /somewhere/tce/boot/.

luiznetto
Posts: 67
Joined: 2013-11-26 18:40

Re: LILO won't boot other OS

#4 Post by luiznetto »

pH wrote
What have you tried ? How did it fail ?
I've tried editing /etc/lilo.conf in the way suggested by L_V, and when I update the MBR by running /sbin/lilo I get an error message:

Code: Select all

Error: Fatal: file 'vmlinuz' not found
even though I know the file is there!
Another thing that I tried was to create symbolic links in my /boot folder (in Debian) to /dev/sda1/tce/boot/vmlinuz and /dev/sda1/tce/boot/core.gz and alter the entry for Tiny Core in /etc/lilo.conf accordingly:

Code: Select all

# Tiny Core
root = /dev/sda3
image = /boot/vmlinuz
initrd = /boot/core.gz
label = "Tiny Core Plus"
read-only
but when I do this and run /sbin/lilo, I get the error message:

Code: Select all

Error: Fatal: Too many levels of symbolic links
But according to the suggestion in this post:
https://www.linuxquestions.org/question ... lo-294025/
I should create a directory "tinycore" under /mnt and then edit /etc/fstab and put an entry in it for the Tiny Core partition with /dev/sda1 and /mnt/tinycore (I don't know exactly how to do this), and then edit /etc/lilo.conf accordingly. I don't know if it will work.

Maybe I should try Grub Legacy instead of Lilo, maybe just editing menu.lst in Grub Legacy will work without having to edit /etc/fstab. What do you think?

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: LILO won't boot other OS

#5 Post by L_V »

luiznetto wrote:/dev/sda1/tce/boot/vmlinuz?
No no no.
/dev/sda1 is partition 1 of device sda.
If the bootloader understands the format of this partition (linux / it should), the default mount point is "/".
To see:

Code: Select all

lsblk -f
1- make it simple:

Code: Select all

boot = /dev/sda
# boot = /dev/disk/by-id/ata-WDC_WD800BEVS-22RST0_WD-WXE108X13461
because I am not sure at all "/dev/disk/by-id/" can be understood by lilo.

+ investigate first with sda3 only , and check again : there is no quote for label.

Code: Select all

# Kernels to boot, available on the menu:

# Debian
image = /boot/vmlinuz-4.19.0-5-686
initrd = /boot/initrd.img-4.19.0-5-686
label = debian
root = /dev/sda3
read-only

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: LILO won't boot other OS

#6 Post by p.H »

luiznetto wrote:I've tried editing /etc/lilo.conf in the way suggested by L_V, and when I update the MBR by running /sbin/lilo I get an error message
As expected.
luiznetto wrote:even though I know the file is there!
No, the file is not there. According to the commands which work with GRUB 2, the files are in the /tce/boot directory in partition /dev/sda1 (hd0,1). But you are running Debian so the current / directory is in partition /dev/sda3.

Maybe you are confused because the root option in lilo.conf and the root variable in GRUB have unrelated meanings.
In lilo.conf, it contains the root parameter that is to be passed to the kernel command line. So

Code: Select all

root = /dev/sda1
kernel = /boot/vmlinuz
will give the following kernel command line :

Code: Select all

/boot/vmlinuz root=/dev/sda1
In GRUB, it contains the default device used with relative paths which do not contain a device specification. So

Code: Select all

set root=(hd0,1)
linux /boot/vmlinuz root=/dev/whatever
is the same as

Code: Select all

linux (hd0,1)/boot/vmlinuz root=/dev/whatever
luiznetto wrote:symbolic links in my /boot folder (in Debian) to /dev/sda1/tce/boot/vmlinuz and /dev/sda1/tce/boot/core.gz
No, no. /dev/sda1 is a device file, not a directory. If you want to access a filesystem inside a partition, you must mount it on a directory (mount point) and the contents will be visible in this directory, not in the device file.
luiznetto wrote:I should create a directory "tinycore" under /mnt and then edit /etc/fstab
/mnt is for temporary mounts and should not have permanent mounts defined in /etc/fstab. The mount point for /dev/sda1 should be elsewhere.
luiznetto wrote:Maybe I should try Grub Legacy instead of Lilo, maybe just editing menu.lst in Grub Legacy will work without having to edit /etc/fstab. What do you think?
I think you should use GRUB 2. GRUB Legacy is obsolete and deprecated.

User avatar
oswaldkelso
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1493
Joined: 2005-07-26 23:20
Location: UK
Has thanked: 1 time
Been thanked: 59 times

Re: LILO won't boot other OS

#7 Post by oswaldkelso »

Free Software Matters
Ash init durbatulûk, ash init gimbatul,
Ash init thrakatulûk agh burzum-ishi krimpatul.
My oldest used PC: 1999 imac 333Mhz 256MB PPC abandoned by Debian

luiznetto
Posts: 67
Joined: 2013-11-26 18:40

Re: LILO won't boot other OS

#8 Post by luiznetto »

I am using Grub2 now. It's not so bad after all. Not so simple as Lilo or Grub Legacy but I can deal with it. Thanks for your help anyway. :D

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: LILO won't boot other OS

#9 Post by p.H »

I admit that GRUB 2 is complex and heavy, but it is very convenient when you are used to it.

Post Reply