Slackware HowTo

Configure LILO on Slackware with a fallback kernel

Safe configuration of /etc/lilo.conf with generic kernel, initrd, and a fallback entry.

Before running lilo, keep at least one working boot entry. A mistake in lilo.conf can make the system unbootable with the new kernel.

1. Initial checks

ls -lh /boot
uname -r
ls /lib/modules

Identify:

2. Backup lilo.conf

cp /etc/lilo.conf /etc/lilo.conf.backup-$(date +%F)

3. Example configuration with two entries

One main entry (generic + initrd) and one fallback.

boot = /dev/sda
prompt
timeout = 100
default = Linux-generic

image = /boot/vmlinuz-generic-6.x.y
  initrd = /boot/initrd-6.x.y.gz
  root = /dev/sda2
  label = Linux-generic
  read-only

image = /boot/vmlinuz-huge-6.x.y
  root = /dev/sda2
  label = Linux-huge
  read-only

# previous fallback
image = /boot/vmlinuz-generic-prev
  initrd = /boot/initrd-prev.gz
  root = /dev/sda2
  label = Linux-prev
  read-only
Adjust boot= (MBR/partition), root=, kernel/initrd paths, and labels to your real values.

4. Run LILO correctly

lilo -v

Check output: the added labels should appear without errors.

If lilo -v completes successfully, the changes were written to the bootloader.

5. Common errors

6. Rollback strategy

  1. At boot select Linux-prev or Linux-huge
  2. Fix /etc/lilo.conf
  3. Rebuild initrd if needed
  4. Run lilo -v again

7. Best practices

Quick checklist

[ ] /etc/lilo.conf backed up
[ ] Generic + initrd entry added
[ ] Fallback entry present
[ ] /boot paths verified
[ ] lilo -v executed without errors
[ ] New entry boot tested

Back to the Linux HowTo section