Hot swap SATA hard drives in GNU / Linux

Disconnect hard drives hot (Hot swap) the GNU / Linux.


In my work as a technician I encounter many times I need to extract data from hard drives customer.
To make this work I bought a box for pc that allows the connection of devices SATA (Hot swap) on top, the Thermaltake urban s41, this is very like me in saving data since I only have to plug in the top of the disc.

hot swap, urban s41, HDD

Then with grsync bag the data to a disc 2 teras I have in the pc for such purposes. Once I'm done I have to pass data to remove the disc.The problem is to disconnect the drive to do two things unmount partitions and disk stop motors.

To unmount partitions use the tool included in the system simply pulse the button to disassemble within the file browser.
desmontar, Hot swap, desmontar disco.

To stop the motors need to run the command hdparm .

First you have to find out what the device:

test @ test-desktop:~$ sudo blkid
[sudo] password for prueba: 
/dev/sda1: UUID="a6e8cc30-8888-4e6f-8f9e-6dd0e21bc5fa" TYPE="ext4" 
/dev/sdb1: LABEL="data" UUID="88e26555-1e99-4a15-bd3e-cd1b90df6cf4" TYPE="ext3" 
/dev/sdc1: LABEL="old data" UUID="60507B8F507B6B24" TYPE="ntfs"

For the label (LABEL) identify the record in this case sdc
Then I run.

sudo hdparm -Y /dev/sdc
 issuing sleep command

With this disk stops, you realize that it works if you touch the top notes as part stops rotating.
Once you have stopped you can extract it without problems.

And all this without turning off the computer is fantastic!
Do not forget to make a +1 on social networks…. Is that it makes me very excited :).

About Ignacio Alba Obaya

Microcomputer and Technical Training for Employment. Lover of new technologies. Manager GNU / Linux and Windows.


  1. Interesting. I think my BIOS GIGABYTE has any one of these to remove the hard drive hot, but at the time it did not work… 🙁

Leave a Reply

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