2

I am running ubuntu 10.10 as my host with Windows 7 as the guest. About a couple weeks ago I started getting error pop-ups from vmware reporting inability to read or write to a particular file.

On futher investigation, I've noticed that I cannot copy that particular file from the linux command line even as root. I get the same input/output error.

The SMART utility tells me I have 69 bad sectors on the disk (it is 1 TB)

So my question is 1) How do I tell if that HD is going bad? 2) How can I move the VM files to a different part of the disk if I get read/write errors when I try to copy?

2 Answers 2

0

I have had good experience running SpinRite when I run into bad sectors. It does an excellent job of finding (and in a lot of cases fixing) bad sectors on a HDD. Sometimes it can take a long time (over a day) if the drive is in really bad shape but bear with it.

If you get a read error on a drive it's best to get a new one given how cheap they are. If you don't plan on doing that make sure you have good backups. :-)

3
  • So what to do if I try to backup but I get IO errors on certain files? Is there a way to tell the app to ignore IO errors and copy what it can?
    – CShipley
    Jan 12, 2011 at 21:34
  • I think most backup apps can continue and report an error. I know rsync does (with the --ignore-errors flag) but you should try it and see what happens. Jan 13, 2011 at 20:06
  • @CShipley for large files which sit on bad sectores, try dd bs=1 if=file conf=noerror,sync of=/path/to/backup/file, This will try to copy the file byte for byte and any erroniuos bytes will be replaced with a NULL char
    – Josh
    Jan 14, 2011 at 12:56
0

I'd say replace the drive. Drives are cheap. Data is not. If you're already lost some data on the drive then in my opinion it's time for a new drive. I wouldn't trust it, even after using a utility like Scott suggested. WHat if the drive is failing and such a utility buys you some time and false confidence, and the drive totally fails in the near future.

Now may also be a good time to think about RAID.

EDIT: Now that this is a SuperUser question and not a ServerFault question, my answer doesn't apply as nicely. For a server you want top of the line hardware, and if it might be failing replace it now. You may have a bit more leeway with a desktop or personal system. However data loss is still data loss, so I will say this: If you decide to keep using the drive, back it up right now and back it up very frequently as there is a very good likelihood that the drive will fail soon, based on the symptoms you're seeing.

You may want to try reformatting the drive and passing the -c switch to it twice. This will run the badblocks program in read-write mode and will find bad blocks, and map them so that no data will be stored there:

mkfs.ext3 -cc /dev/something

Where /dev/something is the dev entry for this partition, E.G. /dev/sdb1.

2
  • Now, I'm advising you from a syadmin point of view. If you were asking on SuperUser I might have different advice but considering this is a server, my advice is use the best hardware you can, and this drive no longer appears to be the best.
    – Josh
    Jan 14, 2011 at 12:51
  • Bah, now this question is on SuperUser and my sysadmin advice no longer applies!
    – Josh
    Jan 14, 2011 at 15:38

You must log in to answer this question.