Grubb list menu

NoOp glgxg at sbcglobal.net
Fri Feb 5 23:45:37 UTC 2010


On 02/05/2010 03:25 PM, Tom H wrote:
>> The easy and quick way is to just go ahead edit grub.cfg file. Yes, I
>> know, I've seen all the dire warnings about how this is bad and not
>> recommended.... wah wah wah.. in reality, all this means is that the
>> menu order will go right back to default next time a Kernel update is
>> performed. As far as I'm concerned, this is a plus, since any screw ups
>> you make editing the grub.cfg file are just a grub-update away from
>> being fixed.
> 
>> The next way is to change the order that grub-update builds the file.
> 
>> The file is generated from a series of scripts (in /etc/grub.d). They
>> are executed in order, so just rename 10_linux 20_memtest86+
>> 30_os-prober to 10_os-prober 20_linux 30_memtest.
> 
>> (osprober is the script that finds windows and adds it to the grub.cfg
>> file) update-grub and your new menu should be arranged a little
>> differently.
> 
>> And finally, there's the screw this automatic crap, I'll do it myself
>> method. Append the contents of your grub.cfg file to the
>> /etc/grub.d/40_custom file, then remove the executable permission from
>> all the other files in /etc/grub.d. You can then edit the contents of
>> 40_custom to your heart's content, and when update-grub is called, it
>> will copy that file back into your grub.cfg file. Big warning though,
>> new kernels will *not* be automatically added to grub for you, you'll
>> have to do that yourself, as well as fixing the menu entries yourself if
>> one of your drive UUID's is changed somehow.
> 
> (1) If you edit grub.cfg, make sure that you back it up because it
> will be overwritten by update-grub at the next kernel upgrade.
> 
> (2) Renumbering the /etc/grub.d scripts is probably the safest way to
> change the order of the grub menu entries.
> 
> (3) Adding entries with 40_custom will not prevent update-grub from
> adding new kernels to the grub menu unless you run
> chmod 644 10_linux and 30_os-prober
> 

I may end up doing one of the above. On the new laptop w/Win7 on it, it
picks up the backup/restore partions. While I don't want to permanently
eliminate those from grub2, I do prefer to hide them:

$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.31-19-generic
Found initrd image: /boot/initrd.img-2.6.31-19-generic
Found linux image: /boot/vmlinuz-2.6.31-18-generic
Found initrd image: /boot/initrd.img-2.6.31-18-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
Found Windows Vista (loader) on /dev/sda2 <=== this
Found Windows Vista (loader) on /dev/sda3 <=== and this
done






More information about the ubuntu-users mailing list