One of the most frightening things about Linux is the horrible word bootloader. The primary reason for this is the fact that most new Linux users have only ever used Windows operating systems. In the Windows world, they have never bothered with bootloaders.
For them, the issue of a system booting was a transparent one. At most, they would use Windows Recovery Console to fix problems for them. Thus, they have been spared the need to learn about the single most important piece of software on a computer - the little program that makes it all work.
Next open your GRUB configuration file in a text editor:
You will be prompted for your Root (administrator) password.
The file menu.lst will open in gedit (a text editor). This is what it will look like:
Now, find the line that says:
default 0
Change the number from 0 to the number that corresponds with your Windows configuration entry. To determine the correct number, count the entries, starting from 0 (zero).
For example:
This is number 0:
title Ubuntu, kernel 2.6.17-10-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/hdb1 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot
This is number 1:
title Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/hdb1 ro single
initrd /boot/initrd.img-2.6.17-10-generic
boot
This is number 2:
title Ubuntu, memtest86+
root (hd1,0)
kernel /boot/memtest86+.bin
quiet
boot
This is number 3:
title Other operating systems:
root
This is number 4:
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1
In this case, Windows is the fourth OS entry in the file. (note that the following line is counted as well):
title Other operating systems:
So, we’ll change the “default” number to 4.
You can also change the timeout (number of seconds before the default Operating System automatically boots):
Timeout 10
The value is in seconds. Change it to whatever value you prefer. Here I’m changing it to 5.
Here’s the finished, edited file.
Click Save. Close gedit. You may also close the terminal. Now restart your computer and Windows should be first in line and automatically boot in 5 seconds. Remember that if you have other operating systems installed you will have to count the entries and adjust the number accordingly.
Reboot your computer. Once the boot menu comes up, select the Recovery Mode option. In Ubuntu, you will see lots of text scrolling down the screen, and once the operating system has booted, a menu will come up. Choose the Drop to Root Shell Prompt option. You’ll see something like this:
root@desk$
Now type:
For them, the issue of a system booting was a transparent one. At most, they would use Windows Recovery Console to fix problems for them. Thus, they have been spared the need to learn about the single most important piece of software on a computer - the little program that makes it all work.
Configuring GRUB Bootloader:
Open the terminal. The first step is to make a backup of GRUB settings before modifying anything. Write in terminal: sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
Next open your GRUB configuration file in a text editor:
sudo gedit /boot/grub/menu.lst
You will be prompted for your Root (administrator) password.
The file menu.lst will open in gedit (a text editor). This is what it will look like:
Now, find the line that says:
default 0
Change the number from 0 to the number that corresponds with your Windows configuration entry. To determine the correct number, count the entries, starting from 0 (zero).
For example:
This is number 0:
title Ubuntu, kernel 2.6.17-10-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/hdb1 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot
This is number 1:
title Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/hdb1 ro single
initrd /boot/initrd.img-2.6.17-10-generic
boot
This is number 2:
title Ubuntu, memtest86+
root (hd1,0)
kernel /boot/memtest86+.bin
quiet
boot
This is number 3:
title Other operating systems:
root
This is number 4:
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1
In this case, Windows is the fourth OS entry in the file. (note that the following line is counted as well):
title Other operating systems:
So, we’ll change the “default” number to 4.
You can also change the timeout (number of seconds before the default Operating System automatically boots):
Timeout 10
The value is in seconds. Change it to whatever value you prefer. Here I’m changing it to 5.
Here’s the finished, edited file.
Click Save. Close gedit. You may also close the terminal. Now restart your computer and Windows should be first in line and automatically boot in 5 seconds. Remember that if you have other operating systems installed you will have to count the entries and adjust the number accordingly.
GRUB menu.lst recovery instructions:
OK, maybe you goofed and your edits to the the menu.lst file did not work as planned. Whatever the case, if you followed the initial step of this article in backing up this file, you don’t have anything to worry about. Here’s how to restore your GRUB’s menu.lst to the original copy.Reboot your computer. Once the boot menu comes up, select the Recovery Mode option. In Ubuntu, you will see lots of text scrolling down the screen, and once the operating system has booted, a menu will come up. Choose the Drop to Root Shell Prompt option. You’ll see something like this:
root@desk$
Now type:
cd /boot/grub
You are now in the GRUB directory. Now, type:cp menu.lst_backup menu.lst
That’s it. Your original copy of the menu.lst file should now be restored.