[RndTbl] I/O error with dd

wyatt at prairieturtle.ca wyatt at prairieturtle.ca
Tue Dec 18 21:44:26 CST 2007

Dan Martin writes:

> I back up my entire system, including Windows, by copying the entire 
> contents of one drive to another using the dd command (boot to Linux 
> rescue DVD).  I have bays that allow me to remove the drives, and after 
> copying father to son I use the son.
> During the last backup I had an input error part way through a 100 GB 
> vfat partition.  I completed the backup using conv=noerror, and recorded 
> the record number (1MB records).  The father drive, containing the 
> error, is a brand new drive.
> A windows check of the partition does not reveal any problems.
> Presumably, I have a corrupt file on the father, which could be restored 
> from the grandfather.  Is there any way I can find which files are on 
> the effected part of the drive?
> -- 
>   -Dan
> Dr. Dan Martin, MD, CCFP, BSc, BCSc (Hon), MSc
> GP Hospital Practitioner
> ummar143 at shaw.ca
> (204) 831-1746
> answering machine always on

I don't know of any way under Linux to directly determine which file 
contains a given block on a vfat partition. I do see your quandary though: 
the file must be found and restored from the grandfather to the son so the 
corrupt file doesn't keep getting carried forward on the next backup cycle.

The only notion that floated through my head was using other tools under 
Linux to find the affected file. Will require some script writing and it 
will only work if the read error is reproducible. You might want to check 
that using `dd' with the block number against the father and make sure it is 
a hard error. The process would be

1) Mount the father vfat partition Linux.

2) Use the `find' command to get a list of all files and directories on the 
father disk. If the error doesn't reproduce this procedure is useless.

3) Loop through all the files and `cat' them each to /dev/null. When an 
error occurs, print the path of the file on the console.

4) Mount up the grandfather and the son and copy the affect file from the 
grandfather to the son.

5) Throw away the son. It can't be used for `dd' safely.

If the bad block is in a directory, it should cause all files in the 
directory a `cat' error. But if there is only one file in the directory, 
beware, it may take more prodding to determine if the file is bad or the 
directory is bad.

It's a brute force approach that's for sure. Hoping someone else on the list 
has a real tool. The best would probably be one that runs on DOS or Windows. 
I'm thinking way back to the Norton disk utility. It was good for locating 
bad sectors and determining which file was mangled.

Daryl Fonseca-Holt

More information about the Roundtable mailing list