How can I safely remove a SATA disk from a running system?

view full story

http://unix.stackexchange.com – I sometimes need to plug a disk into a disk bay. At other times, I have the very weird setup of connecting a SSD using a SATA-eSATA cable on my laptop while pulling power from a desktop. How can I safely remove the SATA disk from the system? This Phoronix forum thread has some suggestions: justsumdood wrote: An(noymous)droid wrote: What then do you do on the software side before unplugging? Is it a simple "umount /dev/sd"[drive letter]? after unmounting the device, to "power off" (or sleep) the unit: hdparm -Y /dev/sdX (where X represents the device you wish to (HowTos)