0

I've had this issue before when trying out Linux Mint, but I was unable to get any assistance. I was then lead to believe that it was a problem related to Mint, and not grub.

I installed Ubuntu 12.04 tonight on a second partition alongside Windows 7. I installed from a USB stick, and everything went peachy until I rebooted without the stick in my tower. It now says:

error: no such device: 20cec6ca-4024-4237-84c3-2dba3c851497
grub rescue >

I've verified via ls -l /dev/disk/by-uuid that my drive where Ubuntu is installed matches the UUID that supposedly doesn't exist. The UUID of my thumb drive when inserted happens to be 06B3-9C68.

There is no mention of my USB drive's UUID anywhere in /boot/grub/grub.cfg

I've also tried to re-install GRUB after booting into my system, removing the stick, and running grub-install /dev/sda. It still happens, and I cannot boot without the USB drive inserted into the computer. And what really gets my goat is that the boot order of my system is CDROM>Hard Drive>USB. It's not even reaching the USB to try to boot from it, so why does it matter that it's not there?

Edit: Also, I ran grub-config without the stick in followed by another grub-install. Still no go.

FWIW, here's my grub.cfg file:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by 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
  set have_grubenv=true
  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
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd1,msdos5)'
search --no-floppy --fs-uuid --set=root 20cec6ca-4024-4237-84c3-d2ba3c851497
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd1,msdos5)'
  search --no-floppy --fs-uuid --set=root 20cec6ca-4024-4237-84c3-d2ba3c851497
  set locale_dir=($root)/boot/grub/locale
  set lang=en_CA
  insmod gettext
fi
terminal_output gfxterm
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
if background_color 44,0,30; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
    set gfxpayload="$1"
    if [ "$1" = "keep" ]; then
        set vt_handoff=vt.handoff=7
    else
        set vt_handoff=
    fi
}
if [ ${recordfail} != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
    set linux_gfx_mode=keep
      else
    set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 3.2.0-25-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    gfxmode $linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos5)'
    search --no-floppy --fs-uuid --set=root 20cec6ca-4024-4237-84c3-d2ba3c851497
    linux   /boot/vmlinuz-3.2.0-25-generic-pae root=UUID=20cec6ca-4024-4237-84c3-d2ba3c851497 ro   quiet splash $vt_handoff
    initrd  /boot/initrd.img-3.2.0-25-generic-pae
}
menuentry 'Ubuntu, with Linux 3.2.0-25-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos5)'
    search --no-floppy --fs-uuid --set=root 20cec6ca-4024-4237-84c3-d2ba3c851497
    echo    'Loading Linux 3.2.0-25-generic-pae ...'
    linux   /boot/vmlinuz-3.2.0-25-generic-pae root=UUID=20cec6ca-4024-4237-84c3-d2ba3c851497 ro recovery nomodeset 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-3.2.0-25-generic-pae
}
submenu "Previous Linux versions" {
menuentry 'Ubuntu, with Linux 3.2.0-23-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    gfxmode $linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos5)'
    search --no-floppy --fs-uuid --set=root 20cec6ca-4024-4237-84c3-d2ba3c851497
    linux   /boot/vmlinuz-3.2.0-23-generic-pae root=UUID=20cec6ca-4024-4237-84c3-d2ba3c851497 ro   quiet splash $vt_handoff
    initrd  /boot/initrd.img-3.2.0-23-generic-pae
}
menuentry 'Ubuntu, with Linux 3.2.0-23-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos5)'
    search --no-floppy --fs-uuid --set=root 20cec6ca-4024-4237-84c3-d2ba3c851497
    echo    'Loading Linux 3.2.0-23-generic-pae ...'
    linux   /boot/vmlinuz-3.2.0-23-generic-pae root=UUID=20cec6ca-4024-4237-84c3-d2ba3c851497 ro recovery nomodeset 
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initrd.img-3.2.0-23-generic-pae
}
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos5)'
    search --no-floppy --fs-uuid --set=root 20cec6ca-4024-4237-84c3-d2ba3c851497
    linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_msdos
    insmod ext2
    set root='(hd1,msdos5)'
    search --no-floppy --fs-uuid --set=root 20cec6ca-4024-4237-84c3-d2ba3c851497
    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/sda1)" --class windows --class os {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root 9014706714705268
    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 ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

2 Answers2

2

Your problem seems to be the hd1 appearing in your grub.cfg. For a single disk system I'd expect that should be hd0. Assuming your UUIDs are correct, boot up with the stick, change the permissions on /boot/grub/grub.cfg to include w (sudo chmod +w grub.cfg), edit the file (sudo vi grub.cfg) and change every hd1 to hd0. save it, shutdown, remove the stick and reboot. At the grub menu, you may check the disks available -- enter c for the grub command line, then type "set root=" then tab for autocompletion. Multiple choices will be offered if available, but if only hd0 is available, it will be filled in to "set root=hd0," another tab will offer the partition choices, which should include the ones you want. Maybe the fix of editing the hd1 to hd0 would work directly from the grub menu, type e to edit, and change the hd1 s then F10 (or ctrl X)to reboot. If that works, fix things permanently with sudo update-grub.

ubfan1
  • 17,838
1

Your bootloader seems to be pointing to the address where your USD drive was at the time of the installation.

I've had to deal with this in the past, and was able to fix the problem by using:

Boot-Repair

Boot-Repair is a simple tool to repair frequent boot issues you may encounter in Ubuntu like when you can't boot Ubuntu after installing Windows or another Linux distribution, or when you can't boot Windows after installing Ubuntu, or when GRUB is not displayed anymore, some upgrade breaks GRUB, etc.


Another method that I've used to fix this type of situations, was by using Super Grub2 Disk to allow me to boot inside the Linux partition, and then use the administrative tools to fix my boot loader:

Super Grub2 Disk

The primary purpose of Super GRUB2 Disk is to help you boot into an OS whose bootloader is broken.

Zuul
  • 1,974
  • I don't get it though - If these are just tools to let you boot a system when the bootloader isn't working, why can't I just use grub-install again once I'm in by using the USB stick? – agent154 Jun 23 '12 at 18:16
  • Boot your Ubuntu installation via USB stick, then install & run Boot-Repair. – fleamour Jan 23 '13 at 15:43