Labels

Android (1) bash (2) boost (2) C (34) C++ (2) cheatsheet (2) CLion (6) css (3) Debian (33) DL (17) Docker (2) Dreamweaver (2) Eclipse (3) fail2ban (4) git (5) GitHub (4) Hacking (3) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (31) javascript (3) Linux (167) Mac (19) Machine Learning (1) mySQL (48) Netbeans (4) Networking (1) Nexus (1) OpenVMS (6) Oracle (1) Pandas (3) php (16) Postgresql (8) Python (9) raid (1) RedHat (14) Samba (2) Slackware (47) SQL (14) svn (1) tar (1) ThinkPad (1) Virtualbox (3) Visual Basic (1) Visual Studio (1) Windows (2)

Tuesday, 2 July 2019

When lilo fails to boot or there's a problem with MBR



Boot with Slackware install DVD, tested with 13.37 (only one I had to hand).


At boot prompt, follow instructions to boot existing system, something like;

huge.s root = /dev/sda1

Once system boots, we need to do the following:
Set keyboard map and login as root (no password).
cfdisk shows partitions (note root partition)

mount /dev/sda1 /mnt # where sda1 is the root partition. (discovered from cfdisk)

No need to mount any other partitions unless you need to make other changes.

The following was not needed but is documented as part of the process:

mount -o bind /dev /mnt/dev
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys

chroot /mnt /bin/bash


Once in here you can edit /etc/lilo.conf
Note, in the case of SCS, location of boot bitmap needed to be changed to /boot/...

I choose to have at least 2 working kernels listed in there one at /dev/hda1 and one at /dev/sda2
this was due to the system showing current disk as sda and I knew original system showed as hda
I leave boot= flag untouched.

install lilo using lilo -b /dev/sda
and reboot, removing Slackware installation DVD


One of the kernel images should boot and then change lilo.conf back to normal and install lilo using lilo

UPDATE: 09 JULY 2021
On a 14.2 install with a failed lilo installation, I was able to follow the above but it would seem I was able to boot my system using;
huge.s root = /dev/sda1 rdinit=ro
and did not need to mount the root partition in order to make the changes, I was able to make a change to /etc/fstab.conf although in this case I didnt need to and was able to simply install lilo using lilo -b /dev/cciss/c0d0p
Additional notes, we can run fdisk -l and use that information to look in the /dev/* directory for where we should be installing lilo, in this case we have a raid setup so the usual /dev/sda wasn't going to cut it.