[SOLVED] Slackware14.2 on sda, Slackware -current on sdb: LILO in mbr(sda) and sdb2. How to remove lilo from sdb2
SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Distribution: Slackware14.2-64bit on one HDD, Slackware64-current on anotherHDD, VoidLinux on Libreboot laptop
Posts: 169
Rep:
Slackware14.2 on sda, Slackware -current on sdb: LILO in mbr(sda) and sdb2. How to remove lilo from sdb2
Hello all
Massive goof-up. LILO was on sda/MBR already. when I installed current on sdb, I installed LILO on /sdb2 which is the bootable root partition, thinking that I can select which to boot from keyboard (Desktop) without going into BIOS. Fighting with this from morning, If I get current to boot properly, 14.2 gets mucked up. If 14.2 is some how made to boot, current gets mucked up. In BIOS, it shows master / slave for sda sdb, but I think it is dynamically changing
Tried to uninstall lilo from /sdb2.
Below is from slackware current on sdb
Code:
bash-5.0# lilo -v
LILO version 24.2 (released 22-November-2015)
* Copyright (C) 1992-1998 Werner Almesberger (until v20)
* Copyright (C) 1999-2007 John Coffman (until v22)
* Copyright (C) 2009-2015 Joachim Wiedorn (since v23)
This program comes with ABSOLUTELY NO WARRANTY. This is free software
distributed under the BSD License (3-clause). Details can be found in
the file COPYING, which is distributed with this software.
Reading boot sector from /dev/sdb2
Warning: /dev/sdb2 is not on the first disk
Warning: Device 0x0810: Inconsistent partition table, 2nd entry
CHS address in PT: 16:97:34 --> LBA (248064)
LBA address in PT: 16779264 --> CHS (1109:177:34)
Fatal: Either FIX-TABLE or IGNORE-TABLE must be specified
If not sure, first try IGNORE-TABLE (-P ignore)
bash-5.0# lilo -u /dev/sdb2
Warning: /dev/sdb2 is not on the first disk
Fatal: Boot sector of /dev/sdb2 does not have a boot signature
bash-5.0#
Pl. guide how to remove this LILO from /sdb2 and configure dual boot properly
When dealing with multiple OSes, you need to change the way your lilo.conf is set. There are two ways... first is to designate one version to be the one that handles the bootloader. The second is to set up both to be able to update the bootloader. The second offers a bit more flexibility, but it does add a little bit to the complexity, until you understand how it all works.
So, ultimately, all kernels that need to be able to be booted need to be accessible to at least one lilo.conf when lilo is ran. If one of the kernels is on a drive, but that drive isn't mounted, lilo can't write its info to the bootloader. If we decide to use your -current version as the primary manager (and assume it is on /dev/sda2), you'd need to make sure your partition containing 14.2's boot/ folder is mounted on the -current system. Maybe by creating a new folder under /mnt/ for 14.2
Code:
mkdir /mnt/14.2
mount /dev/sda2 /mnt/14.2/
This now means that the vmlinuz for 14.2 can be found under /mnt/14.2/boot/vmlinuz
Now you just need to update your lilo.conf to show -current's stanza for /boot/vmlinuz and then 14.2's stanza for /mnt/14.2/boot/vmlinuz.
If you want both OSes to be able to update the bootloader, you'd want to do the same thing in 14.2, but this time create a directory under /mnt/ for -current and then update your lilo.conf to point to that location for -current's stanza.
And you'll want to choose which disk you want to have as your "boot disk", and set the boot= parameter at the top of lilo.conf to show that drive (either /dev/sda or /dev/sdb -- most people don't want the bootloader installed onto a partition, but the overall drive).
If you need more info, please provide us with a breakdown of your partition schemes and what is installed where, along with your lilo.conf.
Distribution: Slackware14.2-64bit on one HDD, Slackware64-current on anotherHDD, VoidLinux on Libreboot laptop
Posts: 169
Original Poster
Rep:
Bassmadrigal, thanks for your kind explanation. Understood
Since I have installed 14.2 on sda, this being master, mbr being here on sda, also the lilo install on /sdb2 being borked, I will do this on 14.2
mkdir /mnt/current
mount /dev/sdb2 /mnt current
Individually, both install boots, in a peculiar way as below
1. In BIOS, by changing boot priority, if I make sda1 boot first, then 14.2 which is on sda, will not function. Allows login, runlevel3. startx. xfce comes up. That's it. Mouse freezes, keyboard unresponsive
2. With sda2 being made the first boot device, when the computer starts up, with F12 key, again I can select device to boot, without going into bios. Here, if I select sdb, on which current is installed, it boots up and functions fine.
The exact opposite happens, when I make sdb to boot first, in BIOS.
Strange thing is, before login, welcome message is "welcome to kernel 5.4.49" for 14.2, it should be 4.4.227
I want to uninstall LILO from sdb2. Pl. see below. What should I do?
Code:
bash-5.0# lilo -u /dev/sdb2
Warning: /dev/sdb2 is not on the first disk
Fatal: Boot sector of /dev/sdb2 does not have a boot signature
bash-5.0#
What does it mean, when it says does not have boot signature? I had selected to install lilo automatically. But, I think I ran /sbin/lilo once..also, /etc/lilo.conf is shown in blue colour in current
Below are the details of sdb2, from which I want to remove lilo
Code:
Command (m for help): i
Partition number (1,2, default 2): 2
Device: /dev/sdb2
Boot: *
Start: 16779264
End: 312581807
Sectors: 295802544
Cylinders: 18413
Size: 141.1G
Id: 83
Type: Linux
Start-C/H/S: 16/97/34
End-C/H/S: 949/79/63
Attrs: 80
Command (m for help):
sdb1 swap, sdb2 root, bootable.
sda1 swap, sda2 root, bootable, sda3 /home
Below are the details od sdb and lilo.conf on sdb(current not shown)
Code:
Disk /dev/sdb: 149.5 GiB, 160041885696 bytes, 312581808 sectors
Disk model: ST3160215SCE
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: 0xe5e5e5e5
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 16779263 16777216 8G 82 Linux swap
/dev/sdb2 * 16779264 312581807 295802544 141.1G 83 Linux
Command (m for help): q
bash-5.0# cat /etc/lilo.conf
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
lba32 # Allow booting past 1024th cylinder with a recent BIOS
boot = /dev/sdb2
# This option loads the kernel and initrd much faster:
compact
# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
bitmap = /boot/slack.bmp
# Menu colors (foreground, background, shadow, highlighted
# foreground, highlighted background, highlighted shadow):
bmp-colors = 255,0,255,0,255,0
# Location of the option table: location x, location y, number of
# columns, lines per column (max 15), "spill" (this is how many
# entries must be in the first column before the next begins to
# be used. We don't specify it here, as there's just one column.
bmp-table = 60,6,1,16
# Timer location x, timer location y, foreground color,
# background color, shadow color.
bmp-timer = 65,27,0,255
# Standard menu.
# Or, you can comment out the bitmap menu above and
# use a boot message with the standard menu:
#message = /boot/boot_message.txt
# Append any additional kernel parameters:
append=" "
prompt
timeout = 300
# Normal VGA console
vga = normal
# Ask for video mode at boot (time out to normal in 30s)
#vga = ask
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
# ramdisk = 0 # paranoia setting
# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sda2
label = Slackware14.2
read-only # Partitions should be mounted read-only for checking
# Linux bootable partition config ends
bash-5.0#
I don't see a problem. Currently I have at least six operating systems on my Main with redundant boot-ability. My Main install, Slackware 14.2, on /dev/sda7, houses the main boot device, lilo, installed to both root and MBR. All of the other Linux Distros can be chainloaded from that main lilo and some have their own lilo installed to their appropriate root system so they can all be booted at least 2 ways... 3 if you count the one from the generic boot CLI on any Slackware Install Media. I could even go further and install additional bootloaders to each MBR of all 5 drives and select from the BIOS/UEFI "Boot Order" drive selection device but that's a bit more complicated but not at all an obstruction. There really isn't any penalty against such redundancy safeguards if properly setup.
If you wish to maintain a multiboot configuration, many, including me, are willing to help out. What is the end result you desire?
Distribution: Slackware14.2-64bit on one HDD, Slackware64-current on anotherHDD, VoidLinux on Libreboot laptop
Posts: 169
Original Poster
Rep:
enorbet, agreed. Compared to you, I am a novoice...you are all gurus, I am yet a shishya
All I want is, to be able to boot either 14.2 or current, at my will and wish
Presently, 14.2 is on sda, MBR on sda, BIOS set to boot sda first, and it is functioning correctly
By pressing the key F12 on keyboard, sdb, on which current is loaded, boots up. I can log in. Startx brings up xfce. Then every thing freezes. Mouse, keyboard..
I want this set right. I have loaded LILO on to /sdb2, bootable. Instead of loading LILO on /sdb, I loaded it on /sdb2. sdb1 is swap.
I think if LILO can be removed from /sdb2 and installed on /sdb, every thing will be OK. Is my thinking correct?
Kindly guide me
1. In BIOS, by changing boot priority, if I make sda1 boot first, then 14.2 which is on sda, will not function. Allows login, runlevel3. startx. xfce comes up. That's it. Mouse freezes, keyboard unresponsive
This sounds like the kernel that is being booted doesn't match with the modules installed on the system. It might be trying to boot an old kernel. It could also be that you have mixed packages from 14.2 and -current.
Quote:
Originally Posted by san2ban
2. With sda2 being made the first boot device, when the computer starts up, with F12 key, again I can select device to boot, without going into bios. Here, if I select sdb, on which current is installed, it boots up and functions fine.
Is there a reason to select individual drives in the BIOS? If you make the right adjustments to your lilo.conf, you'd be able to select your OS via lilo's menu.
I would also recommend switching to use the actual drive rather than the partitions with your boot= option in lilo. It does seem to help things a bit.
Since I now have an idea of your partition layout, here's what I'd recommend doing on 14.2.
Code:
mkdir -p /mnt/current
mount /dev/sdb2 /mnt/current
Then make your 14.2 /etc/lilo.conf file look like below (I removed a lot of the commented lines to make it easier to read):
Code:
# Start LILO global section
boot = /dev/sda
lba32
compact
# Boot BMP Image.
bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255
# Append any additional kernel parameters:
append=" "
prompt
timeout = 300
vga = normal
# Linux bootable partition config begins
image = /boot/vmlinuz-huge
root = /dev/sda2
label = Slackware14.2
read-only
image = /mnt/current/boot/vmlinuz-generic
initrd = /mnt/current/boot/initrd.gz # Your current is probably using an initrd
root = /dev/sdb2
label = current
read-only
# Linux bootable partition config ends
Then you run lilo -t to test it and make sure the configuration works and then run lilo to save it. Then select your sda drive in your BIOS and not one of the partitions. You should then be prompted with lilo's screen asking you to select between 14.2 and -current.
On your -current machine, if you want to be able to update the bootloader without booting 14.2, you'd do something very similar, just with a few minor tweaks. You'd still keep the boot device as /dev/sda so you don't need to change things in the BIOS every time you want to boot the other version.
Code:
mkdir -p /mnt/14.2
mount /dev/sda2 /mnt/14.2
Then make your -current /etc/lilo.conf file look like below (I removed a lot of the commented lines to make it easier to read):
Code:
# Start LILO global section
boot = /dev/sda
lba32
compact
# Boot BMP Image.
bitmap = /boot/slack.bmp
bmp-colors = 255,0,255,0,255,0
bmp-table = 60,6,1,16
bmp-timer = 65,27,0,255
# Append any additional kernel parameters:
append=" "
prompt
timeout = 300
vga = normal
# Linux bootable partition config begins
image = /mnt/14.2/boot/vmlinuz-huge
root = /dev/sda2
label = Slackware14.2
read-only
image = /boot/vmlinuz-generic
initrd = /boot/initrd.gz # Your current is probably using an initrd
root = /dev/sdb2
label = current
read-only
# Linux bootable partition config ends
Again, run lilo -t to test it and make sure everything is available and then run lilo to write it.
If you want to be able to make changes whenever, you may want to include the other Slackware partition in your fstab so it mounts automatically to /mnt/{current,14.2} when booting.
Quote:
Originally Posted by san2ban
The exact opposite happens, when I make sdb to boot first, in BIOS.
Strange thing is, before login, welcome message is "welcome to kernel 5.4.49" for 14.2, it should be 4.4.227
This happened because in -current you had image = /boot/vmlinuz, which is the kernel image for -current, not 14.2 (which would be located under /mnt/14.2/boot/vmlinuz if you follow my suggestions above) and root=/dev/sda2, which is the install for 14.2. So you're using -current's kernel in 14.2, and then 14.2 won't contain any of the modules needed for the kernel you're running. You'd need to mount 14.2's drive and reference the location to 14.2's kernel like I did above (/mnt/14.2/boot/vmlinuz).
Hope this cleared things up a bit. If not, feel free to ask questions.
Distribution: Slackware14.2-64bit on one HDD, Slackware64-current on anotherHDD, VoidLinux on Libreboot laptop
Posts: 169
Original Poster
Rep:
Bassmadrigal
Thanks for the elaborate explanation
I followed your suggestion and mounted sdb2, on which current is installed.
sda has 14.2. On this, when I ran os-prober, it failed to recognize the Linux installation in sdb
It only commented that Kernel 4.4.227 was found and added
Pl. see my earlier post, with respect to 'boot signature not found on boot signature of /dev/sdb2'. It also said something about partition table being inconsistent...pl. refer the codes pasted above
My query is, is this the whole issue? 14.2 is OK.
Should I format /dev/sdb and re-install slackware current?
My wish is only to boot either 14.2 or current, at my will. I do not have any preferred method, it should work, that's all
There are at least two ways to boot secondary systems with lilo - directly or by a chainload "handoff". A direct boot requires a copy of the kernel, the System.map and the config for that kernel be in the initial boot directory. That should include any initrd as well as a 4th required file. Obviously this means all four of those files need unique and specific names... vmlinuz isn't good enough. It needs some arbitrary but consistent name like "vmlinuz-4.4.14" for 14.2 and "vmlinuz-5.4.49". If one uses the same kernel version for both it is still best to keep them separate like "vmlinuz-5.4.49-142" and "5.4.49-Crnt" as an example.
When lilo first loads the kernel has yet to load and it's really easy to forget and overlook that. So until a kernel is named and loaded lilo has only minimal understanding of devices and file systems. This is why it is best and often essential to be so specific and unique.
A better way of booting a secondary system is the chainload but it assumes your bios is such that lilo can "see" all the drives and partitions properly so I tend to write both direct and chainload entries until I have verified the chainload will work. This is done simply by pointing to the partition that has a validated lilo install on it and a unique label for it. By validated and using your case of Current being on /dev/sdb2 (and the boot=/dev/sdb2 line in Current's lilo.conf) all one would need is
Code:
other = /dev/sdb2
label = Current
and lilo will handoff the boot process to the files on that partition. One can set it to boot immediately or offer another set of options, like different kernels all by timeout (or options like "prompt") and multiple menu entries.
Often trying to use Boot Order BIOS keys for alternate booting is a crap shoot. Some firmware transposes whatever device you choose to boot as the new /dev/sda regardless of what controller it is connected to. Others maintain order but it can be frustrating to discover which is which. That's why it's better to keep one, commonly on the first recognized drive, as the Main Bootloader and either boot directly from it or hand off to some other root system with lilo on it.
It's late so I hope this makes any sense. I'll check back after some sleep and note any changes if it is not clear.
sda has 14.2. On this, when I ran os-prober, it failed to recognize the Linux installation in sdb
It only commented that Kernel 4.4.227 was found and added
I am not familiar with os-prober as it is part of grub, and I've never really used grub. But my guess is that you probably didn't have your -current partition mounted on your 14.2 system.
Quote:
Originally Posted by san2ban
Pl. see my earlier post, with respect to 'boot signature not found on boot signature of /dev/sdb2'. It also said something about partition table being inconsistent...pl. refer the codes pasted above
My query is, is this the whole issue? 14.2 is OK.
I think this is just because you had installed it to a partition, and not the overall drive's MBR. You should be able to safely ignore the error and shouldn't need to reformat /dev/sdb or reinstall -current.
Quote:
Originally Posted by san2ban
My wish is only to boot either 14.2 or current, at my will. I do not have any preferred method, it should work, that's all
If you follow what I have above, you should be able to boot up with 14.2 or -current from the lilo screen.
Distribution: Slackware14.2-64bit on one HDD, Slackware64-current on anotherHDD, VoidLinux on Libreboot laptop
Posts: 169
Original Poster
Rep:
Bassmadrigal
Many thanks. I have followed your suggestions to the dot. Everything works fine.
I have a query.
mine is 64bit install
When I do lilo -v, why does it say LBA32 assumed?
Bassmadrigal
When I do lilo -v, why does it say LBA32 assumed?
Logical block addressing (LBA) is a common scheme used for specifying the location of blocks of data stored on computer storage devices, generally secondary storage systems such as hard disk drives.LBA is a particularly simple linear addressing scheme;
It is how the disk is addressed
nothing to do with 32 or 64 bit kernel
HTH
john
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.