If you're running a NAS, a server, or even a simple Linux box, you might want your hard drives to stay active all the time. By default, many disks go into "sleep mode" (also known as "spindown") after a period of inactivity to save power. However, in some cases, it's better to keep them always awake:
- To avoid delays when accessing data.
- To reduce wear and tear from frequent spin-ups.
- To ensure better performance for services like media servers, databases, or file sharing.
In this guide, we'll walk you through disabling disk sleep properly and permanently.
Why Disks Go to Sleep
Modern hard drives are often designed to enter low-power states when they are not in use. This behavior is controlled by two main settings:
- APM (Advanced Power Management): Controls disk power-saving features.
- Spindown Time: Specifies after how many seconds/minutes the disk should stop spinning when idle.
If you want your drives to stay active at all times, you need to disable both.
Step 1: Install Required Tools
First, make sure you have hdparm
and smartmontools
installed. These tools help manage and check drive settings.
On Debian/Ubuntu/OpenMediaVault:
sudo apt update
sudo apt install hdparm smartmontools
Step 2: Check Current Disk Settings
Let's see what your disks are currently set to.
Create a simple script to check APM and spindown settings for all disks:
nano check_disks.sh
Paste the following code:
#!/bin/bash
echo "Checking APM and Spindown settings for all disks:"
for disk in /dev/sd[a-z]; do
echo ""
echo "Disk: $disk"
sudo hdparm -I "$disk" | grep -iE 'Advanced power management|standby timer|level'
done
Save, make it executable, and run:
chmod +x check_disks.sh
./check_disks.sh
If you see messages like Advanced power management level: disabled
and no aggressive spindown timers, you are good. Otherwise, continue.
Step 3: Disable Disk Sleep Immediately
Now, let's disable spindown and APM manually.
Create another script:
nano disable_sleep.sh
Paste this code:
#!/bin/bash
echo "Setting all disks to disable APM and Spindown."
for disk in /dev/sd[a-z]; do
echo ""
echo "Processing disk: $disk"
# Try to disable Advanced Power Management
sudo hdparm -B 255 "$disk"
# Set Spindown time to 0 (never)
sudo hdparm -S 0 "$disk"
done
echo ""
echo "✅ All disks configured to stay active."
Save, make executable, and run it:
chmod +x disable_sleep.sh
./disable_sleep.sh
Important: If your drives don't support APM, you might see warnings like APM_level = not supported
. It's normal; just ensure the spindown setting is disabled.
Step 4: Make the Changes Permanent
Changes made with hdparm
are temporary and will reset after reboot. To apply settings permanently:
- Edit the hdparm configuration file:
sudo nano /etc/hdparm.conf
- Add entries for each disk:
/dev/sda {
spindown_time = 0
}
/dev/sdb {
spindown_time = 0
}
/dev/sdc {
spindown_time = 0
}
/dev/sdd {
spindown_time = 0
}
(Replace /dev/sda
, /dev/sdb
, etc., with your actual disk devices.)
- Save and exit the file.
After the next reboot, your drives will automatically stay awake!
Step 5 (Optional): Configure Through OpenMediaVault Web UI
If you're using OpenMediaVault (OMV), you can also do this through the web interface:
- Navigate to Storage -> Disks.
- Select each disk and edit.
- Set Advanced Power Management (APM) to Disabled.
- Set Spindown Time to Never.
This will achieve the same effect without touching the terminal.
Final Words
Disabling disk sleep ensures consistent performance, especially for always-on systems like NAS servers, media centers, and small home labs.
However, keep in mind:
- Your disks will consume a bit more electricity.
- Disks will experience continuous operation, but in most cases, this is better than frequent start-stop cycles.
Now you know exactly how to keep your drives awake! 🚀
If you have any questions or need help scripting the process automatically, feel free to reach out!