## 3 Using ddrescue safely ¶

Ddrescue is like any other power tool. You need to understand what it does, and you need to understand some things about the machines it does those things to, in order to use it safely.

Never try to rescue a r/w mounted partition. The resulting copy may be useless. It is best that the device or partition to be rescued is not mounted at all, not even read-only.

Never try to repair a file system on a drive with I/O errors; you will probably lose even more data.

If you use a device or a partition as destination, any data stored there will be overwritten.

Some systems may change device names on reboot (for example, udev enabled systems). If you reboot such a system, pass the option `--ask` to ddrescue and check that the device names match the model and serial number of the input and output devices before allowing ddrescue to proceed. You may also check the devices with commands like ‘`hdparm -I /dev/sda`’ or ‘`smartctl -i /dev/sda`’.

If you interrupt the rescue and then reboot, any partially copied partitions should be hidden before allowing them to be touched by any operating system that tries to mount and "fix" the partitions it sees.

When using a (graphical) frontend, be careful to not insert or remove any devices to avoid changes in the mapping of devices to device names between the moment the devices are selected in the frontend and the call to ddrescue. Be careful even if the frontend passes `--ask` to ddrescue, because outfile may be changed between user confirmation and actual opening.

It is recommended to run ddrescue on a POSIX system, but if you run it on Cygwin be prepared to find mysterious ’Permission denied’ error messages caused by Windows returning misleading error codes and then Cygwin mapping some of those error codes to EACCES, making it impossible for ddrescue to know what failed, or even whether the error is fatal or not. See --continue-on-errno.