I've been trying to restore some Windows 7 partitions from gzipped image files using a Fedora live USB, and the result is broken.
I restored the MBR earlier and the partitions look right. Used "partprobe" on the first try, but had rebooted before the second try. There should really have been a backup of the whole unallocated 1MiB at the start of the drive, but I imagine missing that would only break the bootloader, not the whole lot, right?
There appears to be something recognizable as NTFS in the partitions afterwards, so I guess I'm not doing completely the wrong thing.
The "No space left on device" is suspicious, but strangely, everything looks the right size, and the 64K blocks are an integer division...
"mount" told me to run chkdsk from Windows, so I booted a Windows DVD to try that, but it couldn't fix it.
I extracted the small one as a file on my main computer (also Fedora), and I can mount that with "loop" and view the contents, so seems like the NTFS in the image is OK.
Currently running badblocks on the target hard drive. So far, pattern 0xaa is OK, so apparently not a hard drive failure either.
Any idea what I've done wrong here and how to fix it?

I restored the MBR earlier and the partitions look right. Used "partprobe" on the first try, but had rebooted before the second try. There should really have been a backup of the whole unallocated 1MiB at the start of the drive, but I imagine missing that would only break the bootloader, not the whole lot, right?
There appears to be something recognizable as NTFS in the partitions afterwards, so I guess I'm not doing completely the wrong thing.
The "No space left on device" is suspicious, but strangely, everything looks the right size, and the 64K blocks are an integer division...
"mount" told me to run chkdsk from Windows, so I booted a Windows DVD to try that, but it couldn't fix it.
I extracted the small one as a file on my main computer (also Fedora), and I can mount that with "loop" and view the contents, so seems like the NTFS in the image is OK.
Currently running badblocks on the target hard drive. So far, pattern 0xaa is OK, so apparently not a hard drive failure either.
Any idea what I've done wrong here and how to fix it?
Code:
[liveuser@localhost]$ gunzip -c sda1.img.gz | wc -c
1572864000
[liveuser@localhost]$ gunzip -c sda2.img.gz | wc -c
303817555968
[liveuser@localhost]$ gunzip -c sda3.img.gz | wc -c
14680064000
[liveuser@localhost]$ sudo fdisk -l /dev/sda
Disk /dev/sda: 298.1 GiB, 320072933376 bytes, 625142448 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x6479a0bb
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 3074047 3072000 1.5G 7 HPFS/NTFS/exFAT
/dev/sda2 3074048 596467711 593393664 283G 7 HPFS/NTFS/exFAT
/dev/sda3 596467712 625139711 28672000 13.7G 7 HPFS/NTFS/exFAT
[root@localhost]# gunzip -c sda1.img.gz | dd of=/dev/sda1 conv=sync bs=64K
dd: error writing '/dev/sda1': No space left on device
780+23221 records in
24000+0 records out
1572864000 bytes (1.6 GB, 1.5 GiB) copied, 18.9797 s, 82.9 MB/s
[root@localhost]# gunzip -c sda2.img.gz | dd of=/dev/sda2 conv=sync bs=64K
dd: error writing '/dev/sda2': No space left on device
272833+4363056 records in
4635888+0 records out
303817555968 bytes (304 GB, 283 GiB) copied, 3152.46 s, 96.4 MB/s
[root@localhost]# gunzip -c sda3.img.gz | dd of=/dev/sda3 conv=sync bs=64K
dd: error writing '/dev/sda3': No space left on device
15757+208244 records in
224000+0 records out
14680064000 bytes (15 GB, 14 GiB) copied, 245.341 s, 59.8 MB/s
Code:
[root@localhost ~]# mount -t ntfs /dev/sda1 sda1
ntfs_mst_post_read_fixup_warn: magic: 0x44414142 size: 1024 usa_ofs: 1849 usa_count: 46218: Invalid argument
Record 0 has no FILE magic (0x44414142)
Failed to load $MFT: Input/output error
Failed to mount '/dev/sda1': Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.

