You have installed Ubuntu and then realise that you need to dual-boot with windows. Unfortunately, after you install windows, in a separate partition, GRUB (Grand Unified Boot loader – the thing that tells ubuntu to load) gets erased! How do you successfully dual-boot?
Solution:
1. Boot off the Ubuntu LiveCD
2. Open a Terminal and type in the following commands, noting that the first command will put you into the GRUB "prompt", and the next 3 commands will be executed there; also note that hd0,0 implies the first hard drive and the first partition on that drive, which is where you probably installed GRUB to during installation:
$sudo grub3. Reboot (removing the LiveCD), and your boot menu should be back.
$ root (hd0,0)
$ setup (hd0)
$ exit
Putting windows into the GRUB file, so that you can dual-boot:
1. Open the GRUB file:
$sudo gedit /boot/grub/menu.lst2. Scroll to the bottom and add the following:
title Windows XPNote that you should also verify that hd0,0 is the correct location for Windows. E.g. if you had installed Windows on the 4th partition on the drive, then you should change it to (hd0,3).
root (hd0,0)
makeactive
chainloader +1
Now when you restart your computer, hold down ESC and you will enter the GRUB menu
In Step 2
ReplyDelete>find /boot/grub/stage1
Depending on the result (ex: (hd0,4))
>root (hd0,4)
>setup (hd0)
>quit
Thanks for pointing that out, but I don't want to over-complicate the guide. If this does not work for someone then they are welcome to comment on it. Again thanks for pointing it out!
ReplyDeleteYou have to type
ReplyDeletequit
to exit from grub prompt...
Before reinstalling Windows, just copy the Boot Sector in Linux and put if back afterwards.
ReplyDelete1. dd if=/dev/sda of=boot.bin bs=512 count=1
2. then install windows
3. use a Linux live CD to boot linux again
4. dd if=boot.bin of/dev/sda bs=512 count=1
5. reboot