How to soft reset Linux disks

This post is over 3 years old, so please keep in mind that some of its content might not be relevant anymore.

Sometimes disks stop responding and cause issues/slowness to the whole system, simply because the system is expecting some sort of response.
In these cases, the device/disk would appear to be 100% utilised (e.g. in iostat) and to avoid having to reboot the whole system, it needs to be reset.

For example, I just had a problem with a device “/dev/sdd” not responding.

I first checked what logical host it is on:

readlink /sys/block/sdd

“host8” is what I needed to know.

Then I disabled it:

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

The system got back to normal (apart from the missing disk, of course!).

And then I reenabled it with:

echo '- - -' > /sys/class/scsi_host/host8/scan

I can now investigate what actually happened to the disk, without having to reboot the whole system.

Hope it helps!

Leave a Reply

Your email address will not be published. Required fields are marked *