PDA

View Full Version : [ubuntu] how to reduce number of entries in grub screen menu??



ramaswamyps
February 9th, 2010, 11:06 AM
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd1,8)
search --no-floppy --fs-uuid --set 4431ee45-3d7a-482f-807e-1294efa8f0db
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=20
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod ext2
set root=(hd1,8)
search --no-floppy --fs-uuid --set 4431ee45-3d7a-482f-807e-1294efa8f0db
insmod tga
if background_image /usr/share/images/grub/Plasma-lamp.tga ; then
set color_normal=white/black
set color_highlight=yellow/red
else
set menu_color_normal=white/black
set menu_color_highlight=yellow/red
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-19-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,8)
search --no-floppy --fs-uuid --set 4431ee45-3d7a-482f-807e-1294efa8f0db
linux /boot/vmlinuz-2.6.31-19-generic root=UUID=4431ee45-3d7a-482f-807e-1294efa8f0db ro quiet splash
initrd /boot/initrd.img-2.6.31-19-generic
}
menuentry "Ubuntu, Linux 2.6.31-19-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,8)
search --no-floppy --fs-uuid --set 4431ee45-3d7a-482f-807e-1294efa8f0db
linux /boot/vmlinuz-2.6.31-19-generic root=UUID=4431ee45-3d7a-482f-807e-1294efa8f0db ro single
initrd /boot/initrd.img-2.6.31-19-generic
}
menuentry "Ubuntu, Linux 2.6.31-18-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,8)
search --no-floppy --fs-uuid --set 4431ee45-3d7a-482f-807e-1294efa8f0db
linux /boot/vmlinuz-2.6.31-18-generic root=UUID=4431ee45-3d7a-482f-807e-1294efa8f0db ro quiet splash
initrd /boot/initrd.img-2.6.31-18-generic
}
menuentry "Ubuntu, Linux 2.6.31-18-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,8)
search --no-floppy --fs-uuid --set 4431ee45-3d7a-482f-807e-1294efa8f0db
linux /boot/vmlinuz-2.6.31-18-generic root=UUID=4431ee45-3d7a-482f-807e-1294efa8f0db ro single
initrd /boot/initrd.img-2.6.31-18-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,8)
search --no-floppy --fs-uuid --set 4431ee45-3d7a-482f-807e-1294efa8f0db
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4431ee45-3d7a-482f-807e-1294efa8f0db ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,8)
search --no-floppy --fs-uuid --set 4431ee45-3d7a-482f-807e-1294efa8f0db
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4431ee45-3d7a-482f-807e-1294efa8f0db ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set f6e2efcce2ef8ee5
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "openSUSE 11.2 (on /dev/sdb10)" {
insmod ext2
set root=(hd1,10)
search --no-floppy --fs-uuid --set f5d07f90-b459-4722-a965-49f5ee110535
linux /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part10 resume=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part6 splash=silent quiet showopts vga=0x314
initrd /boot/initrd-2.6.31.5-0.1-default
}
menuentry "Failsafe -- openSUSE 11.2 (on /dev/sdb10)" {
insmod ext2
set root=(hd1,10)
search --no-floppy --fs-uuid --set f5d07f90-b459-4722-a965-49f5ee110535
linux /boot/vmlinuz-2.6.31.5-0.1-default root=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part10 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x314
initrd /boot/initrd-2.6.31.5-0.1-default
}
menuentry "linux (on /dev/sdb11)" {
insmod ext2
set root=(hd0,11)
search --no-floppy --fs-uuid --set 9134bdab-080a-4cae-8ba3-b42ef0beb2f1
linux /boot/vmlinuz BOOT_IMAGE=linux root=UUID=9134bdab-080a-4cae-8ba3-b42ef0beb2f1 acpi=on resume=UUID=2f0514d1-e8e3-4742-8380-ba7ed2e1420e splash=silent vga=788
initrd (hd0,11)/boot/initrd.img
}
menuentry "linux-nonfb (on /dev/sdb11)" {
insmod ext2
set root=(hd0,11)
search --no-floppy --fs-uuid --set 9134bdab-080a-4cae-8ba3-b42ef0beb2f1
linux /boot/vmlinuz BOOT_IMAGE=linux-nonfb root=UUID=9134bdab-080a-4cae-8ba3-b42ef0beb2f1 acpi=on resume=UUID=2f0514d1-e8e3-4742-8380-ba7ed2e1420e
initrd (hd0,11)/boot/initrd.img
}
menuentry "failsafe (on /dev/sdb11)" {
insmod ext2
set root=(hd0,11)
search --no-floppy --fs-uuid --set 9134bdab-080a-4cae-8ba3-b42ef0beb2f1
linux /boot/vmlinuz BOOT_IMAGE=failsafe root=UUID=9134bdab-080a-4cae-8ba3-b42ef0beb2f1 failsafe acpi=on
initrd (hd0,11)/boot/initrd.img
}
menuentry "Ubuntu 9.04 (on /dev/sdb5)" {
insmod ext2
set root=(hd1,5)
search --no-floppy --fs-uuid --set dce4d5f5-422e-4603-adb3-059adb84f507
linux /boot/vmlinuz-2.6.28-17-generic root=UUID=dce4d5f5-422e-4603-adb3-059adb84f507 ro xforcevesa quiet splash mem=430M
initrd /boot/initrd.img-2.6.28-17-generic
}
menuentry "Ubuntu 9.04(recovery mode) (on /dev/sdb5)" {
insmod ext2
set root=(hd1,5)
search --no-floppy --fs-uuid --set dce4d5f5-422e-4603-adb3-059adb84f507
linux /boot/vmlinuz-2.6.28-17-generic root=UUID=dce4d5f5-422e-4603-adb3-059adb84f507 ro xforcevesa single
initrd /boot/initrd.img-2.6.28-17-generic
}
menuentry "Gentoo Linux (on /dev/sdb7)" {
insmod ext2
set root=(hd1,7)
search --no-floppy --fs-uuid --set bf779907-4f31-4005-ab9d-c9413765aafe
linux /boot/kernel-2.6.31-gentoo-r6 root=/dev/sdb7 mem=430M
}
menuentry "openSUSE 11.2 - 2.6.31.12-2 (on /dev/sdb9)" {
insmod ext2
set root=(hd1,9)
search --no-floppy --fs-uuid --set 6ed59fa9-9dd3-431f-92a8-78720f6ee06d
linux /boot/vmlinuz-2.6.31.12-2-default root=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part8 resume=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part6 splash=silent quiet showopts mem=430M vga=0x314
initrd /boot/initrd-2.6.31.12-2-default
}
menuentry "Failsafe -- openSUSE 11.2 - 2.6.31.12-2 (on /dev/sdb9)" {
insmod ext2
set root=(hd1,9)
search --no-floppy --fs-uuid --set 6ed59fa9-9dd3-431f-92a8-78720f6ee06d
linux /boot/vmlinuz-2.6.31.12-2-default root=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part8 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x314
initrd /boot/initrd-2.6.31.12-2-default
}
menuentry "Debug -- openSUSE 11.2 - 2.6.31.8-0.1 (on /dev/sdb9)" {
insmod ext2
set root=(hd1,9)
search --no-floppy --fs-uuid --set 6ed59fa9-9dd3-431f-92a8-78720f6ee06d
linux /boot/vmlinuz-2.6.31.8-0.1-debug root=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part9 resume=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part6 splash=silent quiet showopts mem=430M vga=0x314
initrd /boot/initrd-2.6.31.8-0.1-debug
}
menuentry "openSUSE 11.2 - 2.6.31.8-0.1 (pae) (on /dev/sdb9)" {
insmod ext2
set root=(hd1,9)
search --no-floppy --fs-uuid --set 6ed59fa9-9dd3-431f-92a8-78720f6ee06d
linux /boot/vmlinuz-2.6.31.8-0.1-pae root=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part9 resume=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part6 splash=silent quiet showopts mem=430M vga=0x314
initrd /boot/initrd-2.6.31.8-0.1-pae
}
menuentry "Failsafe -- openSUSE 11.2 - 2.6.31.8-0.1 (pae) (on /dev/sdb9)" {
insmod ext2
set root=(hd1,9)
search --no-floppy --fs-uuid --set 6ed59fa9-9dd3-431f-92a8-78720f6ee06d
linux /boot/vmlinuz-2.6.31.8-0.1-pae root=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part9 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x314
initrd /boot/initrd-2.6.31.8-0.1-pae
}
menuentry "Desktop -- openSUSE 11.2 - 2.6.31.8-0.1 (on /dev/sdb9)" {
insmod ext2
set root=(hd1,9)
search --no-floppy --fs-uuid --set 6ed59fa9-9dd3-431f-92a8-78720f6ee06d
linux /boot/vmlinuz-2.6.31.8-0.1-desktop root=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part9 resume=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part6 splash=silent quiet showopts mem=430M vga=0x314
initrd /boot/initrd-2.6.31.8-0.1-desktop
}
menuentry "Failsafe -- openSUSE 11.2 - 2.6.31.8-0.1 (desktop) (on /dev/sdb9)" {
insmod ext2
set root=(hd1,9)
search --no-floppy --fs-uuid --set 6ed59fa9-9dd3-431f-92a8-78720f6ee06d
linux /boot/vmlinuz-2.6.31.8-0.1-desktop root=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part9 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x314
initrd /boot/initrd-2.6.31.8-0.1-desktop
}
menuentry "openSUSE 11.2 - 2.6.31.8-0.1 (default) (on /dev/sdb9)" {
insmod ext2
set root=(hd1,9)
search --no-floppy --fs-uuid --set 6ed59fa9-9dd3-431f-92a8-78720f6ee06d
linux /boot/vmlinuz-2.6.31.8-0.1-default root=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part9 resume=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part6 splash=silent quiet showopts vga=0x314
initrd /boot/initrd-2.6.31.8-0.1-default
}
menuentry "Failsafe -- openSUSE 11.2 - 2.6.31.8-0.1 (default) (on /dev/sdb9)" {
insmod ext2
set root=(hd1,9)
search --no-floppy --fs-uuid --set 6ed59fa9-9dd3-431f-92a8-78720f6ee06d
linux /boot/vmlinuz-2.6.31.8-0.1-default root=/dev/disk/by-id/ata-ST3250823A_3ND2FPDS-part9 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x314
initrd /boot/initrd-2.6.31.8-0.1-default
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

every time update-grub run all these are put back.
editing grub.cfg does not help.

Bachstelze
February 9th, 2010, 11:08 AM
You're not supposed to edit it. ;)


# DO NOT EDIT THIS FILE

To remove a kernel from the GRUB menu, uninstall the corresponding linux-image package in your package manager.

ramaswamyps
February 9th, 2010, 11:29 AM
as you can see i have following distros installed and their grub installed to their own partitions
ubuntu-9.04 /dev/sdb5
gentoo /dev/sdb7
ubuntu-9.10 /dev/sdb8
opensuse-11.2 /dev/sdb9
alt opensuse-11.2 /dev/sdb10
pclinuxos2009 /dev/sdb11

i cannot make an entry in the grub command line to get to any partition
other than through this grub menu of ubuntu-9.10[grub2]

if i put any other grub in mbr it cannot find this /sdb8 partition.
is there any way i can make an entry of the partition to boot from??

i get chainloader +1 as not recognised command.
any help on this issue is appreciated.

thanks:)

