Edit GRUB list

Usually when you have two operating systems on a single computer and one of them is Linux, you will face this problem that by updating the Linux (especially when your Linux kernel is upgraded) your OS list (if you are using GRUB) order will displayed in a new order and the Linux with new kernel will become the first choice of the list. Apparently this is hard for most of people if their first choice was alwas the other OS (usually Windows), because in GRUB after few seconds, if you don’t press any key the GRUB it self will select the first choice, and after the recent update the first choice has changed. By following the steps below, you can reorganize the GRUB list order. As you know all Linux configurations stores in text files, so by editing those text files, you can edit the whole feature. but the very first step is determining your GRUB version:

Determine Your GRUB Version

I searched for a good way to find out what your GRUB version is and I found many websites suggesting some commands, but in my opinion you should check which one will work for you, so try the two following commands, one will show an error and the other one will show you the version:

grub-install -v

or

grub2-install -v

in my Fedora 16, grub2 is the suitable one. So fr

om now on I’m going to write commands using grub2, but if in your Linux version the grub one worked, just replace grub with grub2in every command.

Login with SuperUser Account (root)

if you are logged in with root, skip this step and go to the next one. type the following command and it will ask for the root password in the very next line.

su

 

Backup the GRUB List File

In order to prevent human error, it would be better if you backup your original configuration file in a safe place and then edit the file so you be able to overwrite previous configuration on it’s previous place:

cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.bk

 

Editing GRUB List File

Open the file in graphical mode using the following command:

gedit /boot/grub2/grub.cfg

or open it in the terminal:

nano -w /boot/grub2/grub.cfg

In this file you can see some sections and each section is for one OS. You can simply move your desired OS section  over the first section and make it the first default choice.

Leave a Reply

Your email address will not be published. Required fields are marked *

This is new type of CAPTCHA, make the puzzle please !WordPress CAPTCHA