PDA

View Full Version : how to edit grub to start Windows first



redhat_ali
10th November 2007, 11:52 AM
hi again everyone! :)
I installed Fedora6 to dual boot with a legacy OS but I missed the part of making the legacy OS the default. how can I edit the grub.conf file to make this legacy OS the default OS? this is still part of my study as a newbie, please help.
thanks a lot in advance:)

glennzo
10th November 2007, 11:58 AM
Open a terminal, login as root and type gedit /boot/grub/menu.lst. There's a line at the top of the file that says default = n. Change that number to reflect the position of the legacy OS and it will be the default OS. Here's mine as an example.

default=0
timeout=30
splashimage=(hd0,4)/boot/grub/splash.xpm.gz
title Fedora 8 (2.6.23.1-42.fc8)
root (hd0,4)
kernel /boot/vmlinuz-2.6.23.1-42.fc8 ro root=LABEL=/ vga=791
initrd /boot/initrd-2.6.23.1-42.fc8.img
title Fedora 7 (2.6.23.1-21.fc7)
root (hd0,5)
kernel /boot/vmlinuz-2.6.23.1-21.fc7 ro root=LABEL=/1 vga=791
initrd /boot/initrd-2.6.23.1-21.fc7.img
title Windows Vista Home Premium
rootnoverify (hd0,1)
chainloader +1

Fedora 8 is the default here. If I want Fedora 7 as the default then I change the 0 to a 1. If I want Windows as the default I change the 0 to a 2. Make your changes, save and exit. Next time you reboot you will see the change.

redhat_ali
10th November 2007, 12:31 PM
Open a terminal, login as root and type gedit /boot/grub/menu.lst. There's a line at the top of the file that says default = n. Change that number to reflect the position of the legacy OS and it will be the default OS. Here's mine as an example.

default=0
timeout=30
splashimage=(hd0,4)/boot/grub/splash.xpm.gz
title Fedora 8 (2.6.23.1-42.fc8)
root (hd0,4)
kernel /boot/vmlinuz-2.6.23.1-42.fc8 ro root=LABEL=/ vga=791
initrd /boot/initrd-2.6.23.1-42.fc8.img
title Fedora 7 (2.6.23.1-21.fc7)
root (hd0,5)
kernel /boot/vmlinuz-2.6.23.1-21.fc7 ro root=LABEL=/1 vga=791
initrd /boot/initrd-2.6.23.1-21.fc7.img
title Windows Vista Home Premium
rootnoverify (hd0,1)
chainloader +1

Fedora 8 is the default here. If I want Fedora 7 as the default then I change the 0 to a 1. If I want Windows as the default I change the 0 to a 2. Make your changes, save and exit. Next time you reboot you will see the change.

hi there glenn! :)
thanks for the VERY QUICK REPLY!:)
il do it right away... thanks bro n God bless! :)

glennzo
10th November 2007, 12:35 PM
You're welcome. Now you've advanced your Linux knowledge a notch. Was easy, right?

JoeyJoJoe
10th November 2007, 01:13 PM
glennzo, just as a follow up question which could be useful to me and few other people who are looking for this, but can't you use the title as a reference for the default rather than the position which (IIRC) changes when you install new kernels or OSs.

What I mean is if you have;

title Windows

somewhere can you not use;

default="Windows"


I only ask as I seem to remember doing this one time a while ago but I'm not too sure now. I would try playing about with it to find out but I'm going to be installing fedora 8 today, and one problem at a time seems best.

redhat_ali
10th November 2007, 01:16 PM
You're welcome. Now you've advanced your Linux knowledge a notch. Was easy, right?

yes bro! that's an additonal advanced for me, this one I owe you ;)
actually 70% of my knowledge in Linux, i gained here in this community. Im not yet that much good, but Im always looking forward to that :)

hey bro, can you teach me to edit my boot script so that it will automatically set my DHCP server. I usually set my DHCP server by doing two tasks at the CLI as root.

# touch /var/state/dhcp/dhcpd.leases
# /usr/sbin/dhcpd

I have to this all the time just to make my DHCP server work and my DHCP client to detect their IPs.

another favor...if you dont mind :)

glennzo
10th November 2007, 01:26 PM
glennzo, just as a follow up question which could be useful to me and few other people who are looking for this, but can't you use the title as a reference for the default rather than the position which (IIRC) changes when you install new kernels or OSs.

What I mean is if you have;

title Windows

somewhere can you not use;

default="Windows"


I only ask as I seem to remember doing this one time a while ago but I'm not too sure now. I would try playing about with it to find out but I'm going to be installing fedora 8 today, and one problem at a time seems best.
Don't know the answer. I've never seen anything that references the use of the name rather than the position. Once you learn your way around grub, and how to fix it if you mess it up, then it's no problem to play with it. Might be worth a try, but on the other hand, if it ain't broke don't fix it. Check out google for grub docs.

JoeyJoJoe
10th November 2007, 01:29 PM
I might check it out later to see if titles do work.

as for start-up processes I just had a look and found this; http://openskills.info/infobox.php?ID=228 it might be worth looking at. I know I have started things before on start-up but I can't remember off the top of my head how I did it. As I say that link might be helpful

PeTzZz
10th November 2007, 01:34 PM
The other method is to use the system-config-boot tool that is a GUI (graphical user interface) for changing the default boot entry. It can be installed with the Add/Remove Software.

Just for the information.

---

NB! Please continue with the DHCP issue in the thread you just created (http://www.fedoraforum.org/forum/showthread.php?t=171513) to prevent separated talk about the same thing. All talk about it will be split to that thread or deleted.

:)