Updating Ubuntu grub

Link to this post 08 May 12


I tape on Terminal : sudo gedit /boot/grub/grub.cfg
I configure what I need and save the file in question but after I do sudo update-grub I guess the changes do not take effects any longer and the configurations come back to their previous default ones.

How can I fix this ? I mean, after updating the grub how can I keep my personal configurations for this file ?


Link to this post 15 May 12

Making changes to grub.cfg and then running update-grub, overwrites grub.cfg. You don't mention what changes you're trying to make, so, can't give you specific instructions.

These files/folders are used for Grub2 configuration.
/etc/default/grub (text file for basic grub configuration)
/etc/grub.d (folder) Look at the contents of the files in this folder for info on how to revise grub more specifically. The files are commented really well, but, if your uncomfortable with changing code, leave them alone.

Here's a link from the Ubuntu Community on Grub2 that may contain a better explanation:

Making changes to grub.cfg will always be overwritten by update-grub, so, you need to learn how grub2 works. If you can tell us specifically what you're trying to do, then, we may be able to point you to a single change you can make to save you time.

Link to this post 15 May 12

Thank you very much for the answer.

I want to change the default time for the boot menu loader, the default operating system boot, and the colors of the text of the boot menu. If I do not upgrade these changes take effects, but if I do upgrade they got deleted and the default settings become restored in /boot/grub/grub.cfg



Link to this post 15 May 12

Do the changes in the files and reboot.

It's as simple as that :)


Link to this post 15 May 12


sure Marc, what you say works, but my question is: why when I upgrade the grub then those changes disappear and everything go back to the default settings that file ?


Link to this post 15 May 12

Because it's main functionallity is to *create* grub config files ;)

I quote from a man page

"update-grub is a program used to generate the menu.lst file used by the grub bootloader. It works by looking in /boot for all files which start with "vmlinuz-". They will be treated as kernels, and grub menu entries will be created for each. It will also create the initial menu.lst if none exists, after prompting the user. It will also add initrd lines for ramdisk images found with the same version as kernels found. e.g. /boot/vmlinuz-2.4.5 and /boot/initrd-2.4.5 will cause a line of "initrd=/boot/initrd-2.4.5 or simliar to be added for the kernel entry in the menu.lst."

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Linux Training / Board

/** BC-056 Ameex changes to add tracking code - 2016-01-22 **/ ?>