D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Grub Error 17

 

On Tue, 22 Nov 2011, Peter Lloyd-Jones wrote:

Hi

My back up computer appears to have packed up!

There is so much advice on the net that I do not really know where to start.

I "think" I have a faulty hard disk.

I suppose I want to get to the hard drive and fdisk it?

I'd start by seeing if its detected in the BIOS - sounds like it is though, so next step would be to boot it off a rescue CD. Once the system is booted, then you can see if the drive is online - use whatever facilities the rescue CD provides, but from the command-line, you might want to look at the output of 'dmesg', then you can run

  fdisk -l

to see if the disk and it's partitions are detected by the kernel.

Checking the SMART data might be prudent too

  smartctl -a /dev/sda

and check for errors, reallocated sectors and so on.

At that point, what to do "depends".. More on you and your experience than anything else - what I'd do is start to run badblocks on each partition (I almost always use multiple partitions on my systems, but others and most distros don't these days, but the output from fdisk -l will help). e.g.

  badblocks -c 256 -s /dev/sda1
  badblocks -c 256 -s /dev/sda2
etc.

If the badblocks scans are OK, then run badblocks on the whole disk (which will include the boot sector - e.g.

  badblocks -c 256 -s /dev/sda

You only need to let it run for a few moments, assuming the badblocks scans on the partitions were OK.

After that, well who knows. It depends on how bad the disk is and how desperate you are to recover any data on it.

Personally, if the disk has lots of bad sectors and is showing poorly in the output of smartctl I'd just junk it at that point and get a new drive and rebuild the system from backups, etc.

I don't use GRUB, but a bit of googling suggests that error 17 means that the partition table is screwed - probably as a result of a bad sector more than a real data corruption - does it make any funny clunking noises after you power it on? You may be able to re-create the partition table without losing any data - assuming you kept a note of what it looked like at system build time - writing a new partition table might force the disk to re-allocate the sector if you're lucky, but if the disk is doing that then it's starting to show signs of deterioration and ought to be replaced anyway. (IMO)

Finally - as this is a backup PC with (presumably) no data that needs recovering you might just be better off getting a new drive and building it from scratch again, but it all depends on how much time you have (and how much you value your own time) as well as experience... Or you could view it as a learning experience if you're nothing to lose but your own time!

Gordon

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq