PDA

View Full Version : [ubuntu] Ubuntu 10.04/Backtack 4 grub help



jynxnet
May 28th, 2010, 05:15 AM
I have looked all over for a solution to this problem, so I am turning here for help, I usually just read the forums for hours trying to find the solution but stumped at every turn.

Currently I have my laptop set with a Tri Boot of Windows 7/Ubuntu 10.04/Backtack 4

All OSes work I can load into them and everything works great. Here is my problem, I had Windows 7 on their first then BT 4, then Ubuntu. Before I got Ubuntu Installed I could edit the grub menu from /boot/grub/menu.lst but when I installed Ubuntu 10.04 it started using the grub for Ubuntu instead of BT 4 and uses the boot/grub/grub.cfg that isn't supposed to be edited because it gets its data from /etc/grub.d/.

I want a way to edit the ubuntu 10.04 grub without having to edit the files in etc/grub.d/ (I have no idea how to do this, if it was easy I guess it could be an option as well) or a way to go back to using the BT 4 grub (which I know how to edit) instead of the ubuntu one.

Thanks in advance

Nic

jynxnet
May 29th, 2010, 04:08 PM
Bump, still looking for help on this, thanks in advance

oldfred
May 29th, 2010, 06:19 PM
It took a while for me to learn grub2. I still recommend it and if editing is the only issue I would still suggest learning it.

If you want to revert to backtrack, is it using grub legacy with menu.lst then. You should be able to just reinstall its grub to the MBR. That grub will probalby not be able to find the Ubuntu entry and if you used ext4 may not work at all. Only some versions of grub 0.97 were updated to use ext4.

How to restore the Ubuntu/XP/Vista/7 bootloader (Updated for Ubuntu 9.10)
http://ubuntuforums.org/showthread.php?t=1014708

Total Custom menu:
http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:Custom_Menu
http://ubuntuforums.org/showthread.php?t=1483827
OR Partial Custom:
I used drs305's command to limit ubuntu entries to two, turned off os_prober so it does not look for other systems and totally customized my 40_custom.
includes line to limit display to two
Grub 2 Title Tweaks Thread -drs305
http://ubuntuforums.org/showpost.php?p=8082954&postcount=1
In /etc/default/grub I added this:
GRUB_DISABLE_OS_PROBER=true

jynxnet
May 30th, 2010, 06:17 PM
Ok have a question about which entry I need to choose.

The guide says

"Run gksudo gedit /etc/grub.d/40_custom

Add this to the end of the file:

menuentry "Custom Menu"{
set root=(hd0,5)
search --no-floppy --fs-uuid --set e7fee477-6a63-492e-839c-4d27ce99e2cf
configfile /boot/grub/custom_menu.cfg
}

Of course the "set" and "search" lines need to be adjusted. Just copy the correct entry from /boot/grub/grub.cfg. "

here is my /boot/grub/grub.cfg, what do I need to put in "set" and "search" at entry I add to the bottom of /etc/grub.d/40_custom

#
# 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 $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi


function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}


function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,10)'
search --no-floppy --fs-uuid --set 010d229a-4f71-4be0-9362-3a57135685db
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
insmod ext2
set root='(hd0,9)'
search --no-floppy --fs-uuid --set fb2e26e5-11b5-4b48-b2c0-a43ab9cb8136
set locale_dir=($root)/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###


### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###


### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-22-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,9)'
search --no-floppy --fs-uuid --set fb2e26e5-11b5-4b48-b2c0-a43ab9cb8136
linux /vmlinuz-2.6.32-22-generic-pae root=UUID=010d229a-4f71-4be0-9362-3a57135685db ro quiet splash
initrd /initrd.img-2.6.32-22-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.32-22-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,9)'
search --no-floppy --fs-uuid --set fb2e26e5-11b5-4b48-b2c0-a43ab9cb8136
echo 'Loading Linux 2.6.32-22-generic-pae ...'
linux /vmlinuz-2.6.32-22-generic-pae root=UUID=010d229a-4f71-4be0-9362-3a57135685db ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.32-22-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.31-21-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,9)'
search --no-floppy --fs-uuid --set fb2e26e5-11b5-4b48-b2c0-a43ab9cb8136
linux /vmlinuz-2.6.31-21-generic-pae root=UUID=010d229a-4f71-4be0-9362-3a57135685db ro quiet splash
initrd /initrd.img-2.6.31-21-generic-pae
}
menuentry 'Ubuntu, with Linux 2.6.31-21-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,9)'
search --no-floppy --fs-uuid --set fb2e26e5-11b5-4b48-b2c0-a43ab9cb8136
echo 'Loading Linux 2.6.31-21-generic-pae ...'
linux /vmlinuz-2.6.31-21-generic-pae root=UUID=010d229a-4f71-4be0-9362-3a57135685db ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.31-21-generic-pae
}
### END /etc/grub.d/10_linux ###


### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,9)'
search --no-floppy --fs-uuid --set fb2e26e5-11b5-4b48-b2c0-a43ab9cb8136
linux16 /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,9)'
search --no-floppy --fs-uuid --set fb2e26e5-11b5-4b48-b2c0-a43ab9cb8136
linux16 /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###


### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Vista (loader) (on /dev/sda1)" {
insmod fat
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 3c98-ac5d
chainloader +1
}
menuentry "Windows 7 (loader) (on /dev/sda2)" {
insmod ntfs
set root='(hd0,2)'
search --no-floppy --fs-uuid --set ae0886a508866be1
chainloader +1
}
menuentry "BACK|TRACK 4 (Ubuntu 8.10, kernel 2.6.30.9) (on /dev/sda4)" {
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set d9d24202-4a34-4bbd-b9d7-4af9b750bfd5
linux /vmlinuz-2.6.30.9 root=UUID=cd3da2c9-f60c-432d-a833-c27ed5715e23 ro vga=0x317
initrd /initrd.img-2.6.30.9
}
menuentry "Ubuntu 8.10, kernel 2.6.30.9 (recovery mode) (on /dev/sda4)" {
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set d9d24202-4a34-4bbd-b9d7-4af9b750bfd5
linux /vmlinuz-2.6.30.9 root=UUID=cd3da2c9-f60c-432d-a833-c27ed5715e23 ro single
initrd /initrd.img-2.6.30.9
}
menuentry "Ubuntu 8.10, memtest86+ (on /dev/sda4)" {
insmod ext2
set root='(hd0,7)'
search --no-floppy --fs-uuid --set d9d24202-4a34-4bbd-b9d7-4af9b750bfd5
linux /memtest86+.bin
}
### 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 ###

I was thinking I am supposed to use

set root='(hd0,9)'
search --no-floppy --fs-uuid --set fb2e26e5-11b5-4b48-b2c0-a43ab9cb8136

but I am not sure so I figured I would ask before I go ahead

thanks in advance again

Nic

oldfred
May 30th, 2010, 06:43 PM
It depends on where you put the config file as it has to match the location of the file.

if you put it in your Ubuntu /boot/grub directory then it should be:
set root='(hd0,9)'
search --no-floppy --fs-uuid --set fb2e26e5-11b5-4b48-b2c0-a43ab9cb8136

If you put it in the backtrack /boot/grub it would be different.