This blog is part 2 of my previous blog which details how to install Ubuntu as a second OS using GParted to manually create partitions. However, it is applicable in any situation that uses GRUB as a bootloader, since essentially I am just putting the Windows MBR back and running GRUB from a floppy. In addition to having Ubuntu already installed you will also need mbrfix, a very useful little Windows utility that can be placed on a floppy and used to fix the MBR.
So we start from the install of Ubuntu in addition to XP which has GRUB loaded at boot. Boot into Ubuntu (or just let it do so automatically) and follow the instructions to make a GRUB boot floppy (taken from here):
To keep from having to type sudo over and over, in the terminal type:
and enter your password. Now format the floppy:
Now mount the floppy and copy the necessary files:
mount /dev/fd0 /media/floppy (note: there is a space between fd0 and /media)
cp stage1 stage2 menu.lst /media/floppy/boot/grub
Now start GRUB in interactive mode by typing
and the command prompt should change to 'grub>' after which you type the following commands:
device (fd0) /dev/fd0
root (fd0) (note - I get an error message the first time I type this but it works fine if I repeat it)
Now you have a bootable floppy. However, this did not work for me without a couple of extra steps.
Restart and boot from the floppy. You should see a screen exactly like you were booting from the hard drive, with a list of OS's and Windows XP at the bottom. Choose the Ubuntu and if it starts then you are good to go. However, I always got an 'error 15 file not found' message. Press any key to continue and then 'c' to go to the command line. Type
one line of output should be the disk - fd(0) - and the other is the partition that your Ubuntu is on, something like (hd0,5); make a note of this for later.
Now take out the disk and poweroff with the power button and then reboot into Ubuntu. Put the floppy back in and open up a terminal and type
mount /dev/fd0 /media/floppy
This opens up the menu.lst document in the default editor as root, allowing you to make changes. Scroll down to the sections that don't start with #. You'll notice the titles are all the same as those listed on your initial screen when you use GRUB to boot. The first section is the one that you default boot from. Delete the last two lines of the first section:
and then Save. This should alter the menu.lst document on the floppy. To make sure close the terminal, go into the /media/floppy/boot/grub folder from the Places menu and open the menu.lst file by double clicking on it and making sure those two lines are missing.
Now reboot with the floppy in and Viola! it should boot into Ubuntu as if you were booting from the hard drive/ MBR-GRUB.
Finally, reboot into Windows. Run mbrfix.exe in the commandline to replace GRUB with Windows' standard boot code by opening the command window and typing:
Mbrfix /drive 0 fixmbr /yes
This will replace GRUB with the standard Windows Boot code. Now when you boot you will go straight into Windows and the only way to access your Ubuntu/ other linux distros is with the floppy. You now have a hidden Ubuntu OS, since the linux partitions are not visible to Windows without special software.