darkod
February 9th, 2010, 02:02 PM
as you can see i have following distros installed and their grub installed to their own partitions
ubuntu-9.04 /dev/sdb5
gentoo /dev/sdb7
ubuntu-9.10 /dev/sdb8
opensuse-11.2 /dev/sdb9
alt opensuse-11.2 /dev/sdb10
pclinuxos2009 /dev/sdb11

i cannot make an entry in the grub command line to get to any partition
other than through this grub menu of ubuntu-9.10[grub2]

if i put any other grub in mbr it cannot find this /sdb8 partition.
is there any way i can make an entry of the partition to boot from??

i get chainloader +1 as not recognised command.
any help on this issue is appreciated.

thanks:)

There is NO NEED to chainload for linux. First decide which linux you want to use the bootloader from, for example, ubuntu 9.10 because it uses the new grub2. Install 9.10 for example, and the grub2 on the MBR (not on a partition to chainload).
Then, for every next linux install, there should be Advanced settings during the install where you can tell it not to install a bootloader.
At first, the new linux won't be seen in grub2, just ubuntu 9.10 will be there. But after you boot 9.10 and run update-grub it should detect the new linux and add it to grub2 menu.
That is the best way instead of jumping from grub to grub.

In your current situation, when you have a bootloader on almost all of your partitions, I'm not sure it would work but you can try installing grub2 from th 9.10 on the MBR of the hdd, and it will run the show and boot any linux you select.

