Home › Forums › Operating Systems › Linux, ChromeOS and all other OS chat › How to make some changes to the boot loader (GRUB)
- This topic has 12 replies, 4 voices, and was last updated 14 years, 7 months ago by
TCMuffin.
-
AuthorPosts
-
February 4, 2009 at 12:16 am #160978
Alfihar
ParticipantHere are a few tips and tricks relating to GRUB, the boot loader which comes with most Linux distributions.
! This is dangerous, be very careful when attempting these changes. Triple check them to make sure you typed the right thing, as you can stop your computer from booting if you mess it up. With that said these changes are easy to make and problems can be corrected.
It is a very good idea to have either a live cd or a live memory stick running Linux, as this will allow you to recover from any problems.
It is best to make one change at a time then test it.
Opening/Editing the Configuration FileYou will need to be in Linux to make any of these changes.
Step 1
Open up the terminalStep 2
If you are running Ubuntu run the following commands, the first line makes a backup of the configuration file the second opens it (those are lower case L’s not number ones):-Code:sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backupCode:sudo gedit /boot/grub/menu.lstIf you are running Fedora run the following commands:-
Code:su –Then enter the root password
Code:cp /boot/grub/menu.lst /boot/grub/menu.lst_backupCode:gedit /boot/grub/menu.lstStep 3
Gedit should now be open with the configuration file for GRUB loaded.Next you can choose to make some of the changes which I’ll go over in the sections below.
Once you have made the changes check they are correct, then save the file and reboot your computer to see the results.
Number 1: The Time-outIn the configuration file there will be a line which reads (the number may vary):-
Code:timeout=10There are basically three settings you can have, these are:-
1. The usual 10 second time-out to load the default operating system, we can change this.
You can change the number which is in seconds to increase or decrease the delay before the default operating system is loaded. For example to set the time out to be 5 seconds you would modify it to be:-
Code:timeout=52. No time-out, so the computer will sit there waiting for you to choose which operating system to boot.
If you want to disable the timeout you need to comment out the like with a hash as follows:-
Code:#timeout=103. Instant time-out, so the computer doesn’t show the menu at all and boots the default OS immediately. This may seem foolish but it’s not, the boot loader will not flash up. However you can still get to it by holding down a button on the keyboard. This is nice if you very rarely boot into the other operating system and don’t want to wait at the selection screen.
! It seems that setting this on Ubuntu (maybe other distributions) will stop you from accessing the menu to select your OS, if you do try this make sure Ubuntu is set as your default OS so you can easily change it back again if necessarily.
To do this set the time out to be 0, as follows:-
Code:timeout=0Number 2: Changing the default operating systemThis will enable you to set Windows (or another opperating system) to be booted by default.
If you look down the configuration file you will see the following line (number may differ):-
Code:default=0The 0 refers to which entry gets booted by default, if you scroll down the configuration file you will see some lines starting with “title” for example the first one in mine reads:-
title Fedora (2.6.27.12-170.2.5.fc10.i686)
The top one is number 0, the second one down is number 1, etc…
If you wanted to boot the second entry you would change the line to read:-
Code:default=1Number 3: Booting the recovery partitionDISCLAIMER: I’ve taken these instructions from a post by prtsmgr and have not tried it myself as I no longer have the recovery partition.
At the end of the configuration file add the following lines:-
Code:title RecoveryCode:rootnoverify (hd0,0)Code:chainloader +1The next time you reboot you should have an entry labelled “Recovery” which will allow you to boot from the hidden partition.
Number 4: For Fedora 10 users, how to enable the nice animated loading sequence
instead of the boring barThe first boot entry (the one closest to the top of the file) which will look something like the following:-
Code:title Fedora (2.6.27.12-170.2.5.fc10.i686)Code:root (hd0,0)Code:kernel /vmlinuz-2.6.27.12-170.2.5.fc10.i686 ro root=/dev/VolGroup00/LogVol00 rhgb quietCode:initrd /initrd-2.6.27.12-170.2.5.fc10.i686.imgWe are interested in the line in bold.
On the end of that line you need to add the following:-Code:vga=0x315so that it reads as follows:-
!IMPORTANT The numbers/version will probably be different, do not copy the line below it is just an example.
Additionally there is a space between quiet and vga=0x315Code:kernel /vmlinuz-2.6.27.12-170.2.5.fc10.i686 ro root=/dev/VolGroup00/LogVol00 rhgb quiet vga=0x315When you reboot you should now get the nice animated start-up screen.
PSIf you notice that any of the instructions are wrong or you have some problems with this, let me know.
Updated: Added warnings for Ubuntu and an additional warning at the start.
February 4, 2009 at 12:24 am #182415TCMuffin
MemberExcellent post 🙂
February 16, 2009 at 2:33 pm #18240971notout
MemberHelp!
I followed these instructions (Ubuntu 8.10) and set timeout to 0, with default option to 6 (which I calculated as XP)
Now it always switches into Samsung Recovery when trying to boot, holding down keys does not seem to invoke boot menu.
Is there a specific key for this?
Please help before I have to do a full restore from back in November :o(
Cheers,
StevenFebruary 16, 2009 at 2:39 pm #182405Alfihar
ParticipantThat’s interesting, I have mine set this way and any key brings up the menu. I will have to look into that, and modify the post. Just checking, I have to hold down the key as it boots or at-least just before the BIOS has finished, is that what you were doing?
How did you load Ubuntu 8.10?
If you used the live cd/memory stick, boot using that. Once you have booted from the live cd/memory stick you should be able to access the menu.lst file on your hard drive and reverse any changes you made.I’m just about to go to a meeting, but I’ll be back in a few hours if you need any more help to sort this out, or more detailed instructions.
February 16, 2009 at 2:49 pm #18241071notout
MemberTried various key presses at various times.
Machine is dual boot with xp and Ubuntu 8.10
booting from HDD
February 16, 2009 at 2:53 pm #182406Alfihar
ParticipantShould have been clearer, I meant how you installed Ubuntu.
If you used an install disk, can you boot from that instead of the hard drive, as it should allow you to modify the menu.lst file located on your hard drive.
February 16, 2009 at 2:56 pm #18241171notout
Memberused unetbootin on a memory stick which has long been deleted 🙁
February 16, 2009 at 2:56 pm #18241271notout
Memberwill lookt at creating a new boot disk on an SD card and try that…
February 16, 2009 at 2:59 pm #182407Alfihar
ParticipantAh that’s a shame.
Unfortunately an SD card will not work, as you can’t boot from it.You may need to recreate the unetbootin memory stick, or download another smaller bootable Linux distribution.
February 16, 2009 at 3:02 pm #18241371notout
Memberd’oh – will need to wait until I get into work tomorrow to get my 1GB memory stick as my 4GB one has an OS on it…
February 16, 2009 at 3:42 pm #182404Xyrox
MemberHolding down Escape just before the BIOS screen disappears works for me. Running Arch with Grub.
February 17, 2009 at 10:47 am #18241471notout
MemberPhew! Fixed it by recreating my Unetbootin USB stick with live iso – booted from that, mounted the HDD space with Ubuntu installation and edited the GRUB back to original settings 🙂
Cheers,
StevenFebruary 17, 2009 at 11:07 am #182408Alfihar
ParticipantGlad you managed to fix it, I’ll update the first post later with some extra warnings.
-
AuthorPosts
- You must be logged in to reply to this topic.