View Full Version : [ubuntu] GRUB doesn't recognize new HDD

March 13th, 2010, 05:40 AM
I just got a larger hard drive for my laptop. After installing it, I ran my Ubuntu 9.10 install disc and installed with no problems. After removing the CD and rebooting, I get the error message "No such device" referring to the hard drive. I replaced the CD and started the LiveCD. The hard disk mounts fine and contains all the filesystem from the fresh install. I searched the forums a bit and found the "boot info script" and ran it. Here are the results:

Boot Info Script 0.55 dated February 15th, 2010

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

=> Grub 2 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: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xe959e959

Partition Boot Start End Size Id System

/dev/sda1 * 63 622,149,254 622,149,192 83 Linux
/dev/sda2 622,149,255 625,137,344 2,988,090 5 Extended
/dev/sda5 622,149,318 625,137,344 2,988,027 82 Linux swap / Solaris

blkid -c /dev/null: __________________________________________________ __________


/dev/loop0 squashfs
/dev/ramzswap0 swap
/dev/sda1 f15dbecb-96a5-4655-ac02-e2dfcf8b63c0 ext4
/dev/sda5 09c98c4a-8709-43ff-9d3e-dbbc3329b61b swap

============================ "mount | grep ^/dev output: ===========================

Device Mount_Point Type Options

aufs / aufs (rw)
/dev/sr0 /cdrom iso9660 (rw)
/dev/loop0 /rofs squashfs (rw)

=========================== sda1/boot/grub/grub.cfg: ===========================

# 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
set default="0"
if [ ${prev_saved_entry} ]; then
save_env saved_entry
save_env prev_saved_entry
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set f15dbecb-96a5-4655-ac02-e2dfcf8b63c0
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
if [ ${recordfail} = 1 ]; then
set timeout=-1
set timeout=10
### 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" {
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set f15dbecb-96a5-4655-ac02-e2dfcf8b63c0
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=f15dbecb-96a5-4655-ac02-e2dfcf8b63c0 ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set f15dbecb-96a5-4655-ac02-e2dfcf8b63c0
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=f15dbecb-96a5-4655-ac02-e2dfcf8b63c0 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
set timeout=0
if sleep --interruptible 3 ; then
set timeout=0
### 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=f15dbecb-96a5-4655-ac02-e2dfcf8b63c0 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=09c98c4a-8709-43ff-9d3e-dbbc3329b61b none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

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

45.7GB: boot/grub/core.img
45.7GB: boot/grub/grub.cfg
.5GB: boot/initrd.img-2.6.31-14-generic
.5GB: boot/vmlinuz-2.6.31-14-generic
.5GB: initrd.img
.5GB: vmlinuzWhat did I do wrong and how do I fix it?

March 14th, 2010, 12:15 PM

March 14th, 2010, 12:23 PM

March 14th, 2010, 12:35 PM
Hmmm, most odd - it looks okay to me :-\

Assuming that you do have the Hard-Disk set up in your BIOS as a boot device. I can only really suggest re-installing grub.

Boot from your cd, then

sudo fdisk -l That is a little L not a number one.

It will show that /dev/sda1 is the boot area (the *) and also that it is file-type 83

Having confirmed that

sudo mkdir /media/sda1
sudo mount /dev/sda1 /media/sda1

Which gets sda1 ready for the re-installation, followed by

sudo grub-install --root-directory=/media/sda1 /dev/sda

That should get it back for you.
(Those are customised instructions from http://ubuntuforums.org/showthread.php?t=1014708 )

If that still does not work, there is another way that works for if a drive has just gotten plain confused.

That method is a bit too long for me re-type, but if you pop over to http://forum.phillw.net/viewtopic.php?f=4&t=35 it has it in detail - You'll be using /dev/sda1, and not dev/sdb1 as in that example.

That one is the work of several people to get it running and tidied up - We know it works !!



March 15th, 2010, 01:48 AM
Thanks for the replies. Unfortunately, the owner of the laptop has convinced herself that it is a hardware problem and has returned her new HDD to the vendor, so I didn't get the chance to try to fix it... :rolleyes:

At least she didn't blame it on Linux in general. :D