Thursday, August 16, 2007

How to change Grub boot order in a XP/Linux system

The default boot system in a XP/Linux system is Linux. In order to change the default system to XP, you have to log-in as root, edit the file /boot/grub/menu.lst.

Change "default=x" option to the number you expect.
--------------------------------------------------------------------------------
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,1)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=2
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.22.1-41.fc7)
root (hd0,1)
kernel /vmlinuz-2.6.22.1-41.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.22.1-41.fc7.img
title Fedora (2.6.21-1.3194.fc7)
root (hd0,1)
kernel /vmlinuz-2.6.21-1.3194.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.21-1.3194.fc7.img
title Windows XP
rootnoverify (hd0,0)
chainloader +1
--------------------------------------------------------------------------------

How popular is your Linux distribution...

How popular is your Linux distribution...

How to resume Grub on a XP/Fedora system

If you install XP, then Fedora 7 on the same PC. Grub will be used as a loader for systems. However, If your XP corrupted, and re-installed. Grub will be lost. You can follow the operation listed below to resume Grub.

How to resume Grub on a XP/Fedora system:

After Boot-up using Fedora 7 Install Disk, there are four option:

- Install or upgrade an existing system
- Install or upgrade an existing system (text mode)
- Rescue installed system
- Boot from local drive

Select the 3rd option, Rescue installed system.

Follow the steps, until Rescue ask "Continue" to find your Linux installation and mount it ..., "Read-Only" or "Skip". Select "Skip".

Now you are in # shell.

type grub, the shell will change to grub>
....#grub

To check your Linux partition
grub> root (hd0,[TAB]

In my case, it's:
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0x07
Partition num: 1, Filesystem type is ext2fs, partition type 0x83
Partition num: 2, Filesystem type unknown, partition type 0x8e

Actually I don't know the meaning. But I guess partition 1 is my Linux.

grub> root (hd0,1)
grub> setup (hd0)

Now you can re-boot, and the Grub loader have been re-loaded.