Hotswap Disks are great, we can replace them transparently with no downtime to the host computer. Applications on the computer keep on running non-stop.
Steps to perform BEFORE pulling hotswap SATA disks out:
- sync (unmount takes care of this but it doesn’t hurt to run it)
- hdparm -Y /dev/sdX (put in sleep mode)
- echo offline > /sys/block/sdX/device/state (prevent any access)
- echo 1 > /sys/block/sdX/device/delete (delete associated driver)
- dmesg (to check that the drive is stopped)
- wait at least a minute for the disk to spin down
- pull the drive out slowly
Step 5 will spin the disk down if step 3 does not work.