June
2009
Install GRUB in its own partition0
GRUB is one of the best software to support multiple operating systems on the same computer.
The advantage of allocating a partition exclusively for GRUB is that otherwise, you would overwrite the boot loader every time you re-install the operating GRUB is associated with. GRUB, a boot loader, is by itself independent from any operating systems. That means you don’t need to run Linux on your machine to use GRUB. But since GRUB most often comes with Linux distributions, it would be easier to install GRUB along with the Linux system and delete Linux if you don’t need it.
The following assumes an empty target hard drive and Ubuntu 9.04 CDROM.
- Boot up with Ubuntu 9.04 CDROM. Choose to Try Ubuntu without any change to your computer
- Open a Terminal window, run sudo gparted.
- Allocate a 1 MB primary partition for GRUB. The partition size will be rounded to a cylinder boundary so it’s perfectly normal the size turns out different.
- Allocate another primary for Windows XP, and yet another (mount point: “/”) for Linux. Assume the names are /dev/sda1, /dev/sda2, /dev/sda3, respectively.
- Apply the setting and reboot the system.
- Boot up with Windows XP CDROM and install it in the space previously designated as /dev/sda2. You may need to delete the partition and create it again.
- Now that Windows XP is installed, restart the computer using the Ubuntu CDROM. Choose Install Ubuntu.
- When asked with partition to install Ubuntu, select Specify partitions manually (advanced) and install it to /dev/sda3. You may need to specify its mount point again.
- Proceed to finish installation.
- In Ubuntu, open a Terminal window. Run the following commands:
sudo mount /dev/sda1 /mnt
sudo mkdir /mnt/grub
sudo cp /boot/grub/* /mnt/grub
sudo grub - Now, in GRUB shell, submit the following commands:
root (hd0,0) (This is the device name of /dev/sda1, since the space partition may be called differently in other Linux systems. Notice there is no space between “,” and “0.”)
setup –prefix=/grub (hd0)
quit - Reboot the system.
This blog article is by no means self-contained for the understanding of GRUB and its usage. The following article is a good start point, though.
Reference:
Making a Dedicate GRUB Partition
In practice, I prefer to use gparted (loaded by Ubuntu CD) to partition my hard drive first. Then install Windows before I go through the procedure of this article. Letting the installation program create the menu.lst file for you is simpler.
Related articles:
Dual Boot Ubuntu and Windows
歷年的今天…
- 2009: Recover the MBR of Windows XP
- 2008: Good/bad friends
- 2007: 睡掉一早上