meta data for this page
  •  

This is an old revision of the document!


sata hotplug

Plug

echo 0 - 0 > /sys/class/scsi_host/host5/scan

Rescan all ports:

exec tee /sys/class/scsi_host/host*/scan <<<'- - -' >/dev/null

Unplug

echo 1 > /sys/block/(whatever)/device/delete

safecopy

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:

safecopy --stage1 /dev/source output.img
safecopy --stage2 /dev/source output.img
safecopy --stage3 /dev/source output.img
safecopy --stage1 -c 175316045 -I my/previous/stage1.badblocks -L 0 --forceopen /dev/sdi /dev/sdd

on USB or erronous drives

To disable SATA low level operations:

safecopy --forceopen -L 0 --stage1 /dev/source /dev/destination

Continue interrupted copy

With -I parameter safecopy works in incremental mode. Position is detemined from dest file size. If dest is a block device parameter -c needs to be used:

safecopy --stage1 -c 175316045 -I stage1.badblocks /dev/sdi /dev/sdd