PDA

View Full Version : [ubuntu] Grub error after ubuntu 9.10 install



hcker2000
January 6th, 2010, 01:51 PM
I can't seem to get into my ubuntu install after well installing it. Grub just loads up and says some thing like

"error cant find device " then has a really long string after it.

This is a single 80 gig hard drive with a swap partition and an ext4 partition on it.

I am at a loss as to how to fix whats happening here. If any one could help out that would be great.

presence1960
January 6th, 2010, 02:25 PM
Let's get a better look at your setup & boot process. Boot the Ubuntu Live CD/USB. Choose "try ubuntu without any changes", when the desktop loads come back here and use the link in my signature to download the Boot Info Script to the desktop. Once on desktop open a terminal (Applications > Accessories > Terminal) and run this command
sudo bash ~/Desktop/boot_info_script*.sh This will create a RESULTS.txt file on the desktop. Paste the entire contents of that file back here. Once pasted highlight all text and click the # sign on the toolbar to place code tags around the text.

hcker2000
January 6th, 2010, 09:21 PM
Thanks I will post the results when I get home. Just for more info I have tried 3 times to format and install with the same results. The only thing I can think that might be causing this is that I had ubuntu 7.10 on the drive before I formated to install 9.10

hcker2000
January 7th, 2010, 12:48 AM
Here is the resulting info. After i get this fixed up I have 4 1tb hard drives to plug in and get set up so I hope that wont effect any thing


============================= Boot Info Summary: ==============================

=> Grub 1.97 is installed in the MBR of /dev/sda and looks on the same drive
in partition #1 for /boot/grub.
sda1: __________________________________________________ _______________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 9.10
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda2: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00095377

Partition Boot Start End Size Id System

/dev/sda1 * 63 151,075,259 151,075,197 83 Linux
/dev/sda2 151,075,260 156,296,384 5,221,125 5 Extended
/dev/sda5 151,075,323 156,296,384 5,221,062 82 Linux swap / Solaris


blkid -c /dev/null: __________________________________________________ __________

sda1: UUID="4971f651-2efa-44a5-8a91-996542fb2fbf" TYPE="ext4"
sda5: UUID="31e1438e-f227-4fa7-b8e8-3d0d0e5c3fdf" TYPE="swap"

=============================== "mount" output: ===============================

aufs on / type aufs (rw)
none on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
/dev/sr0 on /cdrom type iso9660 (rw)
/dev/loop0 on /rofs type squashfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)


