PDA

View Full Version : [ubuntu] Ubuntu 14.04.1 LTS & Grub



talishka
October 1st, 2014, 03:10 PM
Hi guys, i'm having some issues after upgrading, also in fresh installations. I want to remove the following lines for each OS entry in grub, is there any simple way of do it?

recordfail
load_video
gfxmode $linux_gfx_mode
insmod part_msdos
insmod ext2

Thanks in advance!

Bucky Ball
October 1st, 2014, 03:14 PM
Upgrading? You have upgraded to a newer release? Say, 12.04 to 14.04 for example? How did you upgrade?

Where are these things appearing? Are they in a file somewhere or in /etc/fstab?

PS: EXT2 is very old. Do you still have ext2 partitions? Advise you backup data and reformat that, but probably not your issue. Are these errors appearing sometime? If so, when?

talishka
October 1st, 2014, 03:28 PM
Upgrading from Ubuntu 12.04.5 LTS (server edition), the upgrade takes places with "do_release_upgrade" command, it works perfectly this procedure.

These things appears in grub.cfg which is generated by grub-mkconfig using templates from /etc/grub.d and settings from /etc/default/grub. I can manually edit the grub.cfg as i did and the system boots without problem, the thing is i want to do it correctly, and disable it from the templates.

Bucky Ball
October 1st, 2014, 03:31 PM
I can manually edit the grub.cfg ...

Do not manually edit that file. Changes will not be kept. Edit /etc/default/grub, save changes, exit, then:


sudo update-grub

Looks like you may have had third-party drivers (as in proprietary) or manually installed PPAs active in 12.04 at the time of the upgrade. That can be problematic. You may need to purge video drivers and reinstall them or go to Software Sources (Software Updater>Settings) and disable any repos that are related to 12.04 or you have enabled manually.

grahammechanical
October 1st, 2014, 03:52 PM
You may need to work your way through the official Grub menu to find an answer.

http://www.gnu.org/software/grub/manual/

Check out section 5 - Writing your own configuration file.

http://www.gnu.org/software/grub/manual/grub.html#Configuration


In the meantime, those who feel that it would be easier to write grub.cfg directly are encouraged to do so (see Booting (http://www.gnu.org/software/grub/manual/grub.html#Booting), and Shell-like scripting (http://www.gnu.org/software/grub/manual/grub.html#Shell_002dlike-scripting)), and to disable any system provided by their distribution to automatically run grub-mkconfig.


Ubuntu uses a shell script - /usr/sbin/update-grub and that runs grub-mkconfig

Regards.

oldfred
October 1st, 2014, 04:11 PM
Grub2 does not internally have all the drivers or mod files. So it does insmod to load the necessary drivers it needs. Some are defaults so reloading does not then matter.

But I would not delete those lines.

I am working from memory, so not 100% sure if correct. See grub documentation for details.

recordfail - so grub loads menu after system crash
load_video - You need video
gfxmode $linux_gfx_mode - tries to use Ubuntu's system video
insmod part_msdos - needs to know partitioning, other type is gpt
insmod ext2 - for all of the ext2, ext3 or ext4 family, needs to know format of partition

You can also turn off os-prober, houseclean all the old kernels and that will clean up menu a lot. And then add your own custom menus in 40_custom.

Configuring the Boot Menu in Ubuntu - Boot Order in grub
http://www.psychocats.net/ubuntu/bootmenu
https://help.ubuntu.com/community/Grub2/Setup#Specific_Entries
https://help.ubuntu.com/community/Grub2/CustomMenus

How to: Create a Customized GRUB2 Screen that is Maintenance Free.- Cavsfan
https://help.ubuntu.com/community/MaintenanceFreeCustomGrub2Screen
http://ubuntuforums.org/showthread.php?t=2076205

talishka
October 1st, 2014, 04:16 PM
Done! I had to edit the file 10_linux in /etc/grub.d/10_linux and comment out some lines. Thanks!