- Make sure the grub of your Ubuntu is installed in the root partition of Ubuntu (in my case it's /dev/sda3, which can be found out by "sudo fdisk -l") instead of the MBR.
If you already have the Grub installed on MBR or you have lost the MBR because of installing Windows, here is what you can do after you boot into the Ubuntu 9.10 LiveCD.
sudo mkdir /tmp/ubuntu910
sudo mount /dev/sda3 /tmp/ubuntu910
sudo mount --bind /dev /tmp/ubuntu910/dev
sudo chroot /tmp/ubuntu910
sudo grub-install /dev/sda3 - Obtain the boot loader information of your Ubuntu.
When you are still in the LiveCD session, type the following commands (here /dev/sda7 is the common partition in my computer that can be seen in both Windows and Linux):
sudo mkdir /tmp/data
sudo mount /dev/sda7 /tmp/data
sudo dd if=/dev/sda3 of=/tmp/data/linux.bin bs=512 count=1 - Add the entry of Ubuntu to the boot loader of Windows 7.
In Windows 7, first copy the file "linux.bin" from the common partition to C:\, then open a command window as "administrator", and type the following commands:
bcdedit /create /d "Ubuntu 9.10 64bit" /application BOOTSECTOR
bcdedit /set {ID} device partition=c:
bcdedit /set {ID} path \linux.bin
bcdedit /displayorder {ID} /addlast
bcdedit /timeout 6
Later if you want to change the name of the Ubuntu in the list, you can always do
bcdedit /set {ID} description "Ubuntu 10.04 64bit"
Category
- Computer and Internet (49)
- Programming (19)
- Mathematics (10)
- R (8)
- Bash (6)
- C++ (3)
- LaTeX (3)
- Syntax (2)
- 武术 (2)
- Brain Teaser (1)
- CLRS (1)
- Complexity Analysis (1)
- Iteration (1)
- Mac (1)
- Markov Chain (1)
- Probability (1)
- Recursion (1)
- Spirituality (1)
Tuesday, January 19, 2010
How to use Windows 7 to dual boot Windows 7/Ubuntu
It's relatively easy to use the grub of Ubuntu to dual boot Windows 7 and Ubuntu. How about using the boot loader of Windows 7 for dual boot?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment