PDA

View Full Version : [ubuntu] Grub2 Update Problem



De_JA_Vu
December 9th, 2009, 07:32 AM
Hi all,
My system is on Dual boot with Karmic Koala.
4 Hard drive.
Ubuntu 9.10 and Windows 7 is on two separate hard drive.
Made some minor changes on grub splash image.
Tried to update grub2.
comes with the following error.
Need help please.




sudo update-grub2
[sudo] password for :
Generating grub.cfg ...
No path or device is specified.
Try ``grub-probe --help'' for more information.
No path or device is specified.
Try ``grub-probe --help'' for more information.


My fdisk -l

-ubuntu9:~$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0505fa6c

Device Boot Start End Blocks Id System
/dev/sda2 * 2 121601 976752000 5 Extended
/dev/sda5 2 53411 429015793+ 7 HPFS/NTFS
/dev/sda6 53412 121601 547736143+ 7 HPFS/NTFS

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x9c82cbba

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 42700 342987718+ 7 HPFS/NTFS
/dev/sdb2 42701 121601 633772282+ 5 Extended
/dev/sdb5 42701 121601 633769840 7 HPFS/NTFS

Disk /dev/sdc: 37.0 GB, 37019566080 bytes
255 heads, 63 sectors/track, 4500 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0000db72

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 1825 14659281 83 Linux
/dev/sdc2 1826 4500 21486937+ 5 Extended
/dev/sdc5 1826 1949 995998+ 82 Linux swap / Solaris
/dev/sdc6 1950 4500 20490876 83 Linux

Disk /dev/sdd: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2c1459ac

Device Boot Start End Blocks Id System
/dev/sdd1 * 1 4635 37229448 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sdd2 4635 13156 68444176 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sdd3 13157 38913 206893102+ 5 Extended
Partition 3 does not end on cylinder boundary.
/dev/sdd5 13157 26034 103442503+ 7 HPFS/NTFS
/dev/sdd6 26035 38913 103450536 7 HPFS/NTFS





MY grub.cfg file on /boot/grub/grub.cfg



#
# 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=(hd2,1)
search --no-floppy --fs-uuid --set 249a4f68-b694-458e-9247-1f57185fe6ab
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=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod ext2
set root=(hd2,1)
search --no-floppy --fs-uuid --set 249a4f68-b694-458e-9247-1f57185fe6ab
insmod tga
if background_image /boot/grub/Plasma-lamp.tga ; then
set color_normal=black/black
set color_highlight=magenta/black
else
set menu_color_normal=white/black
set menu_color_highlight=black/white
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-15-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd2,1)
search --no-floppy --fs-uuid --set 249a4f68-b694-458e-9247-1f57185fe6ab
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=249a4f68-b694-458e-9247-1f57185fe6ab ro quiet splash
initrd /boot/initrd.img-2.6.31-15-generic
}
menuentry "Ubuntu, Linux 2.6.31-15-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd2,1)
search --no-floppy --fs-uuid --set 249a4f68-b694-458e-9247-1f57185fe6ab
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=249a4f68-b694-458e-9247-1f57185fe6ab ro single
initrd /boot/initrd.img-2.6.31-15-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=(hd2,1)
search --no-floppy --fs-uuid --set 249a4f68-b694-458e-9247-1f57185fe6ab
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=249a4f68-b694-458e-9247-1f57185fe6ab 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=(hd2,1)
search --no-floppy --fs-uuid --set 249a4f68-b694-458e-9247-1f57185fe6ab
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=249a4f68-b694-458e-9247-1f57185fe6ab 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 "Windows 7 (loader) (on /dev/sdd1)" {
insmod ntfs
set root=(hd3,1)
search --no-floppy --fs-uuid --set 1a3c377e3c3753cb
chainloader +1
}
### 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 ###


MY /etc/default/grub file



# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT="10"
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=1024x768

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entrys
#GRUB_DISABLE_LINUX_RECOVERY="true"

rahilm
December 9th, 2009, 09:01 AM
Try

sudo grub-mkconfig -o /boot/grub/grub.cf

and just for information, on which hard drive's MBR is grub2 installed on. (I can't understand grub.cfg)

Shazaam
December 9th, 2009, 11:34 AM
Wrong path for your image (in /boot/grub/grub.conf)...

if background_image /boot/grub/Plasma-lamp.tga ; then

There should be no images in /boot/grub. They should be in /usr/share/images. See below.

And/or--
That error, (for me) usually indicates that there is a problem with this line...

for i in {/boot/grub,/usr/share/images/desktop-base}/Windbuchencom.{png,tga} ; do
in /etc/grub.d/05_debian_theme dealing with the grub background image...

# check for usable backgrounds
use_bg=true
if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
for i in {/boot/grub,/usr/share/images/desktop-base}/Windbuchencom.{png,tga} ; do
if is_path_readable_by_grub $i ; then
bg=$i
case ${bg} in
*.png) reader=png ;;
*.tga) reader=tga ;;
*.jpg|*.jpeg) reader=jpeg ;;
esac
if test -e /boot/grub/${reader}.mod ; then
echo "Found Debian background: `basename ${bg}`" >&2
use_bg=true
break
fi
fi
done
fi
Make sure that the path/file name for the image looks similar to this (yours may be different)...

{/boot/grub,/usr/share/images/desktop-base}/Windbuchencom.{png,tga}
If that is correct make sure the image is in the folder specified. Mine are in...

/usr/share/images/desktop-base
so this line in my grub.cfg ends up like so..

if background_image /usr/share/images/desktop-base/Windbuchencom.tga ; then.


Your line in debian_theme should look like this (if your images are actually in /usr/share/images/grub)...

for i in {/boot/grub,/usr/share/images/grub}/Plasma-lamp.{png,tga} ; do

and your /boot/grub/grub.cfg will change to this after running update-grub again...

if background_image /usr/share/images/grub/Plasma-lamp.tga ; then

De_JA_Vu
December 11th, 2009, 12:48 PM
Your line in debian_theme should look like this (if your images are actually in /usr/share/images/grub)...

for i in {/boot/grub,/usr/share/images/grub}/Plasma-lamp.{png,tga} ; do

and your /boot/grub/grub.cfg will change to this after running update-grub again...

if background_image /usr/share/images/grub/Plasma-lamp.tga ; then

Mate, you are a legend.
I dont know how it happened but there was no image present on
/usr/share/images/desktop-base

I just put one image in there. and updated grub. it worked like a charm.
Thank you very much. this nifty problem were eating my head.

Shazaam
December 11th, 2009, 01:15 PM
Glad to see you got it working.

Aside...
If you want to play around (and you have the hard drive space) without mucking up your working system install some kind of virtualization app (VirtualBox, VMWare, etc) and then load up Ubuntu (or whatever distro you want) on it. That way you can tweak it until it breaks without damaging your normal installation. Just remember that 3d support is iffy at best with most virtualization programs and they usually use their own drivers (not direct access to physical hardware). That situation is improving though.