====== ddrescue ====== Отсюда: http://brj.pp.ru/wiki/os/nix/ddrescue ddrescue — это инструмент для восстановления данных. Программа копирует данные из одного файла или блочного устройства (жесткий диск, cdrom, и т.д.) в другое, пытаясь сохранить часть небитых данных в случае ошибки чтения. ===== Теория ===== http://habrahabr.ru/post/56796/ http://tinyapps.org/docs/mount_partitions_from_disk_images.html ===== Практика ===== Установка # apt-get install ntfs-3g ntfs-config ntfsprogs testdisk partimage # ln -s /usr/bin/ntfsfix /usr/sbin/fsck.ntfs # ln -s /usr/bin/ntfsfix /usr/sbin/fsck.ntfs-3g # fsck /dev/sdb1 Восстановление # cddrescue --no-split --verbose --force /dev/sdb 500wd.img rescue.log # ddrescue --direct --max-retries=2 --verbose /dev/sdb 500wd.img rescue.log # ddrescue --retrim --max-retries=2 --verbose /dev/sdcb 500wd.img rescue.log # fdisk -l -C yyy ntfs.img # mount -o loop,ro,offset=NNNNN ntfs.img /mnt/ntfs Формула для расчета: NNNNN= sectors/track * 512 # sudo parted iscsi.ntfs.img The offset must be specified in bytes, so now you must take the starting offset, in this instance 63, and multiply it by 512 bytes. From this we obtain 32256. (This assumes 63 sectors per track and 512 bytes per sector.) The file system type in this case is NTFS, so let us mount this partition from within the image using the usual loopback method. # fdisk -l iscsi.ntfs.img # mount -t ntfs -o loop,offset=32256 500wd.img /mnt/test # losetup -f --show dummy_disk.raw # losetup -a # mount -o loop,ro,offset=10486808576 wd500.img /mnt/test 20482048 # sudo losetup -f --show dummy_disk.raw partimage restore /dev/loop0 winxp.img # sudo mount -t ntfs-3g /dev/loop0 mountpoint # sudo mount -o loop -t ntfs-3g dummy_disk.raw mountpoint # sfdisk -l -uS winxp.img Device Boot Start End #sectors Id System winxp.img1 * 63 3326399 3326337 7 HPFS/NTFS winxp.img2 0 - 0 0 Empty winxp.img3 0 - 0 0 Empty winxp.img4 0 - 0 0 Empty # sudo dd if=winxp.img of=extracted.img skip=63 count=3326337 {{tag>ddrescue losetup восстановление_данных}}