=========================== sda1/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=(hd0,1)
search --no-floppy --fs-uuid --set 4971f651-2efa-44a5-8a91-996542fb2fbf
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 ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
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=(hd0,1)
search --no-floppy --fs-uuid --set 4971f651-2efa-44a5-8a91-996542fb2fbf
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4971f651-2efa-44a5-8a91-996542fb2fbf 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=(hd0,1)
search --no-floppy --fs-uuid --set 4971f651-2efa-44a5-8a91-996542fb2fbf
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4971f651-2efa-44a5-8a91-996542fb2fbf 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 ###
if [ ${timeout} != -1 ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### 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 ###

=============================== sda1/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda1 during installation
UUID=4971f651-2efa-44a5-8a91-996542fb2fbf / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=31e1438e-f227-4fa7-b8e8-3d0d0e5c3fdf none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

=================== sda1: Location of files loaded by Grub: ===================


.0GB: boot/grub/core.img
.0GB: boot/grub/grub.cfg
.0GB: boot/initrd.img-2.6.31-14-generic
.0GB: boot/vmlinuz-2.6.31-14-generic
.0GB: initrd.img
.0GB: vmlinuz

presence1960
January 7th, 2010, 04:30 AM
I did some research on that error and the problem seems to be the --no-floppy line in /usr/lib/grub/grub-mkconfig_lib. The solution proposed is to remove the --no-floppy line.

You are going to have to fix it via the Live CD. Boot the Live CD and choose "try ubuntu without any changes...", when the desktop loads open a file browser by going Places > Computer. In the left pane mount your Ubuntu root partition (sda1) by clicking it. Do not use Filesystem as that is the Live CD root partition. Once mounted you will see directories on the right.

Now open a terminal and run
gksu nautilus
Click on the Ubuntu root partition again on the left pane and then navigate to /usr/lib/grub/grub-mkconfig_lib.

Open the grub-mkconfig_lib file. Scroll down to the red line below (it won't be red in your file) and remove ONLY --no-floppy:


# Helper library for grub-mkconfig
# Copyright (C) 2007,2008,2009 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.

transform="s,x,x,"

prefix=/usr
exec_prefix=${prefix}
datarootdir=${prefix}/share
datadir=${datarootdir}
sbindir=${exec_prefix}/sbin
pkgdatadir=${datadir}/`echo grub | sed "${transform}"`

grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`

grub_warn ()
{
echo "Warning: $@" >&2
}

make_system_path_relative_to_its_root ()
{
path=$1
# abort if file doesn't exist
if test -e $path ; then : ;else
return 1
fi

# canonicalize
if path=`readlink -f $path` ; then : ; else
return 1
fi

# if not a directory, climb up to the directory containing it
if test -d $path ; then
dir=$path
else
dir=`echo $path | sed -e "s,/[^/]*$,,g"`
fi

num=`stat -c %d $dir`

# this loop sets $dir to the root directory of the filesystem we're inspecting
while : ; do
parent=`readlink -f $dir/..`
if [ "x`stat -c %d $parent`" = "x$num" ] ; then : ; else
# $parent is another filesystem; we found it.
break
fi
if [ "x$dir" = "x/" ] ; then
# / is our root.
break
fi
dir=$parent
done

# This function never prints trailing slashes (so that its output can be
# appended a slash unconditionally). Each slash in $dir is considered a
# preceding slash, and therefore the root directory is an empty string.
if [ "$dir" = "/" ] ; then
dir=""
fi

# XXX: This fails if $dir contains ','.
path=`echo "$path" | sed -e "s,^$dir,,g"` || return 1

case "`uname 2>/dev/null`" in
CYGWIN*)
# Cygwin: Check if regular or emulated mount.
if [ -z "$dir" ] || [ "`stat -c %D "$dir/.."`" != 620000 ] ; then
# Reached some mount point not below /cygdrive.
# GRUB does not know Cygwin's emulated mounts,
# convert to Win32 path and remove drive letter.
path=`cygpath -m "$path" | sed -n 's,^[A-Za-z]:,,p'`
test ! -z "$path" || return 1
fi ;;
esac

echo "$path"
}

is_path_readable_by_grub ()
{
path=$1

# abort if path doesn't exist
if test -e $path ; then : ;else
return 1
fi

# abort if file is in a filesystem we can't read
if ${grub_probe} -t fs $path > /dev/null 2>&1 ; then : ; else
return 1
fi

return 0
}

convert_system_path_to_grub_path ()
{
path=$1

grub_warn "convert_system_path_to_grub_path() is deprecated. Use prepare_grub_to_access_device() instead."

# abort if GRUB can't access the path
if is_path_readable_by_grub ${path} ; then : ; else
return 1
fi

if drive=`${grub_probe} -t drive $path` ; then : ; else
return 1
fi

if relative_path=`make_system_path_relative_to_its_ro ot $path` ; then : ; else
return 1
fi

echo ${drive}${relative_path}
}

save_default_entry ()
{
if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then
echo 'saved_entry=${chosen}'
echo 'save_env saved_entry'
fi
}

prepare_grub_to_access_device ()
{
device=$1

loop_file=
case ${device} in
/dev/loop/*|/dev/loop[0-9])
loop_file=`losetup ${device} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
case $loop_file in
/dev/*) ;;
*)
loop_device=${device}
device=`${grub_probe} --target=device "${loop_file}"`
;;
esac
;;
esac

# Abstraction modules aren't auto-loaded.
abstraction="`${grub_probe} --device ${device} --target=abstraction`"
for module in ${abstraction} ; do
echo "insmod ${module}"
done

fs="`${grub_probe} --device ${device} --target=fs`"
for module in ${fs} ; do
echo "insmod ${module}"
done

# If there's a filesystem UUID that GRUB is capable of identifying, use it;
# otherwise set root as per value in device.map.
echo "set root=`${grub_probe} --device ${device} --target=drive`"
if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then
echo "search --no-floppy --fs-uuid --set ${fs_uuid}"
fi

if [ "x${loop_file}" != x ]; then
loop_mountpoint="$(awk '"'${loop_file}'" ~ "^"$2 && $2 != "/" { print $2 }' /proc/mounts | tail -n1)"
if [ "x${loop_mountpoint}" != x ]; then
echo "loopback loop0 ${loop_file#$loop_mountpoint}"
echo "set root=(loop0)"
fi
fi
}

grub_file_is_not_garbage ()
{
if test -f "$1" ; then
case "$1" in
*.dpkg-*) return 1 ;; # debian dpkg
esac
else
return 1
fi
return 0
}

version_test_numeric ()
{
local a=$1
local cmp=$2
local b=$3
if [ "$a" = "$b" ] ; then
case $cmp in
ge|eq|le) return 0 ;;
gt|lt) return 1 ;;
esac
fi
if [ "$cmp" = "lt" ] ; then
c=$a
a=$b
b=$c
fi
if (echo $a ; echo $b) | sort -n | head -n 1 | grep -qx $b ; then
return 0
else
return 1
fi
}

version_test_gt ()
{
local a=`echo $1 | sed -e "s/[^-]*-//;s/[._-]\(pre\|rc\|test\|git\|old\)/~\1/g"`
local b=`echo $2 | sed -e "s/[^-]*-//;s/[._-]\(pre\|rc\|test\|git\|old\)/~\1/g"`
local cmp=gt
if [ "x$b" = "x" ] ; then
return 0
fi
case $a:$b in
*.old:*.old) ;;
*.old:*) a=`echo -n $a | sed -e s/\.old$//` ; cmp=gt ;;
*:*.old) b=`echo -n $b | sed -e s/\.old$//` ; cmp=ge ;;
esac
dpkg --compare-versions "$a" $cmp "$b"
return $?
}

version_find_latest ()
{
local a=""
for i in $@ ; do
if version_test_gt "$i" "$a" ; then
a="$i"
fi
done
echo "$a"
}

After removing --no-floppy ONLY click Save on top toolbar & close file. Close both file browsers and reboot without the Live CD.

When the GRUB menu comes up select the Ubuntu kernel and hit "e" to edit. Use your arrow keys to navigate to the --no-floppy line and remove ONLY that. Then hit Ctrl + x to boot. Once into ubuntu open a terminal and run
sudo update-grub
This will make the change you made from the Live CD a permanent part of grub.cfg

centaure
January 7th, 2010, 05:11 AM
I am not sure if u r running wubi on windows etc, but if u r, this may help:

Re: Wubi 9.10 + upgrade ubuntu = sh:grub>
I had the same problem after performing a ubuntu update today. I am running wubi on Windows 7.

Once you login to windows, performing the following should suffice (from https://bugs.launchpad.net/ubuntu/+source/lupin/+bug/477169?comments=all) (https://bugs.launchpad.net/ubuntu/+source/lupin/+bug/477169?comments=all%29;) :-

**(note that in my case, I did not need to perform the steps indicated in B) below )

Agostino Russo (https://launchpad.net/%7Eago) wrote on 2009-12-23: #210 (https://bugs.launchpad.net/ubuntu/+source/lupin/+bug/477169/comments/210) For a patch/workaround:
A) get the wubildr in https://bugs.edge.launchpad.net/ubun...04/comments/90 (https://bugs.edge.launchpad.net/ubuntu/+source/grub2/+bug/477104/comments/90) and copy it over C:\wubildr
B) ensure that when you boot there is no command "insmod ntfs". Press "e" at the grub boot menu to edit the relevant entry and remove "insmod ntfs" before proceeding
New ubuntu/wubi installations do not contain the patch yet. The patch will only be applied once there is a clear confirmation (from you) that it actually solves the problem. Hence your feedback is appreciated.
Last edited by centaure (http://ubuntuforums.org/posthistory.php?p=8622749); 1 Hour Ago at 10:07 PM..

presence1960
January 7th, 2010, 05:16 AM
I am not sure if u r running wubi on windows etc, but if u r, this may help:

Re: Wubi 9.10 + upgrade ubuntu = sh:grub>
I had the same problem after performing a ubuntu update today. I am running wubi on Windows 7.

Once you login to windows, performing the following should suffice (from https://bugs.launchpad.net/ubuntu/+source/lupin/+bug/477169?comments=all) (https://bugs.launchpad.net/ubuntu/+source/lupin/+bug/477169?comments=all%29;) :-

**(note that in my case, I did not need to perform the steps indicated in B) below )

Agostino Russo (https://launchpad.net/%7Eago) wrote on 2009-12-23: #210 (https://bugs.launchpad.net/ubuntu/+source/lupin/+bug/477169/comments/210) For a patch/workaround:
A) get the wubildr in https://bugs.edge.launchpad.net/ubun...04/comments/90 (https://bugs.edge.launchpad.net/ubuntu/+source/grub2/+bug/477104/comments/90) and copy it over C:\wubildr
B) ensure that when you boot there is no command "insmod ntfs". Press "e" at the grub boot menu to edit the relevant entry and remove "insmod ntfs" before proceeding
New ubuntu/wubi installations do not contain the patch yet. The patch will only be applied once there is a clear confirmation (from you) that it actually solves the problem. Hence your feedback is appreciated.
Last edited by centaure (http://ubuntuforums.org/posthistory.php?p=8622749); 1 Hour Ago at 10:07 PM..

The OP is not running wubi, I guess you need to go over the results of the script output that are posted in post #4. The OP does not even have windows on the machine!

presence1960
January 7th, 2010, 06:10 AM
centaure I want to apologize for the way I said things in my last post. What I meant to say is you can see what the OP has on his machine by reading the output from the boot info script, which will show he/she doesn't have wubi or windows. If you need help understanding what that output means I would be glad to help. The boot info script is a great tool for diagnosing setup & boot problems. I suggest running it and looking at your results since you know how your rig is setup. It can be a great learning tool also.

hcker2000
January 8th, 2010, 06:56 PM
Just fyi this does not fix the issue. Once I am home I can post the only fix I can get to work and its only a temp fix tell there is a new kernal and then grub updates and breaks it.

presence1960
January 8th, 2010, 07:02 PM
Just fyi this does not fix the issue. Once I am home I can post the only fix I can get to work and its only a temp fix tell there is a new kernal and then grub updates and breaks it.

Sorry it did not work. I researched your problem and that is the only fix I could find. Maybe someone else knows a fix for this.

Wavvver334
January 8th, 2010, 07:05 PM
Hcker2000 I had somewhat of the same problem. Mine started once i installed the new grub update. Every time I install it, it effs up my pc. So i just didn't install it and just reloaded linux and had to start over.

hcker2000
January 10th, 2010, 06:01 AM
Here is the fix that works for me. Who ever decided on grub 2 for ubuntu didn't check into this very well.

/boot/grub/grub.cfg

Original:


menuentry "Ubuntu, Linux 2.6.31-17-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,1)
search --fs-uuid --set 4971f651-2efa-44a5-8a91-996542fb2fbf
linux /boot/vmlinuz-2.6.31-17-generic root=UUID=4971f651-2efa-44a5-8a91-996542fb2fbf ro quiet splash
initrd /boot/initrd.img-2.6.31-17-generic


Changed:


menuentry "Ubuntu, Linux 2.6.31-17-generic" {
set root=(hd0,1)
linux /boot/vmlinuz-2.6.31-17-generic root=UUID=4971f651-2efa-44a5-8a91-996542fb2fbf ro quiet splash
initrd /boot/initrd.img-2.6.31-17-generic