disconnected external HDD can not be powered off automatically with help of my system

Asked by Ivan Ivanoff

My external HDD-drive still powered on even when it is unmounted. my HDD-drive still getting power from USB and spinning. I am thinking this is not safe to stop disk just disconnecting usb-cord while HDD is spinning. Is it possible to stop it in program way (to say - stop your motor)?. Where to poke this command for usual way of unmounting?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ricardo Cropalato de Melo (ricardo-cropalato) said :
#1

You could try to use "hdparm -B 1 /dev/<hd>" ; But i think the usb do not suport APM.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#2

I think if your external USB hd is unmounted by the system you can safe disconnect and poweroff it.
I have external USB hd and do it without any issue.

Hope this help.

Revision history for this message
Ricardo Cropalato de Melo (ricardo-cropalato) said :
#3

I do it too

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#4

I think modern disk have heads autopark options...:-)

But if you want force stop motor try: hdparm with -S

-S Set the standby (spindown) timeout for the drive. This value is
              used by the drive to determine how long to wait (with no disk
              activity) before turning off the spindle motor to save power.
              Under such circumstances, the drive may take as long as 30 sec-
              onds to respond to a subsequent disk access, though most drives
              are much quicker. The encoding of the timeout value is somewhat
              peculiar. A value of zero means "timeouts are disabled": the
              device will not automatically enter standby mode. Values from 1
              to 240 specify multiples of 5 seconds, yielding timeouts from 5
              seconds to 20 minutes. Values from 241 to 251 specify from 1 to
              11 units of 30 minutes, yielding timeouts from 30 minutes to 5.5
              hours. A value of 252 signifies a timeout of 21 minutes. A
              value of 253 sets a vendor-defined timeout period between 8 and
              12 hours, and the value 254 is reserved. 255 is interpreted as
              21 minutes plus 15 seconds. Note that some older drives may
              have very different interpretations of these values.

To view all hdparm options. Use linux man.

Please open a Terminal from the menu Applications->Accessories->Terminal and type:

man hdparm

Put this -S xx value under /etc/hdparm.conf , open a terminal and type:

sudo gedit /etc/hdparm.conf

give your user password when requested, you don't see nothing when you type it, then press enter.

Go to the end of file, and change your bottom rows like these:

command_line {
       hdparm -q -S nn /dev/xxx
}

Where nn is your desired value.

And xxx (hda,hdb,hdc... or sda,sdb,sdc...) is your USB external device /dev/... id, find it with:

sudo mount
or with
sudo fdisk -l

Then to enable hdparm at boot, go to menu System->Administration->Services->Select and enable "Hard disk Tuning (hdparm)" item

HTH

Revision history for this message
Ivan Ivanoff (spammeroff) said :
#5

It is fun, but every command I try to send to my external HDD are ending with this:

/dev/sda1
HDIO_GET_IDENTITY failed: Invalid argument

BTW in "other" operation systems my external HDD always stops completely if I use "safe remove".

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#6

You can't tuning a partition /dev/sda1
try to tune parameters of hard-disk /dev/sda

Hope this help

Revision history for this message
Ricardo Cropalato de Melo (ricardo-cropalato) said :
#7

try this:

sudo apt-get install sg3-utils

then:

/usr/bin/sg_start --stop /dev/<your device>

Can you help with this problem?

Provide an answer of your own, or ask Ivan Ivanoff for more information if necessary.

To post a message you must log in.