8

I'm very new to terminal and Linux. I have a crashed external hard drive that is spinning but won't appear on the desktop. I ran safecopy from terminal and this is what it said at the end

Description of output:
. : Between 1 and 1024 blocks successfully read.
_ : Read of block was incomplete. (possibly end of file)
    The blocksize is now reduced to read the rest.
|/| : Seek failed, source can only be read sequentially.
> : Read failed, reducing blocksize to read partial data.
! : A low level error on read attempt of smallest allowed size
    leads to a retry attempt.
[xx](+yy){ : Current block and number of bytes continuously
             read successfully up to this point.
X : Read failed on a block with minimum blocksize and is skipped.
    Unrecoverable error, destination file is padded with zeros.
    Data is now skipped until end of the unreadable area is reached.
< : Successful read after the end of a bad area causes
    backtracking with smaller blocksizes to search for the first
    readable data.
}[xx](+yy) : current block and number of bytes of recent
             continuous unreadable data.

I don't know what to do next. Is it telling me that it cannot be resurrected or is it telling me that it is waiting for me to do something?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
francis
  • 81

3 Answers3

10

I'd like to kindly point out that Daniel's answer is incorrect. The stage#.badblocks files tell safecopy which blocks are bad on the source. Empty files would tell safecopy that there are no damaged blocks.

Anyway, the standard procedure is:

safecopy --stage1 /dev/source output.img

which will copy the entire source and mark the bad blocks in stage1.badblocks. At this point, any data that is readable will be saved (ie. the data won't be corrupted any further).

safecopy --stage2 /dev/source output.img

which will try reading the bad blocks marked in stage1.badblocks with no retries and then mark the exact boundaries of the bad areas in stage2.badblocks.

safecopy --stage3 /dev/source output.img

which will continuously retry to read the bad areas marked in stage3.badblocks.

Note that later stages can take an incredibly long time to complete if the previous stages were not run.

  • After the image is made, how do you mount/open/view it? Since the image is of the entire file system, and not just a partition, I am having trouble using it. – Nate Oct 27 '14 at 15:19
  • I use testdisk for an interactive session or foremost ofr an automated recovery of files. – EnzoR Oct 06 '16 at 10:11
3

You ran safecopy without any options, so it printed out usage information. You need to give it options so it knows what to do, man safecopy will show you the manual, like this one. One possible combination would be

safecopy --stage3 source dest

Where source is your broken drive, and dest is where to copy the rescue data to.

invert
  • 1,763
-2

It seems to require you to create the file to write to first. So run touch stage1.badblocks in the folder you're going to back up to. Then run safecopy --stage1 /dev/source /media/otherdrive/stage1.badblocks and it will run the first stage. After that repeat this step with making the next file touch stage2.badblocks... run the same code with 2 instead of one. Then do the same for the third stage... swap the numbers out with 3.

    touch stage1.badblocks
    safecopy --stage1 /dev/source /media/otherdrive/stage1.badblocks

    touch stage2.badblocks
    safecopy --stage2 /dev/source /media/otherdrive/stage2.badblocks

    touch stage3.badblocks
    safecopy --stage1 /dev/source /media/otherdrive/stage3.badblocks
Renan
  • 17,136