meta data for this page
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
datarecovery [2016/08/16 21:13] niziak created |
datarecovery [2023/01/28 18:51] (current) niziak |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== safecopy ====== | + | ====== Data recovery ====== |
- | There are some predefined settings: | + | |
- | * stage1: Preset to rescue most of the data fast, using no retries and avoiding bad areas. | + | |
- | * stage2: Preset to rescue more data, using no retries but searching for exact ends of bad areas. | + | |
- | * stage3: Preset to rescue everything that can be rescued using maximum retries, head realignment tricks and low level access. | + | |
- | In current working directory, safecopy will create files with badblocks map: stage#.badblocks, which are used in next stages. | ||
- | Typical usage is: | ||
<code bash> | <code bash> | ||
- | safecopy --stage1 /dev/source output.img | + | hdparm -c0 /dev/sdi |
- | safecopy --stage2 /dev/source output.img | + | hdparm -X1 /dev/sdi |
- | safecopy --stage3 /dev/source output.img | + | hdparm -d0 /dev/sdi |
+ | echo 1 > /sys/block/sdi/device/queue_depth | ||
</code> | </code> | ||
- | ===== on usb drives ===== | + | ===== fast erase whole disc ===== |
- | Not all USB adapters can handle SATA low level operations. | + | |
<code bash> | <code bash> | ||
- | safecopy --forceopen -L 0 --stage1 /dev/source /dev/destination | + | sudo hdparm --user-master u --security-set-pass ABC /dev/sdX |
+ | sudo hdparm --user-master u --security-erase ABC /dev/sdX | ||
+ | |||
+ | # check if device security is "not enabled" | ||
+ | hdparm -I /dev/sdX | ||
</code> | </code> | ||
+ | |||
+ | |||
+ | ====== sata hotplug ====== | ||
+ | ===== Plug ===== | ||
+ | |||
+ | <code bash> | ||
+ | echo 0 - 0 > /sys/class/scsi_host/host5/scan | ||
+ | </code> | ||
+ | |||
+ | Rescan all ports: | ||
+ | <code> | ||
+ | exec tee /sys/class/scsi_host/host*/scan <<<'- - -' >/dev/null | ||
+ | </code> | ||
+ | ===== Unplug ===== | ||
+ | |||
+ | <code bash>echo 1 > /sys/block/(whatever)/device/delete</code> | ||
+ | |||
+ | |||