Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

I have configured powernap to hibernate (i.e., suspend-to-disk) the machine if idle. In order to save additional power, I have configured my non-root, data disks to spin-down using the hdparm command. Unfortunately, this setting gets lost after resuming from hibernate.

I'd like to run these hdparm command right after the system has resumed. How/Where to install them?

share|improve this question
up vote 4 down vote accepted

You can do this by creating a script in /etc/pm/sleep.d

sudo nano /etc/pm/sleep.d/99_hdparm_thaw

Use this as your base:



case "${1}" in
                # this is where you put something you want to run before hibernating
                # this is where you put something you want to run on resume/thaw

You will then need to make sure it is executable:

sudo chmod +x /etc/pm/sleep.d/99_hdparm_thaw

There are other scripts in that directory, which is where I came up with the base. You may be able to use those for ideas.

Also, those scripts are run in alphabetical order. This is why I chose to name it 99_hdparm_thaw, so it will be the last run script.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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