The Temple of Fu

code, systems and games

Linux – Fix corrupt lilo boot loader with live cd

with one comment

Fix your lilo boot loader

Here’s how to fix your lilo MBR with a Linux live disk. This can happen after installing Windows which will overwrite your boot loader or mark a partition as non bootable.

Boot with your live disk, login and then note your partition setup and boot flags.


The below assumes that you have boot and home and root all in the same partition.
Now chroot by running the following commands.
If you are using ext4 replace ext3 below with ext4, one thing I noticed is cfdisk reports ext4 as ext3, this may be version specific.

mkdir /mnt/root
mount -t ext3 /dev/{your root partition EG: sda1} /mnt/root
mount -t proc none /mnt/root/proc
mount -o bind /dev /mnt/root/dev
chroot /mnt/root /bin/bash

Now that you are chrooted you can edit /etc/lilo.conf using your editor of choice, mine is nano.
nano /etc/lilo.conf
Now have lilo reread it’s configuration and update itself.
lilo -v

So hopefully now you can reboot and your mbr is fixed!

Links to rescue disks

Linux System Rescue cd (contains support for ext4)
Backtrack 4


Written by lordfu

January 13, 2010 at 4:19 pm

Posted in Linux, Slackware

One Response

Subscribe to comments with RSS.

  1. saved my day !

    humble mind

    February 24, 2017 at 5:20 am

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: