2

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
psp
  • 3,033
  • 3
  • 14
  • 14
  • I've run debian rescue mode and looked through the `syslog`. I see _hundreds_ of entries like this I'll write this in the main question – psp Jun 30 '11 at 22:53
  • 1
    Those syslog entries make it look very much like a bad hard drive. I suggest replacing it ASAP, and hope you can recover some data from it, if it's not too late. – Flimzy Jun 30 '11 at 23:15
  • @Flimzy How would I go about recovering data from it? Any tips. (Also, I just heard some clicking sounds from the server) – psp Jun 30 '11 at 23:20
  • 1
    That deserves a separate question. And clicking sounds are a sure sign of a failing hard drive. – Flimzy Jun 30 '11 at 23:22
  • Well I think the sounds were coming from a fan, rather than then HDD. – psp Jun 30 '11 at 23:26
  • It sound that your HDD is not ready for I/O operation, is fsck can help ? – Ali Mezgani Jul 01 '11 at 11:19

3 Answers3

2

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.

Flimzy
  • 2,375
  • 17
  • 26
  • The server has been working for months. It's just today that it decided not to boot. – psp Jun 30 '11 at 21:17
  • Does that mean when you tried the above suggestion it didn't work? Or does it mean you're not going to try it? Just because the server has been working properly for months doesn't mean it hasn't changed in that time. If you follow security updates, then you probably have changes every day or two. If you just follow official releases, then you're on 6.0.2 as of June 25. It's quite possible you could have installed a new version of GRUB, and that doing so might have confused something--especially if you have a fragile configuration as described in that thread I linked above. – Flimzy Jun 30 '11 at 21:19
  • I'm booting into the rescue CD now to try it. – psp Jun 30 '11 at 21:21
  • Also, if your server is like most of mine, it runs for months without rebooting. So a rebooting problem could have crept up any time in the last 90-500 days, and I wouldn't know, because I reboot so rarely. – Flimzy Jun 30 '11 at 21:22
  • Yep. I haven't rebooted it in ~60 days. – psp Jun 30 '11 at 21:23
  • If my suggestion doesn't work, it would be nice if you could provide some more info in your question. Like your partition layout (output of the 'p' command in fdisk), as well as your /etc/fstab file, and anything else you think might be relevant. – Flimzy Jun 30 '11 at 21:25
  • @Flimzy I'll do that right away. – psp Jun 30 '11 at 21:26
  • When loading the Debian CD, I chose the 'Live' option and then it threw this error: `ata3: SRST failed (errno=-16)` It then said `ata3: reset failed, giving up` – psp Jun 30 '11 at 21:27
  • @psp let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/678/discussion-between-flimzy-and-psp) – Flimzy Jun 30 '11 at 21:27
  • Sorry, chat isn't working for me for some reason. Google suggests the `SRST failed` messages occur for various boot delay problems, but usually the boot succeeds. I wonder if your hard drive might be failing, though. – Flimzy Jun 30 '11 at 21:33
  • I've added the FSTAB file above. I've also wondered if the drive is failing. – psp Jun 30 '11 at 21:35
  • I've found some entries in the log which may be of help. Added to main question. – psp Jun 30 '11 at 23:00
1

Well i've write an article about how to repair grub loader here I think that it is helpful in your situation

Ali Mezgani
  • 3,810
  • 2
  • 23
  • 36
  • When I do `sudo /sbin/fdisk -l`, nothing returns. I just get a new prompt. Something is _really_ wrong I feel. – psp Jun 30 '11 at 21:57
  • I've added some entries from 'syslog' to the main question which may be some help. – psp Jun 30 '11 at 23:01
0

Most likely your MBR which includes the master partition table has been (partially) corrupted. I would interpret that grub error message as that a record in the partition table points to a region which is outside of the drive (msdos just means the type of the partitioning). Another possibility could be that something has changed in the BIOS settings that affected the drive geometry (number of heds, cyls, tracks and sectors). Have you checked that the battery on the moverboard that feeds CMOS is okay?

s_i_m
  • 1