PDA

View Full Version : Help in modifying GRUB.conf file



codingfreak
July 13th, 2009, 12:27 PM
Hi

I am a newbie to Linux. I have dual boot system with WindowsXp. This is my grub.conf file content

# 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,5)
# kernel /vmlinuz-version ro root=/dev/sda8
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,5)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.25.10-86.fc9.i686)
root (hd0,5)
kernel /vmlinuz-2.6.25.10-86.fc9.i686 ro root=UUID=870366ad-d6fb-4b95-9e38-ccf884ba94fc rhgb quiet
initrd /initrd-2.6.25.10-86.fc9.i686.img
title Other
rootnoverify (hd0,0)
chainloader +1
Now I want to use the partition containing Windows. So can anyone help me to change the above grub.conf so that there would be no problem if I format the Windows partition from Linux.

dstew
July 13th, 2009, 01:51 PM
If you don't want the "Other" entry to appear on your grub menu, just delete the entry.

codingfreak
July 13th, 2009, 04:03 PM
So you mean the following code works out fine



# 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,5)
# kernel /vmlinuz-version ro root=/dev/sda8
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,5)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.25.10-86.fc9.i686)
root (hd0,5)
kernel /vmlinuz-2.6.25.10-86.fc9.i686 ro root=UUID=870366ad-d6fb-4b95-9e38-ccf884ba94fc rhgb quiet
initrd /initrd-2.6.25.10-86.fc9.i686.imgWhat about "default=0" value ??

raymondh
July 13th, 2009, 04:57 PM
Grub manual for reference:

http://www.gnu.org/software/grub/manual/html_node/

Default 0 means that OS/Distro/kernel/partition will be the first to boot.

codingfreak
July 15th, 2009, 04:10 AM
Grub manual for reference:

http://www.gnu.org/software/grub/manual/html_node/

Default 0 means that OS/Distro/kernel/partition will be the first to boot.

In my case should I modify the Default value to 5 ???


# 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,5)
# kernel /vmlinuz-version ro root=/dev/sda8
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,5)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.25.10-86.fc9.i686)
root (hd0,5)
kernel /vmlinuz-2.6.25.10-86.fc9.i686 ro root=UUID=870366ad-d6fb-4b95-9e38-ccf884ba94fc rhgb quiet
initrd /initrd-2.6.25.10-86.fc9.i686.img

title Other
rootnoverify (hd0,0)
chainloader +1Basically my system has Windows XP later I have installed Linux.

$ df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda8 ext3 26G 17G 7.8G 68% /
/dev/sda6 ext3 99M 12M 83M 13% /boot
tmpfs tmpfs 506M 96K 506M 1% /dev/shm
/dev/sda5 ext3 9.7G 2.8G 6.9G 29% /media/disk-1
/dev/sda1 fuseblk 40G 15G 25G 37% /media/diskSo now if I delete the Windows partition "/dev/sda1" and format it into ext3 will here be any booting problems ??

dstew
July 15th, 2009, 05:06 PM
In my case should I modify the Default value to 5 ?No, the default value tells grub that the first OS in your list is the default, that is, the one to boot on timeout. Default should be 0 in your case (grub counts from 0).


So now if I delete the Windows partition "/dev/sda1" and format it into ext3 will here be any booting problems?Possibly. If you re-create the exact same partition in the exact same place, it should boot OK. But, if you move it, and if that results in the BIOS giving a different number to the parition, you would need to re-install grub.

But, why delete and re-create the partition? Just reformat it as ext3, and then you should be able to use it. That will also be your best bet for having no booting issues.

codingfreak
July 16th, 2009, 04:03 AM
No, the default value tells grub that the first OS in your list is the default, that is, the one to boot on timeout. Default should be 0 in your case (grub counts from 0).

Possibly. If you re-create the exact same partition in the exact same place, it should boot OK. But, if you move it, and if that results in the BIOS giving a different number to the parition, you would need to re-install grub.

But, why delete and re-create the partition? Just reformat it as ext3, and then you should be able to use it. That will also be your best bet for having no booting issues.

So dstew if I simply format the Windows partition into ext3 and change the grub file into

# 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,5)
# kernel /vmlinuz-version ro root=/dev/sda8
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,5)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.25.10-86.fc9.i686)
root (hd0,5)
kernel /vmlinuz-2.6.25.10-86.fc9.i686 ro root=UUID=870366ad-d6fb-4b95-9e38-ccf884ba94fc rhgb quiet
initrd /initrd-2.6.25.10-86.fc9.i686.imgthen there would be no problems in booting the machine.

dstew
July 16th, 2009, 04:03 PM
I don't see why you would have any trouble booting. You are not deleting or moving any partitions, and you are not changing the menu item that boots Linux.

codingfreak
July 21st, 2009, 04:01 AM
I don't see why you would have any trouble booting. You are not deleting or moving any partitions, and you are not changing the menu item that boots Linux.

Problem is I am not only just modifying the GRUB file but also deleting the Windows partition of 40GB and formatting it into EXT3.

Since Windows is in Primary Partition will formatting it into EXT3 corrupts the bootloader ??

dstew
July 21st, 2009, 01:46 PM
Since Windows is in Primary Partition will formatting it into EXT3 corrupts the bootloader ??Re-formatting the Windows partition will eliminate the Windows boot loader, but not the grub boot loader. The grub boot loader stage1 should already be in the MBR, which is not part of the Windows partition, and the grub stage2 should be in your Linux partition. But, you won't need the Windows boot loader any more, since you are getting rid of Windows.

Again, if you don't need to delete the Windows partition, then don't. Just reformat it.

codingfreak
July 22nd, 2009, 10:33 AM
Re-formatting the Windows partition will eliminate the Windows boot loader, but not the grub boot loader. The grub boot loader stage1 should already be in the MBR, which is not part of the Windows partition, and the grub stage2 should be in your Linux partition. But, you won't need the Windows boot loader any more, since you are getting rid of Windows.

Again, if you don't need to delete the Windows partition, then don't. Just reformat it.

Thank you ...... Now all my doubts regarding the topic were cleared .....