Sunday, April 28, 2024
20
rated 0 times [  20] [ 0]  / answers: 1 / hits: 44148  / 1 Year ago, wed, march 8, 2023, 12:00:42

I want to spin down external hard drive from the terminal before unmounting.



It is an sata drive connected through usb.



Running hdparm gives this



 ry@G62x:/media$ hdparm -S10 937b2299-48ff-4a9c-8228-67ed4453e8fb/

937b2299-48ff-4a9c-8228-67ed4453e8fb/:
setting standby to 10 (50 seconds)
HDIO_DRIVE_CMD(setidle) failed: Inappropriate ioctl for device

More From » external-hdd

 Answers
7

You can safely unmount and spin-down an external hard disk from the terminal most easily by using the command-line functionality of udisks, which does not require the use of sudo if your system is set up correctly. (To list your device names, enter mount in the terminal first.)



When you have found your external drive, use the following commands. You must first unmount the partition (use sdb1 or whatever mount showed as the location):



udisks --unmount /dev/sdb1


Then to safely remove (i.e. spindown- you will hear it click and spin-down), use only sdb, for example:



udisks --detach /dev/sdb


NOTE: It is of crucial importance here that you use sdb or sdc without a partition number when using the detach option; i.e. sdb1 or sdc1 will not work. The partition must be unmounted first and then the disk itself spun down as the examples show.



The udisks commands work successfully for all my pata and sata external hard disks.


[#43944] Wednesday, March 8, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hreadsoplet

Total Points: 220
Total Questions: 108
Total Answers: 105

Location: Serbia
Member since Fri, Jun 3, 2022
2 Years ago
;