Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question
    
I've run debian rescue mode and looked through the syslog. I see hundreds of entries like this <EDIT> 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

3 Answers 3

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.

share|improve this answer
    
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

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

share|improve this answer
    
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

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?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.