dE_logics
February 9th, 2010, 02:14 PM
Man...Ubuntu devlopers have done a very bad job changing from menu.1st...the system administrators are bound to have problems.

I dont know what version they have used!...It's not even in portage!

ramaswamyps
February 9th, 2010, 02:15 PM
that is exactly the current state.
the grub update puts all kernels and bzImages it finds on other partitions in the menu.
for 6 bootable systems it shows about 14 entries in the grub menu screen.
i wanted to show the 6 bootable systems only.
memtest recovery boot safe boot and all that how can i remove?

darkod
February 9th, 2010, 02:26 PM
Because you have a mix of linux distributions I'm not exactly sure how it would work, but for ubuntu you have instructions here how to make memtest and recovery mode not show:
http://ubuntuforums.org/showthread.php?t=1195275

For recovery mode, think again if you want them to not show, because you might need it sometimes.

ramaswamyps
February 9th, 2010, 02:54 PM
i tried installing grub-.097 after removing grub-pc.
it could not even boot ubuntu-9.10
the disk id and partition ids have changed.
it might need lot of work to make the grub version change and boot .
as of now it boots all distros. only the boot grub screen is crowded and there is a scroll for seeing the full menu.:)
probably it takes more study of grub2 workings and knack of using its configuration :(

bcbc
February 9th, 2010, 02:55 PM
You can create a custom menu with only the ones you want...

http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:Custom_Menu

darkod
February 9th, 2010, 02:56 PM
i tried installing grub-.097 after removing grub-pc.
it could not even boot ubuntu-9.10
the disk id and partition ids have changed.
it might need lot of work to make the grub version change and boot .
as of now it boots all distros. only the boot grub screen is crowded and there is a scroll for seeing the full menu.:)
probably it takes more study of grub2 workings and knack of using its configuration :(

Did you read the link I posted?
For ubuntu it is very easy to disable memtest and recovery mode, but what you will need to see is whether that will also disable the recovery mode for other linux versions. Give it a shot, there is not that much to study.

ramaswamyps
February 9th, 2010, 06:05 PM
yes now i read through the full page on the link.
it is nice idea to have a custom menu.
i tried to make one as per pagethat put me into windows xp.
i have to do some more work/experiment with it.
will get back here with result.

oldfred
February 9th, 2010, 09:34 PM
darko is not so big on chainbooting and grub2 is very good at finding other operating system. But when you have lots of systems it makes for a very busy menu. I still have my desktop setup with some chainbooting from old grub, but primarily boot with grub2. I also like meierfra custom menu approach.

Since you have 2 drives you can have two boot loaders in MBR and older grub in the PBR of those installs and chainboot them. You can turn off the osprober in grub2 so it does not find new systems and only use your entries.

Chainboot from a grub2 entry, entry can also be set root=(hd1) for chain to MBR of drive2 :

# Entry N - Chainload another bootloader
menuentry "Chainload my OS" {
set root=(hd0,N)
chainloader +1
}

Add this line to grub
gksudo gedit /etc/default/grub
GRUB_DISABLE_OS_PROBER="true"

ramaswamyps
February 13th, 2010, 11:26 AM
oldfred


# Entry N - Chainload another bootloader
menuentry "Chainload my OS" {
set root=(hd0,N)
chainloader +1
}

Add this line to grub
gksudo gedit /etc/default/grub
GRUB_DISABLE_OS_PROBER="true"

i tried to do the way you have said to use chainloader +1
i made new entries of chanloadings after removing all entries in grub.cfg
i entered osprobe disabled.
run grub update.
but it does not work as expected.
infact nothing shows in grub boot menu

can you give me more details and an example of how to do it?

thanks in advance.:)

