GRUB Editing in Linux

Grub:

Grub failure is a common issue we faced while installing more than one operating systems.I am also experienced the same problem with my system and the first thing I tried with linux (Ubuntu 10.04 LTS) was the Grub Editing.

If we have lost grub, and system face fail to boot in a linux existing system, we can recover the grub by inserting the live-CD of the same distro.In the terminal environment run the command..

sudo update-grub

Also, in the already existing grub structure we can rearrange the ordering of operating system listed. And we have the option to hide the unwanted menu entries in the opening grub list.for this, we have to follow the steps below…

Open the terminal environment
1) Go to the location where grub.cfg placed.
cd /boot/grub
2) Open the file grub.cfg
sudo gedit grub.cfg
(type your password for getting permisssion)
3) Copy the contents into a temp file, say temp
4) Go to the location where grub.d placed.
cd /etc/grub.d
5) Open the 40_custom file
sudo gedit 40_custom
(type your password for getting permisssion)
6) Paste the contents of the temp file we previously copied.
In this we can see the menu entry list and their order, by rearanging that
(Each menu entry is a block included between two brace brackets {}) we can modify the
contents as per our wish.After editing save the file and close.
7) change the mode of execution of other files(ie, as unexecutable)
sudo chmod -x 10_fname1 20_fname2 30_fname3
(for viewing the filenames type “ls” in terminal from: /etc/grub.d)
8) update the grub
sudo update-grub

Hope this help you in editing grub.Try and have fun!!!
Best wishes.

Advertisements

About ashiksp

computer science & Engg student , N.S.S College of engineering palakkad
This entry was posted in College. Bookmark the permalink.

5 Responses to GRUB Editing in Linux

  1. LK says:

    Cool…
    This post will be help those who struggle with the grub. thanku ASP for this effort ..

  2. anand says:

    hai ashik,
    please avoid the usage of ‘&’ while you trying to open gedit as an administrator (eg : Steps 2 & 5 in your post, $sudo gedit file_name &), it shows some problems, pls check it out & reply if the problem is there.

    • ashiksp says:

      ok, anand. Good information.Thank you.
      Yes, there is a problem with using “&” along with sudo (administrator) command. I will make changes in the mentioned steps.

      But, in normal cases by using “&” while opening editor we can have the terminal back from the opening process.So the same terminal can also be used for the other activities.

      • anand says:

        Yeah it is possible get a terminal if you use ‘&’ symbol, but it is not possible with the ‘sudo’, dat’s why i told you to cross check the same. & please note that the problem is only with a ‘gedit’, i guess it could be some kind of bug.

  3. anand says:

    I guess the problem is when you use ‘&’ the terminal won’t prompt you to enter your admin passwd, hope you noticed it! If you really want to use ‘&’, before the command try ‘$sudo sh’. Now ‘&’ will work.
    cheers!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s