Prevent Linux Hard Disk Drive from Sleeping

If you are using a Hard Disk Drive on your Linux desktop as a secondary drive you may have noticed it consistently making a starting and stopping noise. This is the hard drive being shut down to save power. In my case since I only use it as a secondary drive to store images and music, it is not always accessed and it would consistently go idle (spin down) making those alarming noises. This power saving features seems to quite aggressive though.

To prevent the HDD from sleeping, open your console and input this command:

sudo hdparm -B255 -S0 /dev/sdb2

The /dev/sdb2 is the location of where your target disk drive is mounted. The sdb2 stand for the name of your hard disk drive, this may be different depending on your system.

Prevent HDD Sleep

No more spinning down noises when my media files are not accessed for a while. No more spin-up noises and initial delays when I play music from the backup drive.

Leave a Reply

Please write your comments in english. I delete anything that even remotely resembles spam.

Note: When posting code, enclose it in pre and code tags.
e.g. <pre><code> Add code here </code></pre>