0

I have a 500GB disk that I'm trying to recover using GNU ddrescue.

This is the fdisk for the 500GB disk:

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disk identifier: 0xeea5da13

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63   976768064   488384001    7  HPFS/NTFS/exFAT

ddrescue completed its copying run and was doing this:

GNU ddrescue 1.21
Press Ctrl-C to interrupt
Initial status (read from mapfile)
  rescued:  481966 MB,     errsize:   70382 kB,  errors:     121

Current status
     ipos:  482180 MB, non-trimmed:        0 B,  current rate:    262 kB/s
     opos:  482180 MB, non-scraped:   17927 MB,  average rate:    614 kB/s
non-tried:        0 B,     errsize:   70382 kB,      run time:      3m 54s
  rescued:  482110 MB,      errors:      121,  remaining time:  1d 10h 58m
percent rescued:  96.40%      time since last successful read:          0s
Scraping failed blocks... (forwards)

The step above is now complete, and this is what fdisk -l says on the backup.img file:

Disk /media/victor/New Volume4/backup.img: 497.3 GB, 497334280192 bytes
255 heads, 63 sectors/track, 60464 cylinders, total 971356016 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xeea5da13

                               Device Boot      Start         End      Blocks   Id  System
/media/victor/New Volume4/backup.img1              63   976768064   488384001    7  HPFS/NTFS/exFAT

When I do sudo mount -o ro,offset=$((512*63)) backup.img /media/myName/recovery I get:

Failed to read last sector (976768001): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
   or it was not setup correctly (e.g. by not using mdadm --build ...),
   or a wrong device is tried to be mounted,
   or the partition table is corrupt (partition is smaller than NTFS),
   or the NTFS boot sector is corrupt (NTFS size is not valid).
Failed to mount '/dev/loop0': Invalid argument
The device '/dev/loop0' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

What do I do now?

3
  • You've got the file as backup.iso and you're mounting backup.img... have I missed something?
    – Kinnectus
    Commented May 20, 2016 at 12:36
  • Oh, sorry, typo. Commented May 20, 2016 at 12:37
  • losetup -P for partitioned disk image
    – Tom Yan
    Commented May 20, 2016 at 14:25

2 Answers 2

1

Wrong tool I suspect. Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? is a useful pointer - My guess is you imaged /dev/sdc, and mount gets confused with device images.

Use kpartx instead - I believe kpartx -a -v backup.img will add a series of devices in /dev/mapper, which you can then mount as per normal.

6
  • Hmm... I get device-mapper: resume ioctl on loop0p1 failed: Invalid argument create/reload failed on loop0p1 add map loop0p1 (0:0): 0 976768002 linear /dev/loop0 63 Commented May 20, 2016 at 12:28
  • hm. Seems similar to this bugs.debian.org/cgi-bin/bugreport.cgi?bug=780142 what was wrong with the disk to start with?
    – Journeyman Geek
    Commented May 20, 2016 at 12:31
  • It was just a 500GB HDD that I used to back up stuff to. NTFS file system. It started to read and write REALLY slow so I decided to image it and try to recover files from the image. Commented May 20, 2016 at 12:32
  • 1
    Bah, nevermind. I just mounted the image in Windows using 'OSFMount' and it works fine. Pulling files off of it now. Commented May 20, 2016 at 12:49
  • Post that as an answer I guess? I suppose I was right about 'wrong tool' but I have no idea where things went pear shaped.
    – Journeyman Geek
    Commented May 20, 2016 at 12:50
0

I mounted the image in Windows using OSFMount and it worked perfectly. I can access it like a regular drive and I'm pulling files off of it.

To sum up, I had a 500GB drive that I was using to back up files to. It was formatted in NTFS. No other partitions. Read and write speeds were plummeting so I spent a WEEK solid imaging the entire disk using GNU ddrescue in Linux. Then I used OSFMount to actually mount it in Windows and get files off of it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .