Re-installing Lilo boot loader onto MBR

I decided to try and get my Samsung SII up and running again. To do this required using Kies which is a Windows only afair so I booted into Windows for the first time in weeks, if not in the last 2-3 months.

The good news is that the recovery went through fine the first attempt. This is in comparison to previous times when it would consistently fail at various stages of the recovery process.

The bad news is that it had become obvious I needed to re-install Windows 7 since the existing install was getting a little sick. I guess moving the install to a new motherboard at the beginning of the year didn’t help though I have to admit, Windows 7 handled the affair better than any of the other times I have tried it with older versions of Windows which didn’t handle it at all and fell into a screaming heap.

Windows 7 install complete, I needed to re-install the boot loader. The long and the short of how to do this is:

  • Boot up the Slackware install CD (Slackware64-14.0 in my case).
  • Run ‘fdisk -l’ to determine the partition details are for your linux partition (were /etc is so your / partition).
  • Create a mount point, or not, ‘mkdir /tmp/linux’.
  • Mount your partition, ‘mount /dev/sda4 /tmp/linux’
  • chroot the new partition, ‘chroot /tmp/linux’
  • And finally, recreate your MBR for the boot loader to work, ‘lilo -C /etc/lilo.conf

This will make all your previous Lilo boot options available once you reboot your server.