Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Our backup script mounts an USB hard drive, copies some files, then unmounts. So, since the drive is only in use during this period, I thought it would be good to power down the drive once the backup is complete. Is there a command to do this? If yes, would I need to manually power it back up again when I need to use it next time?

share|improve this question

closed as off-topic by MDMarra, MikeyB, Scott Pack, mdpc, EEAA Dec 17 '13 at 6:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – MDMarra, MikeyB, Scott Pack, mdpc, EEAA
If this question can be reworded to fit the rules in the help center, please edit the question.

What type of USB drive? I know most of the Western Digital Mybooks will spin down the drive after inactivity. Some of the better USB docks do this as well. – Zoredache Oct 27 '10 at 21:39
It's just a generic drive "toaster". – nbolton Oct 27 '10 at 21:40
Just an update, I managed to get the drive to stop briefly by running sg_start --stop /dev/sdc but unfortunately the damn thing just starts it's self back up again! – nbolton Oct 27 '10 at 21:43
Do you have HAL or udisks on your system? If so, it may be a polling daemon that is waking it back up again. If so, hal-disable-polling --device /dev/sdc or udisks --inhibit-polling /dev/sdc may help. – ephemient Oct 27 '10 at 23:19
If your usb drive has has a plug for its electricity, you could plug that in a time switch ( Then you could program the time switch to turn itself off and on at the times you choose. – natxo asenjo Oct 29 '10 at 9:07

Use this script.

This script is designed to properly put an USB device into suspend mode that can then be unplugged safely. But the ultimate effect is what you want to achieve.

Find some discussion about the similar topic here.

share|improve this answer

I've never seen a USB hard drive that manages power anywhere other than a power switch or the cord itself.

If it were a NAS it may be possible to send commands to the underlying OS to shut it down (or suspend) and possibly send it WakeOnLan commands.

share|improve this answer
Are you sure hdparm won't help? Or maybe sg_start? – nbolton Oct 27 '10 at 21:34
I'm not sure what you're asking @nbolton? Are you asking if I've tried them, or if I know how to bend those apps to do what you're trying to do, or something else? – gWaldo Oct 28 '10 at 12:26
if you've tried them id guess, i thought hdparm could do this myself. – Sirex Jun 17 '11 at 12:17
I've successfully set the spin down time of a wd usb drive with hdparm and now it stops when I'm not using it. – Jure1873 Sep 20 '11 at 16:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.