1

It may seem like a simple question but even the manual doesn't seem to address it. The rescue completes with 24 bad areas. I access the target drive but it says "Folder is Empty". Presumably the ddrescue operation produces something that can be used to determine the content of the original drive, but what? What do I do with the target? Have I just wasted 2 days waiting for this process to complete?

I only rescued the primary partition of the 500GB source drive which is supposedly in ext4 format to a 1TB target drive also in ext4. I had assumed that the result would be a partition with readable files or an *.img file or something. But I'm not sure what to do with, uhh.... nothing.

OK, as per request this is the command line I used to evoke ddrescue:

sudo ddrescue -d -r3 -f /dev/sdn4 /dev/sdk rescueupdata.log

/dev/sdk is a 1TB ssd that I just purchased and has never been used.

I had done a copy of the terminal output to clipboard, but got distracted and didn't realize that I hadn't copied it into a document. I do remember that there were 24 bad areas left after completion of 3 attempts, and I do have the mapfile. Here are the contents of that. Sorry that the result doesn't seem to be formatted in a very friendly way, but I don't really know how to use this forum's editor. It just does what it wants to.

Also, I should mention that I'm running gpart to see if it can recover a files structure on the target disk. This might take awhile, but it seemed intuitively to be the right next move. Anyway, here's the mapfile:

Mapfile. Created by GNU ddrescue version 1.23
# Command line: ddrescue -d -r3 -f /dev/sdn4 /dev/sdk rescueupdata.log
# Start time:   2021-11-10 18:39:56
# Current time: 2021-11-12 15:38:16
# Finished
# current_pos  current_status  current_pass 0x6B0B5D6000     +               3
#      pos        size  status 0x00000000  0x201370C200  + 0x201370C200  0x00000200  - 0x201370C400  0xF1CC84A00  + 0x2F30390E00  0x00000200  - 0x2F30391000  0x138B31C00  + 0x3068EC2C00  0x00000200  - 0x3068EC2E00  0x1FB989200  + 0x326484C000  0x00000200  - 0x326484C200  0x00000C00  + 0x326484CE00  0x00000200  - 0x326484D000  0x3C3F67000  + 0x36287B4000  0x00000200  - 0x36287B4200  0x27F80000  + 0x3650734200  0x00000200  - 0x3650734400  0x2A4F2F600  + 0x38F5663A00  0x00000200  - 0x38F5663C00  0x8C39DE00  + 0x3981A01A00  0x00000200  - 0x3981A01C00  0x441A79E00  + 0x3DC347BA00  0x00000200  - 0x3DC347BC00  0x35B9B9400 
+ 0x411EE35000  0x00000200  - 0x411EE35200  0xE7020E00  + 0x4205E56000  0x00000200  - 0x4205E56200  0x5CA65E00  + 0x42628BC000  0x00000200  - 0x42628BC200  0xE44DF400  + 0x4346D9B600  0x00000200  - 0x4346D9B800  0x6FC12AA00  + 0x4A42EC6200  0x00000200  - 0x4A42EC6400  0x57C175A00 
+ 0x4FBF03BE00  0x00000200  - 0x4FBF03C000  0x133A90C00  + 0x50F2ACCC00  0x00000200  - 0x50F2ACCE00  0xD0616C600  + 0x5DF8C39400  0x00000200  - 0x5DF8C39600  0xB28D2C00  + 0x5EAB50C200  0x00000200  - 0x5EAB50C400  0x5B3B3E00  + 0x5F068C0200  0x00000800  - 0x5F068C0A00  0x00033000  + 0x5F068F3A00  0x00000800  - 0x5F068F4200  0x1893D0600  + 0x608FCC4800  0x00000200  - 0x608FCC4A00  0x815505800  + 0x68A51CA200  0x00000200  - 0x68A51CA400  0x26640BC00  + 0x6B0B5D6000  0x00000200  - 0x6B0B5D6200  0x950B29E00  +
12
  • 1
    Can you edit your question to include exactly how you invoked ddrescue (i.e. copy and paste the exact command line you used)? Also, can you include the terminal output ddrescue generated?
    – Spiff
    Commented Nov 13, 2021 at 0:59
  • Also, you said in your other Question that you were running it against a brand-new SSD? By "brand new" did you mean "never been used, and blank"? Were you hoping to recover scraps of test files that had been used at the factory during burn-in testing or something? If so, you probably need to be told that that's not how modern SSDs work. The SSD controller keeps track of which location have been written. If you try to read from a location that has never been written, the controller just sends a block of zeroes (binary zeroes; null bytes; 0x00).
    – Spiff
    Commented Nov 13, 2021 at 1:17
  • 1
    The more I read your two questions, the more I get XY Problem vibes. Instead of asking us how to salvage your misbegotten ddrescue run, you should probably back up a step and post a Question about how to do…whatever it is that made you think you needed to run ddrescue in the first place…because it sounds to me like you were maybe already confusedly going down the wrong path when you decided to invoke ddrescue in the first place.
    – Spiff
    Commented Nov 13, 2021 at 1:32
  • Have you tried to mount /dev/sdk now? Preferably with -o ro. It may or may not succeed (because the filesystem may lack important data due to unreadable sectors of the source), but have you tried? Commented Nov 13, 2021 at 1:35
  • Thanks for posting the command line. It looks to me like you asked ddrescue to copy a single partition from one device, onto the whole of another device, likely destroying the target device's partition table (GPT or MBR) in the process. I can't imagine why anyone would want to invoked ddrescue that way, so we probably need to help you figure out a little better whatever it is you're really trying to do here.
    – Spiff
    Commented Nov 13, 2021 at 1:44

