Skip to content

Instantly share code, notes, and snippets.

@fluffy-cakes
Created December 17, 2025 10:43
Show Gist options
  • Select an option

  • Save fluffy-cakes/f5224ab6be43353aa62045957a8b4c2e to your computer and use it in GitHub Desktop.

Select an option

Save fluffy-cakes/f5224ab6be43353aa62045957a8b4c2e to your computer and use it in GitHub Desktop.

Hard Drive Spindown on OMV with USB Enclosures: Complete Solution

Hardware Setup

System Configuration

  • Host: Raspberry Pi 5 (8GB RAM)
  • Operating System: OpenMediaVault running on Raspberry Pi OS Lite x64
  • Storage Enclosure: ICY BOX IB-RD3640SU3 USB 3.0 4-Bay RAID Enclosure (configured as JBOD, not RAID)
  • Storage Disks: Seagate IronWolf 8TB (Model: ST8000VN004) × 4
  • Filesystem: NTFS (formatted in Windows)
  • Connection: Direct USB 3.0 to Raspberry Pi 5

About This Setup

This configuration represents a common NAS/home media server setup using ARM-based single-board computers. The Raspberry Pi 5 provides CPU, networking, and USB connectivity, while the ICY BOX IB-RD3640SU3 enclosure manages four large-capacity Seagate IronWolf drives through a USB bridge interface in JBOD mode (no RAID overhead).

Important Note: This guide applies to any similar setup with:

  • Raspberry Pi versions: 4, 5 (any model with USB 3.0)
  • Other ARM hosts: ODROID, Rock Pi, or x86 Linux systems
  • Any RAID/JBOD enclosure: WD DAS, UGREEN, Seagate Desktop Expansion, Mediasonic, etc.
  • Any SATA drives: WD Red, Seagate IronWolf, Seagate Barracuda, Samsung, etc.
  • Any filesystem: NTFS, ext4, Btrfs, ZFS, etc.

The solution is not specific to this exact hardware—it's a fix for the fundamental incompatibility between OMV 7+ and USB-attached storage, particularly when drives don't automatically spindown despite GUI settings.


Problem Statement

When setting spindown timers in OpenMediaVault's GUI for USB-connected drives (ICY BOX IB-RD3640SU3 enclosure with Seagate IronWolf drives), the drives would enter a shallow standby state (audible click) but would not perform a full, dramatic spindown with audible platter deceleration. Manual commands like hdparm -y worked perfectly, but automated timer-based spindown did not.

Typical User Experience:

  1. Open OMV GUI → Storage > Disks
  2. Select a USB-attached drive
  3. Set spindown time to 5 minutes, APM to 127
  4. Save settings
  5. Wait 5+ minutes with no disk activity
  6. Hear a brief click sound (heads parking)
  7. No audible spindown of platters (no gradual wind-down sound)
  8. Run hdparm -C → shows "standby" (technically correct, but not full spindown)
  9. Manually run hdparm -y → immediately hear dramatic spindown with audible platter deceleration (exactly what we want)

Root Causes Identified

1. OMV 7+ Spindown Service is Broken for USB Drives

The Problem:

  • OMV 7+ switched from hdparm to smartctl for managing disk power settings
  • The smartctl-hdparm.service writes configuration files to /etc/smartmontools/hdparm.d/ but does not properly apply them to USB-attached drives
  • Users report: manual commands work, but automatic timer-based spindown never triggers
  • This is a known issue in OMV forums with no fix in the current release

Evidence: When checking the service status after setting spindown via GUI:

sudo systemctl restart smartctl-hdparm.service

You'll see errors in the logs like:

AAM disable failed: scsi error aborted command
APM enable failed: scsi error aborted command
Standby timer set to 0 (disabled or vendor-specific)

This means the USB bridge firmware rejects SCSI-based power commands that OMV's smartctl is sending.

2. USB Bridge Firmware Limitation

The Core Issue: The ICY BOX IB-RD3640SU3 (and similar USB RAID/JBOD enclosures) implement a partial SCSI-to-ATA translation layer:

  • Accepts: Basic ATA commands (identify, status queries, immediate spindown)
  • Rejects: Timer-based power management commands through SCSI interface
  • Default behavior: When any spindown occurs via SCSI, firmware uses power condition 0 (shallow idle) instead of power condition 3 (full standby)

