Linux has a nifty way of allowing disk state modification via /sys/ interface. Very useful when debugging LVM mirroring, disk disaster recovery etc.
To put a SATA disk offline/running:
echo offline > /sys/block/sda/device/state
echo running > /sys/block/sda/device/state
To delete a device (for unplugging):
echo 1 > /sys/block/sda/device/delete
To scan for new devices (hotplugging):
echo "0 0 0" >/sys/class/scsi_host/host/scan