The following is the GNU All-permissive License as recommended in

Copyright (C) 2024 Free Software Foundation

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

Contributions are welcome. See

soft-reset drive

To reset a hard drive without physically removing it:

readlink /sys/block/sdX


Force disconnect the device:

echo 1 > /sys/block/sdX/device/delete

Notice the host1 in the returned line above. That’s the controller that needs rescanned. Trigger rescan:

echo "- - -" > /sys/class/scsi_host/host1/scan