PDA

View Full Version : How to edit your GRUB.conf


gonzalo76
27th March 2004, 05:59 AM
Problem

I have this 6 partitions on my disk:

hd0,0 = Windows XP
hd0,1 = Documents
hd0,2 = Music
hd0,4 = Fedora /boot
hd0,5 = Fedora /root
hd0,6 = Fedora /swap

I use GRUB installed in the MBR to boot Windows XP and Fedora Core, but under Windows XP with the Partition Magic I made another partition in the free space of the Music partition, now I have 7 partitions.

hd0,0 = Windows XP
hd0,1 = Documents
hd0,2 = Music
hd0,4 = Videos
hd0,5 = Fedora /boot
hd0,6 = Fedora /root
hd0,7 = Fedora /swap


But the problem is that grub does not boot anymore. Now, I can't boot any system and what appears to me is the GRUB boot minimal bash-like line black screen.
What should I do to fix this problem?
Should I reinstall GRUB or should I only edit /boot/grub/grub.conf with the new entries?


Solution

What happened here is that you broke GRUB's partitions table. When you delete or add partitions, boot table and drive numbers/letters changed their orders in the /boot/grub/grub.conf.
Since you did this using Windows, grub doesn't know things have changed and tries to look to Fedora's boot partition from wrong places.

Before adding the new partition Videos, Fedora's boot partition was in hd0,4.
After adding the new partition Videos, Fedora's boot partition is now in hd0,5.
You have to tell GRUB about this modification. How? Editing grub.conf.


This is the grub.conf before adding the new partition

--------------------------------------------------------------------
#grub.conf generated by anaconda

default=0
timeout=10
splashimage=(hd0,4)/grub/splash.xpm.gz

title GNU/Linux Fedora Core 1 (2.4.22-1.2174.nptl)
root (hd0,4)
kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ hdc=ide-scsi apm=off acpi=on rhgb
initrd /initrd-2.4.22-1.2174.nptl.img

title Microsoft Windows XP Pro
rootnoverify (hd0,0)
chainloader +1
----------------------------------------------------------------------

So, what you have to do is edit your /boot/grub/grub.conf with the new partition table.

(First of all, enter your BIOS setup and in BOOT Sequence window choose to boot with CDROM first.)

1) Boot with your Fedora Core Installation CD 1.

2) Type "linux rescue" at the prompt.

3) Answer the questions about keyboard and language.

4) Tell the rescue mode to use your proper partition to mount (the one that you want to get booted into)

Choose Continue

(Don't choose Cancel or Read Only) because you want to edit grub.conf

5) When you come to the console prompt type:

sh-2.05# chroot /mnt/sysimage

6) Edit your grub.conf with nano, type:

sh-2.05# nano /boot/grub/grub.conf

7) You'll only have to edit 2 lines:

splashimage=(hd0,4)/grub/splash.xpm.gz

root (hd0,4)
(This is your /boot partition, specifies which partition contains your Linux kernel image.



This is the grub.conf after editing your grub.conf

-------------------------------------------------------------------------
#grub.conf generated by anaconda

default=0

timeout=10
splashimage=(hd0,5)/grub/splash.xpm.gz

title GNU/Linux Fedora Core 1 (2.4.22-1.2174.nptl)
root (hd0,5)

kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ hdc=ide-scsi apm=off acpi=on rhgb
initrd /initrd-2.4.22-1.2174.nptl.img

title Microsoft Windows XP Pro
rootnoverify (hd0,0)
chainloader +1
----------------------------------------------------------------------------

8) Eject your Fedora Core installation CD1 and type exit to reboot your system.

sh-2.05# exit

If everything went just fine, voila, GRUB boot window appears again!! :)

-----------------------
Related HOWTO
How to install GRUB in the MBR
http://www.fedoraforum.org/forum/showthread.php?s=&threadid=975