i was trying different ways to achieve chainloading other os
that is why delay in response.

darkod
February 13th, 2010, 11:54 AM
darko is not so big on chainbooting

You got me right Fred. :)


i tried to do the way you have said to use chainloader +1
i made new entries of chanloadings after removing all entries in grub.cfg
i entered osprobe disabled.
run grub update.
but it does not work as expected.

And this is why. :)

Did you put that entry in grub.cfg directly? Don't edit grub.cfg directly, it gets recreated from the config files when you run update-grub anyway.

The menuentry oldfred suggested should be entered in /etc/grub.d/40_custom. After that when you run update-grub it should show in your grub menu.
But for that to work you have to be sure the bootloader(s) installed on the partition(s) are working fine.

oldfred
February 13th, 2010, 04:55 PM
I think Darko has it right. I am not at home and using my portable, so I only have some of my notes not my full multidrive desktop where I have chainbooting with both old and new grub. I will not be back until later in March to confirm myself. (snowbirding)

It is important to have grub installed in the partition as that is what you are chainbooting to or to the MBR set root=(hd1) of another drive which is what I do, and have grub linked to a grub partition . You also have to be using the grub2 numbering of partitions for grub2 entries in 40_custom and grub legacy numbering for menu.lst entries.

Snowbird - native Floridians call us northerners that flock down south for the winter snowbirds.