Can not mount copy of image file (ddrescue): "can't have a partition outside the disk"

2

I'm struggling for days now moving my old Windows XP installation to a new hard disk, because the old disk is failing.

Long story short:

I successfully created an image of the entire (failing) disk and was able to mount it in Linux. I now want to copy it (the image file) to another disk, but the copy seems to have an error (see below)

What I did

(among many other things)

I found this excellent tutorial: https://www.technibble.com/forums/threads/guide-to-using-ddrescue.48269/

cloning failing drive to .img with ddrescue -d

  • installed Linux Mint 17 on another drive in the PC
  • bought a new 3 TB hard disk
  • cloned the entire failing disk (Seagate, 500 GB) with ddrescue to an image file on a partition of the 3 TB hard disk
    sudo ddrescue -d /dev/sdc Seagate500GB_ddrescue3.img Seagate500GB_ddrescue3.logfile

Result:

GNU ddrescue 1.17 Press Ctrl-C to interrupt rescued: 500107 MB, errsize: 512 B, current rate: 1536 B/s ipos: 392967 MB, errors: 1, average rate: 27113 kB/s opos: 392967 MB,
time since last successful read: 0 s Finished

Logfile: Rescue Logfile. Created by GNU ddrescue version 1.17
Command line: ddrescue -d /dev/sdc Seagate500GB_ddrescue3.img Seagate500GB_ddrescue3.logfile
current_pos current_status 0x5B7EA9B400 +
pos size status 0x00000000 0x5B7EA9B000 + 0x5B7EA9B000 0x00000200 - 0x5B7EA9B200 0x18F216AE00 +

tested the image and was able to mount it in Linux

Sudo parted Seagate500GB_ddrescue3.img [sudo] password for martin: GNU Parted 2.3 Using /media/martin/data1/Seagate500GB_ddrescue3.img Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) unit
Unit? [compact]? B
(parted) print
Model: (file) Disk /media/martin/data1/Seagate500GB_ddrescue3.img: 500107862016B Sector size (logical/physical): 512B/512B Partition Table: msdos

Number Start End Size Type File system Flags 1 32256B 70597578239B 70597545984B
primary ntfs boot 2 70605802496B 500105249279B 429499446784B extended lba 5 70605834752B 500105249279B 429499414528B logical ntfs

(parted)

sudo mkdir mountpoint

sudo mount -o loop,ro,offset=70605834752 Seagate500GB_ddrescue3.img mountpoint

Copied the .img file to another disk (hfs+ volume)

In the Linux file explorer (Nautilus?) I copied the .img file to another disk. Unfortunately I only had enough space on a disk formatted hfs+ (journaled), so I had to mount it with write permissions in Linux (like described here ) and copied the .img file to it.

now parted can not list the partitions of the copied image:

still on the Linux machine with the hfs+ drive mounted after copying:

martin@pcmint /media/martin/MacBak04 $ sudo parted Seagate500GB_ddrescue3.img [sudo] password for martin: GNU Parted 2.3 Using /media/martin/MacBak04/Seagate500GB_ddrescue3.img Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) unit
Unit? [compact]? B
(parted) print
Error: Can't have a partition outside the disk!
(parted) quit

with sfdisk I can list the partitions:

sudo sfdisk -d Seagate500GB_ddrescue3.img Warning: extended partition does not start at a cylinder boundary. DOS and Linux will interpret the contents differently. read: Inappropriate ioctl for device

sfdisk: read error on Seagate500GB_ddrescue3.img - cannot read sector 137901958 partition table of Seagate500GB_ddrescue3.img unit: sectors

Seagate500GB_ddrescue3.img1 : start= 63, size=137885832, Id= 7, bootable Seagate500GB_ddrescue3.img2 : start=137901958, size=838866107, Id= f Seagate500GB_ddrescue3.img3 : start= 0, size= 0, Id= 0 Seagate500GB_ddrescue3.img4 : start= 0, size= 0, Id= 0

martin@pcmint /media/martin/MacBak04 $ sudo sfdisk -l Seagate500GB_ddrescue3.img Disk Seagate500GB_ddrescue3.img: cannot get geometry

Disk Seagate500GB_ddrescue3.img: 187 cylinders, 255 heads, 63 sectors/track Warning: extended partition does not start at a cylinder boundary. DOS and Linux will interpret the contents differently. read: Inappropriate ioctl for device

sfdisk: read error on Seagate500GB_ddrescue3.img - cannot read sector 137901958 Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System Seagate500GB_ddrescue3.img1 * 0+ 8582 8583- 68942916 7 HPFS/NTFS/exFAT Seagate500GB_ddrescue3.img2 8583+ 60800 52218- 419433053+ f W95 Ext'd (LBA) Seagate500GB_ddrescue3.img3 0 - 0 0 0 Empty Seagate500GB_ddrescue3.img4 0 - 0 0 0 Empty

the original image shows one more partition!

martin@pcmint /media/martin/data1 $ sudo sfdisk -l Seagate500GB_ddrescue3.img [sudo] password for martin: Disk Seagate500GB_ddrescue3.img: cannot get geometry

Disk Seagate500GB_ddrescue3.img: 60801 cylinders, 255 heads, 63 sectors/track Warning: extended partition does not start at a cylinder boundary. DOS and Linux will interpret the contents differently. Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System Seagate500GB_ddrescue3.img1 * 0+ 8582 8583- 68942916 7 HPFS/NTFS/exFAT Seagate500GB_ddrescue3.img2 8583+ 60800 52218- 419433053+ f W95 Ext'd (LBA) Seagate500GB_ddrescue3.img3 0 - 0 0 0 Empty Seagate500GB_ddrescue3.img4 0 - 0 0 0 Empty Seagate500GB_ddrescue3.img5 8584+ 60800 52217- 419433022 7 HPFS/NTFS/exFAT

Question

What have I done wrong? Is the copied image file damaged?

Can I fix it or do I have to chose another method to copy it somewhere else (maybe with dd=?

MostlyHarmless

Posted 2015-02-21T09:11:47.347

Reputation: 1 708

1wow, nobody answered this yet? im having same problem. This is one hard error to research so im not going to try much further just yet. I basically some dd images that i totally cant mount using the offsets. I have several images, they cant all be corrupt(prob are)... – Brian Thomas – 2015-09-24T08:19:08.613

@BrianThomas: I will have a look in my documentation later if I could solve it – MostlyHarmless – 2015-09-24T16:03:12.373

No answers