sachin_malik
26th April 2005, 10:42 AM
i am very new to linux
i want to install windows 98 and windows 2000 and two distros of linux. will u tell tell me the exact procedure in details.

mghiba
26th April 2005, 11:21 AM
You are welcome
Firstly you have to isntall widnows 98 and then windows 2k
Secondly install Linux
Grup will recognize Dos and Linux.
if you chose Dos you cand swich between win98 and win 2k
Best wishes

Knudson
30th April 2005, 03:59 PM
here is a little hint for those like me with grub problem with sata disks! nice topic :)

Problem:

i have 1 hard disk s-ata which has windows installed on it. I bought a second sata hard drive that i want to use for linux. After installing on it FC3 and grub, i cannot boot windows from grub.

Solution

Supposing (my situation)

/dev/sda --> sata disk with fedora
/dev/sdb --> sata disk with windows

the grub.conf entry realated to windows should be changed :

FROM:

title win2k
rootnoverify(0,0)
chainloader +1

TO:

title win2k
rootnoverify(1,0)
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1


after googling a bit , i think that this happens because S-ata are Point-2-point devices (aka no primary/secondary master/slave) and grub suppose that one must be a slave.

hope this helps :)

knu

mghiba
1st May 2005, 10:00 AM
Okay I want to understand when you installed fedora in one of inallation steps fedora told you if you would like to make Dos the first boot or FC 3, alright her if you did not see it that mean fedora doest not realse Windows. In this case I perfare to reinstall windows and then install FC3 in on one HDA. and that is better for you.

jaymes
20th June 2006, 02:13 AM
thanks for the info...I ran into a similar but different problem and this helped alot.

I used an Asus A8N-sli premium which has 2 sata controllers (nvidia and silicon)
The nvidia sata shows in the bios and allows booting while the silicon bios comes up separate (after) from the motherboard bios and does not allow the hard drives on it to show in the motherboard's bios or allow for boot order in the MB bios
(actually if you make a raid in the silicon bios, the raid will show up in the MB bios...but since these are fake (software) raids and don't work well with linux, I am using linux software raid since it is better supported for my raid needs)
So I put 2 80Gb sata hard drives on the nvidia controller for my file system and 4 500Gb sata hard drives on the silicon controller for my storage.
I install Fedora Core 5, use disk druid in the FC5 installation to create raid1 out of the 2 80's. They show up as hard drives 5 and 6...sde and sdf. Works great. The 4 500's show up as sda, sdb, sdc, and sdd (drives 1-4)
Finish install and FC5 works perfectly.

Then i fdisk the 4 500's, one partition each, toggle to fd (raid filesystem), then turn them into a raid10 (2 mirrors of 500Gb that are raid0 together to form a 1000Gb unit).
Note: used mdadm --create --verbose /dev/md6 --level=10 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
format the raid10 as ext3
mounted as /storage
fixed mdadm.conf and /etc/fstab
waited til the array resynced
restarted and got a "grub hard disk error" on reboot

Because grub looked to boot from the 5th disk (hd4,0), ie sd5
note disk 1 is hd0, 2 is hd1, 3 is hd2, 4 is hd3, 5 is hd4, 6 is hd5
While the install and the first booting had the boot disk as hd4
creating the array on hd0 thru hd3 caused hd4 and hd5 to become hd0 and hd1
and hd0 thru hd3 to become hd2 thru hd5

not sure on the specifics of why it happen, nor do I care as of today...i think the motherboard bio booting order got it back to the order it should have been in the first place...whatever

Then I found this thread and switch the hd4 in the grub.conf to hd0 and it boots perfectly again. Life is good again. Hope this helps anyone who finds themselves in this bizzare situation.
thanks gonzalo76 for the info and your football team is tearing up world cup play.

Caraibes
21st June 2007, 08:07 PM
here's mine :

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,4)
# kernel /boot/vmlinuz-version ro root=/dev/sda5
# initrd /boot/initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,4)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.21-1.3228.fc7)
root (hd0,4)
kernel /boot/vmlinuz-2.6.21-1.3228.fc7 ro root=LABEL=/1 rhgb quiet
initrd /boot/initrd-2.6.21-1.3228.fc7.img
title Fedora (2.6.21-1.3194.fc7)
root (hd0,4)
kernel /boot/vmlinuz-2.6.21-1.3194.fc7 ro root=LABEL=/1 rhgb quiet
initrd /boot/initrd-2.6.21-1.3194.fc7.img
title Other
rootnoverify (hd0,0)
chainloader +1

roscao
1st March 2008, 01:08 PM
I have a dual boot system (Windows and fedora 8). I would like to know how to configure the boot loader in order to have windows as default system until I will manage to teach my wife to use Linux. Please help!

Hlingler
1st March 2008, 01:14 PM
Hello:

Look for "Bootloader Configuration" on the menus. It's a GUI for grub.conf. You only get two choices: default OS and countdown timer. Choose Windo$e as the default OS (it might be labeled "Other").

V

roscao
1st March 2008, 01:48 PM
I must admit, but I cannot find the the Bootloader Configuration,

JN4OldSchool
1st March 2008, 02:05 PM
I waited as I dont want to step on Hlinger's toes...

Just do this:

su
(your root password)
gedit /etc/grub.conf

You could also gedit /boot/grub/grub.conf OR /boot/grub/menu.lst. All 3 are the same file.

Just change the default value to match the Windows title entry. The first title is "0", the next is "1" and so on.

awei
15th April 2008, 12:58 PM
help me plzz...i'm newbie and very exciting wth all this. after install F7 from live cd, my laptop still boot straight to winxp without showing/pouse at grub.

i want it to show/pause at grub, so i can choose WinXP or F7 but by default it should boot F7. my partition /boot is /dev/sda3 as i open wth GParted. can i simply edit the grub.conf without reinstall the grub?

here's the grub.conf:

# 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,2)
# kernel /vmlinuz-version ro root=/dev/sda7
# initrd /initrd-version.img
#boot=/dev/sda3
default=0
timeout=15
splashimage=(hd0,2)/grub/splash.xpm.gz
#hiddenmenu
title Fedora (2.6.21-1.3194.fc7)
root (hd0,2)
kernel /vmlinuz-2.6.21-1.3194.fc7 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.21-1.3194.fc7.img
title Other
rootnoverify (hd0,0)
chainloader +1

hermouche
19th April 2008, 06:01 AM
according to your grub .conf file you have got 15 seconds to choose wether to boot the fedora or windows.

By default, after 15 seconds, fedora should boot in your system.

Now if you want to change, and let say you want windows as a booting system by default, just change the line:

default=0

by

default=1

That's it.

red

ALCT
20th April 2008, 07:51 PM
according to your grub .conf file you have got 15 seconds to choose wether to boot the fedora or windows.

By default, after 15 seconds, fedora should boot in your system.

Now if you want to change, and let say you want windows as a booting system by default, just change the line:

default=0

by

default=1

That's it.

red


hermouche,

Are you saying that if awei changes" default = 0 " to "default=1", you will not see a pause at grub and boot directly to Windows?

What if I boot directly to windows and now I want to boot to fedora, Will I be able to config the gurb.conf without going into Fedora first.?

hermouche
21st April 2008, 08:20 AM
hermouche,

Are you saying that if awei changes" default = 0 " to "default=1", you will not see a pause at grub and boot directly to Windows?

What if I boot directly to windows and now I want to boot to fedora, Will I be able to config the gurb.conf without going into Fedora first.?

Hy ALCT,

I said that if you change default=0 to default=1, and if you don't touch any key for a while here (timeout=15), the box boot directly to windows.
default=0
timeout=15


Another think, if you want or don't want to see the pause at grub, you should edit the following:

