I tried installing Linare and yup!!! it removed my MBR and during install something went bad and I could not get into either Mandrake 10.1 or Windows XP. I purchased a partition recovery program and recovered my data partition. Then re installed Windows along with all (that is a lot) of the programs that were previously on my system. I just stumbled upon instructions that layout how to get out of such a mess and recover the LILO boot menu. Below are the intstructions compliments of Ladislav Bodnar
:
Get back your boot loader - a mini HOWTO
This is an all too common scenario after installing a new Linux distribution, as expressed by a reader in last week's forums:
"Please be advised that Linare Linux automatically installs the boot loader into the Master Boot Record (MBR). Most other distros (MEPIS, SUSE, Libranet, Vector to name a few I've tried) give you a choice of MBR or root partition, but not Linare. It screwed me up real bad because I run V-Com's System Commander for OS selection, and I had to reinstall all my OSs over again from scratch. Really irritating!"
I don't know much about System Commander, but surely, reading up on the LILO or GRUB documentation should take a lot less time than reinstalling several operatins systems!
Since this situation happens frequently when you install new distributions, what follows is a step-by-step mini HOWTO to solve the problem and to restore your Master Boot Record to what it was before that give-no-choice distribution lovingly took it over. I have used LILO for years and it serves me perfectly well, but nowadays many distributions (and users) seem to prefer GRUB. Whatever your choice, both are perfectly capable of restoring your MBR.
This is the scenario: you have a Windows installation on /dev/hda1, a data partition on /dev/hda2, then your primary Linux distribution on /dev/hda5 (with your main LILO or GRUB boot loader installed in the Master Boot Record). Then you decide to install Linare and it will go to /dev/hda6. Linare has overwritten your Master Boot Record giving no choice of booting your other two operating systems. If you use LILO, follow these steps:
1. Boot into Linare and log in as 'root'.
2. Fire up a terminal, such as "Konsole".
3. Create a temporary directory, for example "mkdir /mnt/tmp". It doesn't matter where you create it - even somewhere within your home directory is fine.
4. Mount your primary Linux partition like this: "mount /dev/hda5 /mnt/tmp".
5. Chroot (change root) into your newly mounted partition with this command: "chroot /mnt/tmp".
6. Type "lilo". This will restore your Master Boot Record to its original condition.
7. Of course, you probably want to add your newly installed Linare to the boot loader, in which case you need to open /etc/lilo.conf in your favourite text editor and add the following two lines to the end of the file:
other=/dev/hda6
label=Linare
8. Save the changes and execute "lilo" on the command line. Press Ctrl+D to get out of the chroot-ed partition. Now, next time you boot, you will be able to choose between three operating systems.
For those who prefer the GRUB boot loader, things are slightly different:
1. Boot into Linare and log in as 'root'.
2. Fire up a terminal, such as "Konsole".
3. Create a temporary directory, for example "mkdir /mnt/tmp". It doesn't matter where you create it - even somewhere within your home directory is fine.
4. Mount your primary Linux partition like this: "mount /dev/hda5 /mnt/tmp".
5. Chroot (change root) into your newly mounted partition with this command: "chroot /mnt/tmp".
6. Type "grub". You will enter GRUB's interactive mode to perform further actions.
7. Type "root (hd0,4)".
8. Type "setup (hd0)". This should restore your Master Boot Record to its original condition.
9. Type "quit".
10. To add Linare to the boot menu, you will need to modify /boot/grub/menu.lst by adding a few lines to it - your best action is to copy them from Linare's own /boot/grub/menu.lst and paste them into your main Linux distribution's menu.lst.
11. Save the changes, then press Ctrl+D to get out from the chroot-ed partition. That's it, next time you boot, you will see your usual GRUB menu inclusive of the newly added Linare option.
In case you are unable to perform the above steps from your newly installed distribution, you will need to boot from a good live CD, such as Knoppix. The steps are exactly the same as above. If you get stuck, there are plenty of tutorials on both LILO and GRUB on the Internet - one of the best GRUB tutorials I've seen is Getting to know GRUB by Gentoo's Daniel Robins.
That's all for this week. Happy "Linuxing" and "BSDing" and see you again next Monday!
Ladislav Bodnar
