How to soft reset Linux disks

Sometimes disks stop responding and cause system slowness because the kernel is waiting for a response that never comes. The disk appears 100% utilised in iostat even though nothing is being read or written.

To avoid rebooting, reset the device. First find it:

lsscsi

Then remove and rescan:

echo 1 > /sys/block/sdX/device/delete
echo "- - -" > /sys/class/scsi_host/hostX/scan

Replace sdX with the affected device and hostX with the SCSI host number from lsscsi.

Hope it helps!

Leave a Reply

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