Difference between revisions of "Change Boot Menu options from Grub Bootloader"
(53 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:Ubuntu]][[Category:Linux]] | ||
== What is the Grub Bootloader? == | == What is the Grub Bootloader? == | ||
Line 4: | Line 5: | ||
The '''Grub bootloader''' is a package that is used to boot various operating systems via a menu upon computer system boot-up. | The '''Grub bootloader''' is a package that is used to boot various operating systems via a menu upon computer system boot-up. | ||
+ | The bootloader menu file usually resides (or resided) in the '''/boot/grub/menu.lst''' file. | ||
+ | |||
== How the Grub Bootloader Works == | == How the Grub Bootloader Works == | ||
Line 9: | Line 12: | ||
Generally when most Linux systems are installed, the Grub bootloader program is installed. After Linux installation and computer reboot, the Grub bootloader menu should appear offering the user with a selection of operating systems to boot. The concept is similar to the '''boot.ini''' file that '''NTLDR''' (the boot loader for Windows OS) uses to supply a menu selection for a multiple-boot system. | Generally when most Linux systems are installed, the Grub bootloader program is installed. After Linux installation and computer reboot, the Grub bootloader menu should appear offering the user with a selection of operating systems to boot. The concept is similar to the '''boot.ini''' file that '''NTLDR''' (the boot loader for Windows OS) uses to supply a menu selection for a multiple-boot system. | ||
− | When the computer system starts, the computer's BIOS locates and runs the bootstrap program on the MBR (Master Boot Record). A series of programs (of Grub) are run provide the user a selection of operating system | + | |
+ | When the computer system starts, the computer's BIOS locates and runs the bootstrap program on the MBR (Master Boot Record). A series of programs (of Grub) are run provide the user with a selection of operating system to boot. For example, the user can select a version of Linux to load the Linux Kernel, or the user can select another operating system (like Windows) to load in the boot-loader (eg. NTLDR). This process of loading boot loaders for other non-Linux operating systems is referred to as '''chainloading'''. | ||
+ | |||
== Why Edit the Grub Bootloader? == | == Why Edit the Grub Bootloader? == | ||
− | There are | + | There are numerous reasons to edit the Grub bootloader: |
− | |||
* Change the order of bootable operating systems in the menu list | * Change the order of bootable operating systems in the menu list | ||
− | * Change the DEFAULT bootable operating system (eg. from | + | * Change the DEFAULT bootable operating system (eg. from timeout or "count-down") |
* Change the DEFAULT count-down (timeout) value | * Change the DEFAULT count-down (timeout) value | ||
* Change the appearance (color) of the bootloader menu | * Change the appearance (color) of the bootloader menu | ||
* Assign a boot password | * Assign a boot password | ||
* Add additional options to the kernel upon loading Linux Kernel | * Add additional options to the kernel upon loading Linux Kernel | ||
+ | |||
+ | |||
+ | '''NOTE: Many people complain that installing Linux causes Linux to be the DEFAULT operating system from a boot-loader list in Grub.'''<br /> | ||
+ | '''But the user can simply <u>edit</u> bootloader menu file to make their preferred operating system the DEFAULT.''' | ||
+ | |||
+ | |||
+ | ==Editing the Grub Bootloader ("'''/boot/grub/menu.lst'''" file exists) == | ||
+ | |||
+ | Let's assume that we have just installed Linux on our machine, and we want to edit the Grub Bootloader to set MS Windows as the DEFAULT operating system.<br /><br /> | ||
+ | !! '''NOTE:''' You should first make a <u>backup copy</u> of the bootloader file prior to making any editing changes. We will show you this in the step below !! | ||
+ | |||
+ | |||
+ | <u>'''STEPS'''</u>: | ||
+ | |||
+ | |||
+ | # Boot up into your <u>Linux system</u>.<br /><br /> | ||
+ | # Open a command prompt (called a ''Linux shell'') by selecting '''APPLICATIONS''' -> '''ACCESSORIES''' -> '''TERMINAL'''<br /><br /> | ||
+ | # In the terminal, issue the command: '''sudo su''' (this will give administrator priviledges - assuming your have these priviledges, enter your account password)<br /><br /> | ||
+ | # Issue the command: '''cp /boot/grub/menu.lst /boot/grub/menu.bk''' (just making a backup copy...)<br /><br /> | ||
+ | # Issue the command: '''gedit /boot/grub/menu.lst''' (this opens the file in gedit application to allow you to make changes)<br /><br /> | ||
+ | # Under Comments '''## End Default Options ##''' lists the linux Kernel versions (in groupings labelled '''title''', '''uuid''', '''kernel''' and '''initrd''') that will boot up.<br/> The first grouping at the top of that list will be the DEFAULT operating system.<br /><br /> | ||
+ | # Farther below should list '''non-linux OS''' choices. Usually you can identify them because in the grouping will contain the keyword "'''chainloader'''"<br /><br /> | ||
+ | # Copy and paste the non-linux (eg. Windows) groupings labelled '''title''', '''rootnoverify''', '''savedefault''', '''makeactive''', and '''chainloader''' immediately <u>ABOVE</u> the DEFAULT <u>Linux</u> grouping<br /><br /> | ||
+ | # Save and exit the file.<br /><br /> | ||
+ | # Test-out by rebooting your machine to load into your DEFAULT (Windows) OS, and then reboot to load into your Linux menu item. | ||
+ | |||
+ | |||
+ | ==Editing the Grub Bootloader ("'''/boot/grub/menu.lst'''" file does <u>NOT</u> exist) == | ||
+ | |||
+ | I discovered when I installed Mythbuntu 9.10 from a fresh install that the /boot/grub/menu.lst file did NOT exist! | ||
+ | I suspect there was a change in procedure... | ||
+ | |||
+ | |||
+ | Below are steps to edit the Grub Bootloader if the menu.lst file does NOT exist... | ||
+ | |||
+ | |||
+ | <u>'''STEPS'''</u>: | ||
+ | |||
+ | # Whenever booting up, notice the number of menu items (operating systems choices) in the grub boot loader list. Starting at zero, start counting until you count the item for MS Windows. Note that number. For example, if WIndows is download on the sixth line, then the number is seven.<br /><br /> | ||
+ | # Boot up into your <u>Linux system</u>.<br /><br /> | ||
+ | # Open a command prompt (called a ''Linux shell'') by selecting '''APPLICATIONS''' -> '''ACCESSORIES''' -> '''TERMINAL'''<br /><br /> | ||
+ | # In the terminal, issue the command: '''sudo su''' (this will give administrator priviledges - assuming your have these priviledges, enter your account password)<br /><br /> | ||
+ | # Issue the command: '''cp /etc/default/grub /etc/default/grub.bk''' (just making a backup copy...)<br /><br /> | ||
+ | # Issue the command: '''gedit /etc/default/grub''' (this opens the file in gedit application to allow you to make changes)<br /><br /> | ||
+ | # Change the option '''GRUB_DEFAULT=0''' to correspond to that number for your Windows OS boot loader you determined in stop #1.<br />For example, ''GRUB_DEFAULT=7'' would relate to making the 6th menu item the default OS boot. This means that upon bootup, that menu item is selected as the default in case you press ENTER or the count-down ends to run that OS selection... <br /><br /> | ||
+ | # Save and exit the file.<br /><br /> | ||
+ | # Run the command: '''update-grub'''<br /><br /> | ||
+ | # Test-out by rebooting your machine to load into your DEFAULT (Windows) OS, and then reboot to load into your Linux menu item.<br /><br /> | ||
+ | |||
+ | '''This Author's opinion:''' I suspect that this new method was designed to make things simpler, but I prefer (or at least I got used to) editing menu.lst file... | ||
+ | |||
+ | |||
+ | == The "Dreaded" Growing Grub Bootloader Menu List! == | ||
+ | |||
+ | Since Ubuntu Linux distributes a major release every six months, and new kernel distributions can be made available between major releases, the Grub bootloader menu list can grow LARGE. | ||
+ | |||
+ | I have seen my Bootloader menu grow to such an extent, that I have to scroll down several screens to boot a non-Linux OS! Therefore, occasionally, you can edit the Grub bootloader to shorten that list. | ||
+ | |||
+ | |||
+ | Just two things to remember <u>prior</u> to editing: | ||
+ | |||
+ | |||
+ | * Create a backup prior to editing. | ||
+ | * Don't remove the CURRENT DEFAULT Operating System to boot! | ||
+ | |||
+ | |||
+ | Hope this helps :) | ||
+ | |||
+ | Murray Saul |
Latest revision as of 19:22, 31 March 2010
Contents
What is the Grub Bootloader?
Grub stands for (GRand Unified Bootloader)
The Grub bootloader is a package that is used to boot various operating systems via a menu upon computer system boot-up. The bootloader menu file usually resides (or resided) in the /boot/grub/menu.lst file.
How the Grub Bootloader Works
Generally when most Linux systems are installed, the Grub bootloader program is installed. After Linux installation and computer reboot, the Grub bootloader menu should appear offering the user with a selection of operating systems to boot. The concept is similar to the boot.ini file that NTLDR (the boot loader for Windows OS) uses to supply a menu selection for a multiple-boot system.
When the computer system starts, the computer's BIOS locates and runs the bootstrap program on the MBR (Master Boot Record). A series of programs (of Grub) are run provide the user with a selection of operating system to boot. For example, the user can select a version of Linux to load the Linux Kernel, or the user can select another operating system (like Windows) to load in the boot-loader (eg. NTLDR). This process of loading boot loaders for other non-Linux operating systems is referred to as chainloading.
Why Edit the Grub Bootloader?
There are numerous reasons to edit the Grub bootloader:
- Change the order of bootable operating systems in the menu list
- Change the DEFAULT bootable operating system (eg. from timeout or "count-down")
- Change the DEFAULT count-down (timeout) value
- Change the appearance (color) of the bootloader menu
- Assign a boot password
- Add additional options to the kernel upon loading Linux Kernel
NOTE: Many people complain that installing Linux causes Linux to be the DEFAULT operating system from a boot-loader list in Grub.
But the user can simply edit bootloader menu file to make their preferred operating system the DEFAULT.
Let's assume that we have just installed Linux on our machine, and we want to edit the Grub Bootloader to set MS Windows as the DEFAULT operating system.
!! NOTE: You should first make a backup copy of the bootloader file prior to making any editing changes. We will show you this in the step below !!
STEPS:
- Boot up into your Linux system.
- Open a command prompt (called a Linux shell) by selecting APPLICATIONS -> ACCESSORIES -> TERMINAL
- In the terminal, issue the command: sudo su (this will give administrator priviledges - assuming your have these priviledges, enter your account password)
- Issue the command: cp /boot/grub/menu.lst /boot/grub/menu.bk (just making a backup copy...)
- Issue the command: gedit /boot/grub/menu.lst (this opens the file in gedit application to allow you to make changes)
- Under Comments ## End Default Options ## lists the linux Kernel versions (in groupings labelled title, uuid, kernel and initrd) that will boot up.
The first grouping at the top of that list will be the DEFAULT operating system. - Farther below should list non-linux OS choices. Usually you can identify them because in the grouping will contain the keyword "chainloader"
- Copy and paste the non-linux (eg. Windows) groupings labelled title, rootnoverify, savedefault, makeactive, and chainloader immediately ABOVE the DEFAULT Linux grouping
- Save and exit the file.
- Test-out by rebooting your machine to load into your DEFAULT (Windows) OS, and then reboot to load into your Linux menu item.
I discovered when I installed Mythbuntu 9.10 from a fresh install that the /boot/grub/menu.lst file did NOT exist! I suspect there was a change in procedure...
Below are steps to edit the Grub Bootloader if the menu.lst file does NOT exist...
STEPS:
- Whenever booting up, notice the number of menu items (operating systems choices) in the grub boot loader list. Starting at zero, start counting until you count the item for MS Windows. Note that number. For example, if WIndows is download on the sixth line, then the number is seven.
- Boot up into your Linux system.
- Open a command prompt (called a Linux shell) by selecting APPLICATIONS -> ACCESSORIES -> TERMINAL
- In the terminal, issue the command: sudo su (this will give administrator priviledges - assuming your have these priviledges, enter your account password)
- Issue the command: cp /etc/default/grub /etc/default/grub.bk (just making a backup copy...)
- Issue the command: gedit /etc/default/grub (this opens the file in gedit application to allow you to make changes)
- Change the option GRUB_DEFAULT=0 to correspond to that number for your Windows OS boot loader you determined in stop #1.
For example, GRUB_DEFAULT=7 would relate to making the 6th menu item the default OS boot. This means that upon bootup, that menu item is selected as the default in case you press ENTER or the count-down ends to run that OS selection... - Save and exit the file.
- Run the command: update-grub
- Test-out by rebooting your machine to load into your DEFAULT (Windows) OS, and then reboot to load into your Linux menu item.
This Author's opinion: I suspect that this new method was designed to make things simpler, but I prefer (or at least I got used to) editing menu.lst file...
The "Dreaded" Growing Grub Bootloader Menu List!
Since Ubuntu Linux distributes a major release every six months, and new kernel distributions can be made available between major releases, the Grub bootloader menu list can grow LARGE.
I have seen my Bootloader menu grow to such an extent, that I have to scroll down several screens to boot a non-Linux OS! Therefore, occasionally, you can edit the Grub bootloader to shorten that list.
Just two things to remember prior to editing:
- Create a backup prior to editing.
- Don't remove the CURRENT DEFAULT Operating System to boot!
Hope this helps :)
Murray Saul