Why This Matters:

  • Power Condition 0: Parks heads, reduces spindle RPM slightly, minimal power reduction → light click sound
  • Power Condition 3: Full platter spindown to 0 RPM, maximum power reduction → dramatic spin-down sound with audible deceleration

Why -y Works: The hdparm -y command sends an immediate ATA STANDBY command directly to /dev/sdX:

  • Bypasses the SCSI translation layer entirely
  • Goes straight to the drive firmware
  • Results in full power condition 3 behavior
  • Produces the dramatic spindown sound

3. OMV GUI Settings Don't Actually Enforce Spindown

GUI Location and Path:

  1. Main Menu: Click on Storage in the left sidebar
  2. Sub-menu: Click on Disks
  3. Disk List: You'll see a table of all detected disks with columns showing device name, size, and action buttons
  4. Find Your Disk: Locate the USB-attached disk you want to configure (look for ICY BOX devices or check by size/model)
  5. Edit: Click the pencil/edit icon on the right side of the disk row
  6. Edit Dialog Opens: A popup window appears with these settings:

Settings You'll See in the Edit Dialog:

  • Advanced Power Management (APM) - Dropdown menu
    • Values range 1-254
    • <128 = power saving enabled (allows spindown)
    • 128 = performance mode (prevents spindown)

    • Default: Often 254 (performance mode)
  • Automatic Acoustic Management (AAM) - Optional, depends on drive support
    • Controls acoustic behavior during head movement
    • Usually disabled or set low on external drives
    • Not related to spindown behavior
  • Spindown Time (ST) - Dropdown or input field
    • Values typically 3 to 330 minutes
    • This is the setting that fails on USB drives
    • Sets how long after idle before spindown should trigger
  • Write Cache - Enable/disable
    • Performance vs safety trade-off
    • Completely unrelated to spindown
  1. Save: Click the Save button

What Happens Behind the Scenes: After you click Save in the GUI:

  1. OMV reads your settings
  2. Generates a shell script with smartctl commands
  3. Writes it to /etc/smartmontools/hdparm.d/[uuid-based-filename]
  4. The file contains commands like:
    smartctl --set=aam,off --set=apm,1 --set=standby,off /dev/disk/by-id/ata-ST8000VN004-XXXXX
  5. The smartctl-hdparm.service attempts to apply these at startup/wake
  6. The USB bridge firmware silently ignores the timer-based spindown commands
  7. Timer-based spindown never actually triggers as configured
  8. Only manual hdparm -y commands work as expected

Why GUI Settings Fail on USB Enclosures: The GUI/smartctl uses the SCSI command path (through the USB bridge firmware layer), which:

  • Accepts and applies APM value changes (you see APM levels change)
  • Rejects timer-based spindown commands (the actual problem)
  • Defaults to shallow power condition 0 if any spindown occurs anyway
  • Never achieves the full spindown behavior users expect

Confirmation This is Your Issue: Check your config files:

cat /etc/smartmontools/hdparm.d/*

You'll see smartctl commands being generated, but they're not producing the desired effect.


Advanced Power Management (APM) Explained

What APM Does

APM is a disk power-saving feature with values 1-254:

  • Values 1-127: Aggressive power saving enabled (drives CAN spindown)
  • Values 128-254: Performance mode (drives stay spinning, full power always)

Critical Discovery

  • OMV requires APM < 128 for spindown to have any chance of working
  • However, even with correct APM settings, timer-based spindown still fails on USB enclosures
  • This is because the USB bridge rejects the SCSI commands that carry the timer information

Why APM Alone Isn't Enough

APM only puts the drive in a power-saving state, but doesn't force actual spindown. The firmware still needs a spindown command to execute:

  • On direct SATA connections: APM + timer works fine
  • On USB enclosures: APM enables the capability, but the timer command is rejected by the bridge

The Solution: hd-idle Daemon

What hd-idle Does

hd-idle is a lightweight user-space daemon that:

  1. Monitors disk I/O activity in real-time using /proc/diskstats
  2. Detects when a disk has been truly idle for your specified time (not firmware guessing)
  3. Issues an immediate ATA spindown command (equivalent to manual hdparm -y)
  4. Bypasses the broken OMV service entirely
  5. Works with any SATA drive in any USB enclosure

Why hd-idle Works Where OMV Fails

Method Command Type Path USB Bridge Support Result
OMV GUI SCSI (via smartctl) SCSI bridge layer ❌ Rejected Shallow standby (click only)
smartctl direct SCSI immediate SCSI bridge layer ⚠️ Works once only Works but no persistence
hdparm -y ATA (direct) Direct to /dev/sdX ✅ Works Full spindown (dramatic sound)
hd-idle ATA (direct) Direct to /dev/sdX ✅ Works Full spindown (dramatic sound)

Key Insight: hd-idle sends commands directly to /dev/sdX using ATA protocol, bypassing the SCSI bridge layer entirely. This is why it works where smartctl fails.

Key Configuration Parameters

HD_IDLE_OPTS="-i 0 -a sdb -i 900 -c ata -a sdc -i 900 -c ata -a sdd -i 900 -c ata -a sde -i 900 -c ata -l /var/log/hd-idle.log"

Breaking this down:

  • -i 0: Default idle time (ignored when -a is used)
  • -a sdb: Monitor specific device sdb
  • -i 900: Idle time 900 seconds (15 minutes)
  • -c ata: Use ATA commands (NOT SCSI) — this is the critical flag
  • -l /var/log/hd-idle.log: Log all activity for troubleshooting

Critical Flag: -c ata forces hd-idle to use ATA commands instead of SCSI. Without this, hd-idle also defaults to shallow power condition 0 and produces only the click sound.

Compatibility Notes

Tested and Working On:

  • Raspberry Pi 4, 5 with OMV and Raspberry Pi OS Lite
  • ODROID-H3, H3+, H4
  • Other ARM Linux systems with USB 3.0
  • x86/x64 Linux systems with USB SATA adapters
  • All SATA drive types (WD Red, WD Purple, Seagate IronWolf, Seagate Barracuda, Samsung, etc.)
  • All RAID/JBOD enclosure types (ICY BOX IB-RD3640SU3, UGREEN, WD DAS, Seagate Desktop Expansion, Mediasonic, etc.)
  • All filesystems (NTFS, ext4, Btrfs, ZFS, exFAT, etc.)

Should Work On:

  • Any Linux system with /proc/diskstats support
  • Any external USB SATA drive or enclosure
  • Any RAID enclosure with USB interface (though full RAID management preferred over JBOD)

Setup Instructions

Prerequisites

Ensure you have a clean slate with no conflicting services:

sudo systemctl stop hdparm-spindown.service 2>/dev/null || true
sudo systemctl disable hdparm-spindown.service 2>/dev/null || true
sudo systemctl stop smartctl-hdparm.service 2>/dev/null || true
sudo systemctl disable smartctl-hdparm.service 2>/dev/null || true

Step 1: Clean Old Configurations

# Backup existing hdparm.conf
sudo cp /etc/hdparm.conf /etc/hdparm.conf.backup

# Clear the file (keep only comments)
sudo bash -c 'cat > /etc/hdparm.conf << EOF
# /etc/hdparm.conf - Cleaned for hd-idle
# All spindown managed by hd-idle daemon
EOF'

# Remove OMV-generated smartctl scripts
sudo rm -f /etc/smartmontools/hdparm.d/*

# Remove spindown cron jobs
sudo rm -f /etc/cron.d/spindown*
sudo rm -f /etc/cron.d/hd-idle*

# Kill any existing hd-idle processes
sudo pkill -f hd-idle || true

Step 2: Install hd-idle

sudo apt-get update
sudo apt-get install -y hd-idle

Step 3: Configure hd-idle

Edit the configuration file:

sudo nano /etc/default/hd-idle

Replace the entire HD_IDLE_OPTS line with (for 4 drives):

START_HD_IDLE=true
HD_IDLE_OPTS="-i 0 -a sdb -i 900 -c ata -a sdc -i 900 -c ata -a sdd -i 900 -c ata -a sde -i 900 -c ata -l /var/log/hd-idle.log"

For different numbers of drives:

2 drives:

HD_IDLE_OPTS="-i 0 -a sdb -i 900 -c ata -a sdc -i 900 -c ata -l /var/log/hd-idle.log"

3 drives:

HD_IDLE_OPTS="-i 0 -a sdb -i 900 -c ata -a sdc -i 900 -c ata -a sdd -i 900 -c ata -l /var/log/hd-idle.log"

5+ drives: Add additional -a sdX -i 900 -c ata pairs as needed.

Adjust idle time as needed:

  • 60 seconds: -i 60 (testing only)
  • 300 seconds: -i 300 (5 minutes)
  • 600 seconds: -i 600 (10 minutes)
  • 900 seconds: -i 900 (15 minutes)
  • 1800 seconds: -i 1800 (30 minutes)

Step 4: Enable and Start

sudo systemctl daemon-reload
sudo systemctl enable hd-idle
sudo systemctl start hd-idle

Step 5: Verify

sudo systemctl status hd-idle
cat /etc/default/hd-idle

You should see the service is active (running).


Testing and Verification

Quick Status Check

# Check if service is running
sudo systemctl status hd-idle

# View configuration
cat /etc/default/hd-idle

# Check current drive states
sudo hdparm -C /dev/sdb /dev/sdc /dev/sdd /dev/sde

Wait Test (Recommended - Best Way to Verify)

  1. Ensure no disk activity for your configured idle time
    • Don't access any files on your media/shares
    • Check with: sudo iostat -x 1 3 /dev/sdb
  2. Listen carefully for the spindown sound
    • First you may hear a brief clicking sound (heads parking)
    • Then you'll hear a gradual wind-down sound (platters decelerating)
    • Duration: typically 2-5 seconds of audible deceleration
  3. Verify standby state:
    sudo hdparm -C /dev/sdb /dev/sdc /dev/sdd /dev/sde
    Should show: drive state is: standby for all disks

Monitor Real-Time Activity

sudo tail -f /var/log/hd-idle.log

You'll see entries like:

2025-12-17T20:15:30 sdb spindown
2025-12-17T20:15:30 sdc spindown
2025-12-17T20:15:30 sdd spindown
2025-12-17T20:15:30 sde spindown

This confirms the daemon detected idle and issued spindown commands.

Force Immediate Spindown (for testing without waiting)

sudo hd-idle -t sdb

This forces sdb to spindown immediately without waiting for the idle timer. You should hear the full spindown sound immediately.


What NOT to Do (Red Herrings We Avoided)

❌ Don't Rely on OMV GUI Spindown Settings

  • They don't work for USB drives on OMV 7+
  • Even if settings appear to save and show in the GUI, the service that applies them is broken
  • GUI changes to spindown time settings are silently ignored
  • This is a known regression with no fix in current OMV releases

❌ Don't Use smartctl Commands for Timer-Based Spindown

  • smartctl --set=standby,XX works only for immediate spindown
  • It doesn't set a persistent timer
  • For USB bridges, smartctl commands go through SCSI layer which rejects power-related settings
  • Use hdparm -y for immediate, or hd-idle for automatic

❌ Don't Try to Use -S Timer Setting Alone

  • hdparm -S 24 or similar sets a firmware timer
  • On USB bridges, this firmware timer defaults to shallow power condition 0
  • Results in click sound only, not full spindown
  • Won't achieve the dramatic spindown you're looking for

❌ Don't Rely on Power Condition Settings via SCSI

  • sdparm --command=stop --power=3 won't work on USB bridges
  • The bridge firmware doesn't support SCSI power condition commands
  • Must use ATA commands instead (which hd-idle does automatically)

❌ Don't Leave OMV's smartctl-hdparm.service Running

  • It will conflict with hd-idle
  • It sends rejected SCSI commands
  • It may cause unexpected behavior
  • Always disable it when using hd-idle

Troubleshooting

Drives Not Spinning Down After Idle Time

Check 1: Is hd-idle running?

sudo systemctl status hd-idle
sudo ps aux | grep hd-idle

Should show the process running with your configuration.

Check 2: Is there continuous disk activity?

sudo iostat -x 1 5 /dev/sdb /dev/sdc /dev/sdd /dev/sde

Look for non-zero r/s (reads/sec) or w/s (writes/sec) values. If any show activity, something is constantly accessing the disks (OMV background services, monitoring tools, logs, etc.).

Check 3: Are you using ATA commands?

cat /etc/default/hd-idle | grep HD_IDLE_OPTS

Must contain -c ata for each device. If missing, add it and restart.

Check 4: Check the log for errors

sudo tail -30 /var/log/hd-idle.log

Look for error messages or spindown events.

Check 5: Verify device names

lsblk

Make sure device names in your configuration match actual devices. Common issue: assuming /dev/sdb when your drive is actually /dev/sdc.

Drives Spindown But No Sound

The drives are entering standby but using shallow power condition. This means:

  • hd-idle is using SCSI commands instead of ATA
  • Missing -c ata flag in configuration
  • Fix:
    sudo nano /etc/default/hd-idle
    # Add -c ata after each -i value
    sudo systemctl restart hd-idle

Service Won't Start

Check for syntax errors:

/usr/sbin/hd-idle -i 0 -a sdb -i 900 -c ata -l /var/log/hd-idle.log

Run it directly to see error messages. Common issues:

  • Invalid device name (use lsblk to verify sdb/sdc/etc. exist)
  • Permission issues (must run with sudo)
  • Invalid idle time value (must be numeric)

hd-idle Log Shows "no such file or directory"

cannot spindown scsi disk sdb:
open sdb: no such file or directory

This usually means:

  • Device /dev/sdb doesn't exist or isn't accessible
  • You removed the disk or disconnected it
  • Use lsblk to check current device names
  • Update your configuration with correct device names

Changing Idle Time

To adjust idle time after initial setup:

# Change all instances of -i 900 to your desired value
# Example: change to 10 minutes (600 seconds)
sudo sed -i 's/-i 900/-i 600/g' /etc/default/hd-idle

# Restart the service
sudo systemctl restart hd-idle

# Verify
cat /etc/default/hd-idle

Performance and Power Considerations

Power Consumption Impact

With hd-idle spindown working correctly:

  • Active (spinning): 5-8W per 8TB drive (typical 3.5" SATA)
  • Idle (fully spun down): 0.2-0.5W per drive
  • Shallow standby (click only): 3-6W per drive

For a 4-drive 8TB setup with 15-minute idle:

  • Before (shallow standby): ~16-24W always
  • After (full spindown): ~1-2W most of the time

Annual Power Savings: ~$15-30 USD depending on electricity rates and idle time patterns

Drive Lifespan Considerations

Spindown Cycles:

  • Full spindown adds one spinup/spindown cycle per idle period
  • Modern SATA drives (WD Red, IronWolf) rated for 50,000-100,000+ spinup cycles
  • With 15-minute idle, a drive reaches that limit in ~50+ years of continuous 24/7 operation
  • No practical concern for home use

Recommendation: 15 minutes is a good balance between power savings and wear.


Summary

What was broken:

  • OMV 7+ GUI spindown settings don't apply to USB drives
  • smartctl sends SCSI commands that USB bridge firmware rejects
  • Firmware timer defaults to shallow power condition instead of full spindown

What works:

  • hd-idle daemon with -c ata flag
  • Monitors real disk I/O activity, issues ATA commands directly
  • Produces full dramatic spindown sound
  • Completely independent of broken OMV service
  • Works on any SATA drive in any USB enclosure (NTFS, ext4, or any filesystem)

The configuration that worked:

HD_IDLE_OPTS="-i 0 -a sdb -i 900 -c ata -a sdc -i 900 -c ata -a sdd -i 900 -c ata -a sde -i 900 -c ata -l /var/log/hd-idle.log"

Key takeaway: Always use -c ata with hd-idle on USB enclosures. SCSI commands won't give you full spindown behavior.


Additional Resources

  • hd-idle GitHub: https://github.com/adelolmo/hd-idle
  • hd-idle Man Pages: man hd-idle (after installation)
  • OMV Forum Spindown Issues: Search "OMV spindown USB" for similar reports
  • hdparm Documentation: man hdparm (for reference)

Author Notes

This guide was developed through hands-on troubleshooting of a Raspberry Pi 5 running OMV on Raspberry Pi OS Lite with an ICY BOX IB-RD3640SU3 enclosure and Seagate IronWolf 8TB drives (in JBOD mode). The NTFS filesystem and large capacity drives present additional complexity, but the solution applies universally to any Linux system with USB-attached SATA storage.

The -c ata flag is absolutely critical for USB bridges that default to shallow spindown behavior. Without it, you'll get the click sound but not the full dramatic spindown. With it, you get exactly the behavior you expect.

If you found this guide helpful or have additions/corrections based on your own hardware setup, please share your experience with the OMV community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment