Debian boot problems

bootdebiangrub

I've got Debian server with one disk. No dual boot or anything fancy. Just Debian 6.0 (Squeeze).

I rebooted the server today and now it doesn't boot. I get the following (from GRUB):

error: hd0,msdos out of disk

I then get a grub prompt grub rescue>

I've been googling for ages with no luck.

/etc/fstab

> #/etc/fstab: static file system information.
> #
> # <file system> <mount point> <type> <options> <dump> <pass> 
> aufs / aufs rw 0 0 
> tmpfs /tmp tmpfs nosuid,nodev 0 0

I've run debian rescue mode and looked through the syslog. I see hundreds of entries like this:

Jun 30 22:51:08 kernel: [  615.217382] sd 2:0:0:0: [sda] Unhandled error code
Jun 30 22:51:08 kernel: [  615.217385] sd 2:0:0:0: [sda] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jun 30 22:51:08 kernel: [  615.217389] sd 2:0:0:0: [sda] CDB: Read(10): 28 00 00 00 00 00 00 00 08 00
Jun 30 22:51:08 kernel: [  615.217399] end_request: I/O error, dev sda, logical block 0
Jun 30 22:51:08 kernel: [  615.217402] Buffer I/O error on device sda, logical block 0

Best Answer

I've never dealt with that error before, but this thread addresses one likely cause of the error. It suggests you may have installed GRUB to a partition, rather than to the MBR, and to fix booting from the installation CD in rescue mode, then doing:

sudo mount /dev/sda1 /mnt
sudo grub-install --root-directory=/mnt /dev/sda

Of course replace /dev/sda1 and /dev/sda with their proper equivalents on your system.