Booting Linux from NTloader (Windows bootloader)
Posted by stringofthoughts on April 27, 2009
Hmm …. The first thing comes to mind when you see a topic like this one is why? why would anyone wanna do that ? Grub is way to awesome than NTloader and also NTloader is not designed to load anything but windows. Well lets just say for the sake of learning and a tip for very highly unlikely situation where you ‘ve a dual boot system and GRUB is not able to boot windows. In such a situation you can modify NTloader and boot Linux from windows boot loader and yes it’s true. I didn’t believe it myself at first, that’s why it’s so much fun learning new stuffs.
so here is what you ‘ll do. Assuming you ‘ve windows on /dev/sda1 and Linux on /dev/sda5. Linux and windows could be on separate disks.
$ sudo mount /dev/sda1 /mnt
$ sudo dd if=/dev/sda5 of=/mnt/ubuntu.bin bs=512 count=1
the dd command is a low-level copying tool. It copies a file and covert and format the data according to the options like bs and count in the above command. The command copies first 512 bytes to a file named ubuntu.bin .
Next you need to modify boot.ini . Assuming user has XP installed on his system.
$ sudo nano /mnt/boot.ini
and at the end of the file but in the new line (don’t leave a blank line in between) add this
Save the file. Now you need to change the HDD priority and make the first boot device the disk which has XP installed in it. This time instead of booting directly inti windows it should show a menu with ubuntu as an option. Try booting ubuntu. If everything is fine change /boot/grub/menu.lst. There is a line #hiddenmenu change it to hiddenmenu (Just remove #).
That should do it.🙂