#hiddenmenu >>>>>>>>>>>>>>>>>>>>> will not hide the grub menu (get the pause as you said)
hiddenmenu >>>>>>>>>>>>>>>>>>>>>> will hide the grub menu

Hope it's clear :)

red

awei
23rd April 2008, 07:14 AM
...thats clear enough...thanks hermouche.

but still the same as before, boot directly to windows... it still using windows loader/boot. How to make it load/boot to grub first so then i can choose F7 or windows. Or maybe something wrong with my partitioning? here it is:

partition filesystem label flags
/dev/sda1................ntfs.......................... ......boot
/dev/sda3................ext3.............../boot
/dev/sda2................extended...................... lba
...../dev/sda5..........fat32
...../dev/sda6..........linux-swap
...../dev/sda7..........ext3................/1


hi ALCT,

"What if I boot directly to windows and now I want to boot to fedora, Will I be able to config the gurb.conf without going into Fedora first.?"


that is my situation now. i'm using F7 live CD... config the grub.conf using gedit.

awei
23rd April 2008, 07:36 AM
gtg...be back soon...

hermouche
23rd April 2008, 10:02 PM
"What if I boot directly to windows and now I want to boot to fedora, Will I be able to config the gurb.conf without going into Fedora first.?"

I am not sure that i've fully understand your request !!
It appears that, at some point in the fedora install process, we are asked to keep the windows boot loader or to install grub boot loader and use it as a default boot loader. So , what was the answer?

Br3nn0s
30th August 2008, 08:47 AM
I have a similar problem, but not the same and I dont understand how to do.
I cannot boot windows XP.

I had(have) windows XP on my primary HD on sda, then I had fedora 6 on sdb (on the secondary slave one)
Then I would try to install fedora 9, but I stupidly think to delete the fedora 6 by using windows xp disk manager.
I have done this procedure, then I restart the system, I have installed fedora 9, but grub doesnt see the windows partition.
Initially grub says error 13, then I understand that grub is on sdb (wow, I think to be a dummy), so I check BIOS, and change boot sequence, disabling the primary HD, and checking the secondary HD where Fedora 9 is. Now boot sequence is: CD, secondary HD, floppy disk.

Now Fedora 9 does function very well, and I can see also the partitions of windows XP (C: where windows xp is installed, and then the extendend partions where my datas are (D: and E:)).

But Windows XP doesnt run.

When I try to run xp grub tells me that:

title Windows XP
rootnoverify (hd1,0)
makeactive
chainloader +1

then wainting infinitely. No led and no reading the HD. I dont understand why.

My /boot/grub/grub.conf is that:

# more /boot/grub/grub.conf
# 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,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sdb
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.25.14-108.fc9.i686)
root (hd0,0)
kernel /vmlinuz-2.6.25.14-108.fc9.i686 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.25.14-108.fc9.i686.img
#title Fedora (2.6.25-14.fc9.i686)
# root (hd0,0)
# kernel /vmlinuz-2.6.25-14.fc9.i686 ro root=UUID=efe66c37-c54c-4421-87e1-676bf67e811a rhgb quie
t
# initrd /initrd-2.6.25-14.fc9.i686.img
title Windows XP
rootnoverify (hd1,0)
makeactive
chainloader +1

My /boot/grub/device.map is that:

# more /boot/grub/device.map
# this device map was generated by anaconda
(hd1) /dev/sda
(hd0) /dev/sdb

I also try to write ''makeactive'' on the grub.conf start menu under windows xp booting, but it doesnt funcion.

How to do to run again windows xp?
Could You help me please?
Thank You very much 4 helping a poor dummy.

P.S. I dislike to use fixmbr or fixboot from CD-install-win-XP, 'cause it could be possible to delete datas, and I dislike to re-install all... you know how much time does it wastes. I hope that there is an other solution.

Demz
30th August 2008, 08:51 AM
please post this as a New thread, , as you can see this is an old Thread so im closing it

Fort Dauphin Instagram Photos - Guadeloupe - Churachandpur Photos