How to soft reset Linux disks

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
../devices/pci0000:00/0000:00:1c.4/0000:03:00.0/ata9/host8/target8:0:0/8:0:0:0/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!
Andrea

Leave a Reply

Your email address will not be published.