2 Answers 2

1

OK, after more research I'm going to try to answer my own question. Apparently if you use ddrescue it doesn't automatically create a drive image unless you tell it to produce a specific file, say mydrive.img within the drive to which you are writing (the target).

Once you've done that you can use something like lzip or lziprescue to extract the actual directories and files you're looking for.

However, I'm still unclear as to whether you can rescue an individual directory within the failing drive or you have to rescue the whole partition. If I can figure that out I'll add it to this answer.

Also you might have to perform more operations on the image file before you can extract its files, but I don't know what you'd use to do that.

1
  • (1) If you copy a partition with filesystem to a regular file then you can later mount the file: sudo mount mydrive.img /mnt/whatever. If you copy to a block device then mount the block device: sudo mount /dev/sdk /mnt/whatever. That's why I asked earlier if you had tried to mount the device. (2) "I'm still unclear as to whether you can rescue an individual directory" – see this answer. Commented Nov 14, 2021 at 10:23
0

You get three hints from me that should make you successful with future requests. However I won't answer to your original question because of your negative comments that I consider childish that do not deserve to be rewarded by a solution from me.

1. Failure of mapfile optics

Unfortunately line end markings are different in the unixoid world than in the windows world. To understand this issue read this article p.e.:

How are \n and \r handled differently on Linux and Windows?

Use p.e. Notepad++ or a hex editor to check how line ends are being marked. They often support conversion of the line end markings. That will help you to maintain the original optics and import the file into excel enabling you to calculate the decimal equivalents of locations and length to have an idea about the size of unrecovered/unreadable "black holes".

2. Bad problem description

A good description contains a description of the situation before and after the incident. "What do you do after ddrescue finishes?" is not a good title. I personally use ddrescue as the better dd alternative to duplicate drives. After using ddrescue the job is done.

If you are talking about data recovery the issue is totally different.

Example:

I am using a Western Digital hdd named WD40SMRC drive as a download storage location for my cat videos. I am using Linuxmint 19.2 and have partitioned the drive half a your ago with GPT and one ext4 partition is filling the whole drive. A week ago I was unable to mount the partition. Gparted showed nothing. The drive is repeatedly clicking now. Out of fear of data loss I tried to duplicate my partition using ddrescue before the drive might degrade somehow. But know I don't know how to continue.

The key issue is that when I see a description that I consider bad I don't bother helping because I assume communication will be difficult and it will involve endless questions and that destroys the fun of it for me. Your thread opening is your business card and it shows you how much effort you devote to your problem!

3. ddrescue documentation

When using ddrescue not only the mapfile is interesting. A screenshot of the main window gives lots of condensed information which can not be extracted from the mapfile only.

You must log in to answer this question.