Prevent Hard Disk Sleep on macOS (Mac mini / Always-On Systems)
Overview
On modern macOS versions (including macOS 26 and newer), the system may put storage into a low-power or idle state even when Energy Saver settings are configured to Never sleep.
This behavior can cause:- Background services to pause after long inactivity
- API or gateway delays
- Disk access lag after idle periods
- Automation or server workloads becoming unresponsive
Applicable Systems
- macOS 13+ (Ventura, Sonoma, macOS 26+)
- Mac mini used as servers
- Always-on development machines
- Automation or gateway hosts
- CI/CD or background processing systems
Root Cause
Apple introduced multiple internal power layers:
- Energy Saver UI settings
- pmset power profiles
- standby power mode
- autopoweroff policies
- APFS storage idle management
Because of this, disks may still enter an idle state even when sleep is disabled in System Settings.
Solution (Recommended)
Use Apple’s systemsetup utility to disable sleep at the system level.
Step 1 — Open Terminal
Step 2 — Disable Computer Sleep
Run:
This prevents the entire system from entering sleep mode.
Step 3 — Disable Hard Disk Sleep
Run:
This prevents macOS from idling or powering down storage devices.
Step 4 — Disable Hidden Standby Modes (Recommended)
Run:
These settings prevent macOS from triggering long-idle power transitions.
Verification
Confirm settings were applied:
Expected output should include:
If both values are 0, sleep is fully disabled.
Persistence
✅ System-wide
✅ Persistent across reboots
✅ Applied before user login
✅ Official Apple configuration methods
No scripts or background services are required.
Expected Result
- The Mac will remain fully active
- Storage will not enter idle sleep
- Background services remain responsive
- No disk wake delays occur after inactivity
Notes & Best Practices
- Recommended for Mac minis used as servers or gateways.
- Not recommended for battery-powered laptops.
- Energy consumption will increase slightly since sleep is disabled.
- Safe for SSDs and modern Apple hardware.
Troubleshooting
Re-run verification:
Restart the Mac once after configuration.
Summary
Running the following commands once permanently prevents disk and system sleep:
This configuration is the recommended approach for always-on macOS systems.
