https://github.com/gopalasubramanium/hdd-power-manager
A simple and effective shell script to manage hard drive power settings on Raspberry Pi and similar Linux-based systems.
https://github.com/gopalasubramanium/hdd-power-manager
hard-drive linux power-management raspberry-pi
Last synced: 2 months ago
JSON representation
A simple and effective shell script to manage hard drive power settings on Raspberry Pi and similar Linux-based systems.
- Host: GitHub
- URL: https://github.com/gopalasubramanium/hdd-power-manager
- Owner: gopalasubramanium
- License: mit
- Created: 2024-11-09T03:54:44.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-11-09T06:53:19.000Z (6 months ago)
- Last Synced: 2025-01-14T02:47:02.994Z (4 months ago)
- Topics: hard-drive, linux, power-management, raspberry-pi
- Language: Shell
- Homepage: https://me.sgopala.com
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.html
- License: LICENSE
Awesome Lists containing this project
README
Drive Power Management Script
🖥️ Drive Power Management Script
This script automates hard drive power management on Linux-based systems (e.g., Raspberry Pi) by configuring drives to spin down when inactive, thereby extending drive lifespan.
📋 Features
-
Drive Detection: Automatically detects connected drives and prompts the user for selection. -
Power Management Configuration:
- Installs and configures
hdparm
,hd-idle
, orsdparm
for automatic spin-down.
- Installs and configures
-
System State Tracking: Captures the initial and final states of drives to verify configuration success. -
Rollback on Failure: Cleans up by uninstalling packages if configuration fails. -
Verification Tests: Ensures configurations are applied and provides a detailed summary.
⚙️ Prerequisites
-
Root Access: Run the script with root privileges. -
Internet Connection: Required to install missing packages.
🚀 Usage
-
Download the Script: Save the script to your desired location. -
Make the Script Executable:
chmod +x drive_manager.sh
-
Run the Script with Root Privileges:
sudo ./drive_manager.sh
🛠️ Configuration Steps
-
Update Repositories: Ensures the latest package versions. -
Drive Detection and Selection: Detects drives and prompts the user for selection. -
Install and Configurehdparm
:
- Installs and configures
hdparm
for standby, spindown, and cache settings. Fallback tohd-idle
if incompatible.
- Installs and configures
-
Install and Configurehd-idle
: Removeshdparm
if installed by the script, then configureshd-idle
. -
Install and Configuresdparm
: Usessdparm
as a last resort for spin-down configuration. -
Verification and Summary: Verifies configurations and provides a summary with pre- and post-execution states.
🔧 Customization
-
Spin-down Time: Customize spin-down times in the script functions. -
Drive Selection: Modify drive detection if using non-standard paths.
📜 License
This script is free for personal and commercial use, modification, and redistribution.
❤️ Support
If you found this project helpful, consider donating via PayPal: [email protected]. Thank you for your support!