Re: Hard drive overheated, now can't get into loop-AES partitions...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Jari Ruusu  1024R/3A220F51 5B 4B F9 BB D3 3F 52 E9  DB 1D EB E3 24 0E A9 DD

-
Linux-crypto:  cryptography in and on the Linux system
Archive:       http://mail.nl.linux.org/linux-crypto/


[Index of Archives]     [Kernel]     [Linux Crypto]     [Gnu Crypto]     [Gnu Classpath]     [Netfilter]     [Bugtraq]
  Powered by Linux