Automated Power-Downs: How to Save Your NAS During a Power Outage
Saurab Thakur A power outage rarely happens when it is convenient. Usually, it happens at 3:00 AM on a Tuesday while you are fast asleep.
If you have a standard “dumb” UPS, it will scream loudly until its battery dies, and then it will abruptly cut power to your entire server rack. If your TrueNAS server was in the middle of writing data to its hard drives when the power was cut, you might wake up to corrupted files or a broken database.
A true “Supervisor” does not just provide battery power; it actively thinks for itself. The UPS Supervisor V2.0 is designed to take the wheel when disaster strikes, ensuring your data survives even if you aren’t awake to hit the buttons.
Here is the story of what exactly happens when the lights go out.
1. Sensing the Outage
The UPS Supervisor is constantly watching the wall outlet using an isolated sensor. The moment the grid goes dark, the Supervisor notices. But it doesn’t panic immediately. We all experience brief 10-second brownouts that come right back online.
The Supervisor enters a highly alert “Wait State.” It starts a stopwatch.
As the minutes tick by, it closely watches the battery voltage. It knows exactly how much juice is left. If the power comes back within a few minutes, the Supervisor simply resets the stopwatch and goes back to its normal routine. Your servers never even knew there was a problem.
2. The Decision to Shut Down
Let’s say it has been 10 minutes. The storm is severe, and the grid isn’t coming back. The heavy battery pack is steadily dropping in voltage.
Once the battery hits a critical floor—say, 12.2 Volts—the Supervisor makes the hard choice: it is time to shut down the rack to protect the batteries and save the data.
But it doesn’t just pull the plug. It orchestrates a delicate, automated ballet.
3. The Graceful Network Commands
The Supervisor is connected to your local network, and it knows exactly where your primary Desktop PC and your TrueNAS server live.
First, it shoots a silent command across the network to your Desktop PC. This command tells Windows to enter “Hibernation.” The PC quickly writes everything you were working on directly to your SSD and powers off. When the power comes back, your PC will wake up exactly as you left it.
Next, it fires an authenticated API call directly into the heart of your TrueNAS server. It tells the server, “The power is failing. Shut down immediately.” The TrueNAS server stops writing data, safely unmounts all your hard drives, and turns itself off.
4. The Waiting Game: Ping Tracking
Here is the smartest part of the system: the Supervisor doesn’t just guess how long the servers take to shut down.
Every three seconds, the Supervisor acts like a submarine, sending out a sonar “Ping” to the PC and the NAS.
Ping… Ping… Ping…
While the PC is saving its RAM to the SSD, the ping returns a success. The Supervisor knows the PC is still awake, so it holds the battery power steady. It will never cut the power while a machine is still thinking.
Eventually, the PC and the NAS finish their shutdown routines. Their motherboards go dark. The next time the Supervisor sends out a ping… silence. The ping fails.
5. The Final Cut
Once the pings fail, the Supervisor knows the servers are safely powered down. Their hard drives are parked, and the data is safe.
Only now, at the very end of the line, does the Supervisor send the physical command to the latching relay. A loud CLICK echoes through the quiet room, and the power to the rack is completely cut.
The massive UPS battery pack is saved from being drained to zero, extending its lifespan by years.
6. The Resurrection
The storm passes. An hour later, the grid power returns. The Supervisor instantly senses the 110V/220V power flowing from the wall.
It re-engages the main relay, providing power back to the rack. But your PC and NAS are still turned off!
No problem. The Supervisor automatically constructs a “Wake-On-LAN” magic packet and fires it across the network. The network cards inside your PC and NAS catch this magical signal, wake up the motherboards, and boot the systems.
You wake up the next morning, sit down at your PC, and everything is running perfectly. You might not even know the power went out.
Conclusion
The difference between a battery backup and a power manager is automation. By combining hardware sensors with network-level intelligence, the UPS Supervisor transforms a terrifying blackout into a smooth, graceful, completely hands-off routine.
Next Steps: What if you want to trigger these shutdowns manually, or perform other complex actions? Next, we will take a tour of the incredible 36-card dashboard that gives you absolute control over your homelab.
Related Articles
From this Series
- 36 Ways to Control Your Homelab: Exploring the UPS Supervisor Dashboard
- Multithreading on a $5 Chip: How Edge Devices Connect to the Cloud
- Under the Hood: The Physical Wiring of the UPS Supervisor
- How a Custom DIY UPS Solves the Biggest Homelab Headaches
- The Ultimate Smart Dashboard: Taking Full Control of Your Home Server Rack
- Split-Brain Microcontrollers: Why One Chip Isn’t Enough for Power Control
- Zero-Trust Homelab Security: Unlocking Encrypted Drives with Cloudflare and an ESP32