Jari Ruusu wrote:
$ losetup /dev/loop0 /dev/hdb11
$ blockdev --setbsz 512 /dev/hdb11
$ dd bs=512 if=/dev/hdb11 of=hdb11.dmg conv=noerror
$ losetup -d /dev/loop0
Above dd command is completely wrong!
This time I looked at dd source, and learned that conv=noerror without
conv=sync will *remove* incorrectly read blocks from output. IOW, output
length will be shorter than expected, and that file system sector positions
will be incorrect.
Correct way to restore your data is something like this:
$ losetup -e AES128 /dev/loop0 /dev/hdb11
$ blockdev --setbsz 512 /dev/hdb11
$ losetup /dev/loop1 /dev/loop0
$ blockdev --setbsz 512 /dev/loop0
$ dd bs=512 if=/dev/loop0 of=hdb11.dmg conv=noerror,sync
^^^^^^^^^^^^^^^^^
$ losetup -d /dev/loop1
$ losetup -d /dev/loop0
$ e2fsck -f -y -b 8193 hdb11.dmg # 1K soft block size file system
or ^^^^^^^
$ e2fsck -f -y -b 32768 hdb11.dmg # 4K soft block size file system
^^^^^^^^
$ mount -r -t ext2 hdb11.dmg /mnt/hdb11 -o loop