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:
- New generic kernel (e.g.
/boot/vmlinuz-generic-6.x.y) - Matching initrd (e.g.
/boot/initrd-6.x.y.gz) - Fallback kernel (previous or huge)
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
- Kernel/initrd file not found: wrong path in
lilo.conf - Wrong root device: kernel boots but cannot mount root
- Missing initrd with generic kernel
- Forgot
lilo -v: file updated but bootloader not
6. Rollback strategy
- At boot select
Linux-prevorLinux-huge - Fix
/etc/lilo.conf - Rebuild initrd if needed
- Run
lilo -vagain
7. Best practices
- Always keep a fallback entry
- Use short, clear labels
- Comment old entries before removing them permanently
- After kernel updates: new initrd + update lilo immediately
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