It's not common knowledge that SATA HDDs are capable of being hot-plugged into almost any modern PC. However using them in a plug-n-play manner like portable external USB-HDDs is still not common.
Here is how to use your SATA HDD like an portable HDD.
- Ubuntu 11.10
- DELL Optiplex 380
- Seagate Barracuda 1TB (SATA)
1. Connect the SATA HDD to Host PC (sata-bus + power)
2. Scan for New Devices on SCSI Host
echo "- - -" > sudo tee /sys/class/scsi_host/hostN/scan
where N is the host port number on your host PC to which you have plugged-in the SATA HDD. Usually N=1, assuming the primary HDD on host PC is connected on SATA0.
"- - -" stands for wildcards in place of the channel number, SCSI target ID, and LUN.
You can find more information here.
3. Mount the Newly Detected Device Locally
sudo mount /dev/sdX /media/temphdd
where X is a/b/c/d etc. Usually X=b, assuming the primary HDD on host PC is enumerated as sda and there are no other block devices.
4. Copy All Your Data to/from the HDD Present at /media/tempHDD
5. Once Finished, Unmount the Device
sudo umount /media/temphdd
6. Powering Down the SATA HDD
echo 1 > sudo tee /sys/block/sdX/device/delete
Ensure that you refer to the proper device (sdb, sdc, etc.) as above in step 3.
7. Disconnect the SATA HDD from Host PC
That's it! That's how one can use the hotplug feature of SATA HDDs to effectively use them as portable external HDDs.