What is GRUB
Grub is an insect that eats my yard and is only useful for fish bait. It is also the Boot loader installed by Ubuntu.
Topics
You Install Ubuntu but Windows is not a boot option.
I have just installed Ubuntu on my primary master drive. How do i set it up so i can choose at start-up what OS to load? Is it just a matter of adding some stuff to grub?
Yes its just a matter of adding an entry to menu.lst...
- Open Applications > Accessories > terminal
- Backup
- sudo cp /boot/grub/menu.lst /boot/grub/menu.lst-b
- Edit
- gksudo gedit /boot/grub/menu.lst
- Add following below line
### END DEBIAN AUTOMAGIC KERNELS LIST
title Win XP Home
rootnoverify (hd0,0)
makeactive
chainloader +1
boot
- OR Add this if Linux is on the 1st drive and Windows is on the second
title Win XP Home
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
makeactive
chainloader +1
boot
Make XP the default opperating system
Configfile and Chainloader Entries
- You have a 2nd Linux distro you want to install. Install its boot loader pointer in the boot sector of its root partition
- Now add an entry in the 1st Linux distro /boot/grub/menu.lst - Adjust (hd#,#) to fit your installation.
- Configfile
title Linux Distro 2 on /dev/sda3
configfile (hd0,2)/boot/grub/menu.lst
- Chainload
title Linux Distro 2 on /dev/sda3
root (hd0,2)
chainloader +1
Live CD - Mount hard drive partition for edit
sudo mkdir /mnt/root
sudo mount -t ext3 /dev/hda1 /mnt/root
Master Boot Record
The MBR and Dual Booting go hand in hand. The MBR occupies the first 512 bytes of a hard drive (or any other disk drive for that matter) and has three parts:
- The boot code which is 446 bytes long. When you see install GRUB to the MBR This is the area of disk that the GRUB install writes a little bit of code to. What this code does is execute the program /boot/grub/stage2
- The partition table which is 64 bytes long
- The boot code signature of hex(55aa) which is 2 bytes long and goes at the very end
Grub Links