TrueNAS / ZFS Maintenance Guidelines β
1. Overview β
ZFS Scrub β
- Purpose: Scans allocated data and metadata, verifying checksums and repairing any detected errors using redundancy (e.g., mirror).
- Duration: Depends on used data size, disk performance, fragmentation, and workload.
SMART Tests β
- Types:
- Short (few minutes)
- Long / Extended (hoursβvaries by drive size)
- Conveyance (very short, often for transit checks)
- Warning: Should never run on the same day as a scrub or resilver due to high disk load impacting performance and reliability. (TrueNAS Open Enterprise Storage)
2. Expected Durations β
Scrub Duration (Rule of Thumb) β
Approximately 1β2 hours per TiB of used space on healthy disks:
- Example: 1.7 TB β ~3 hours β 4 TB used β ~6.5 hours (TrueNAS Open Enterprise Storage)
- Factors affecting scrub time: fragmentation, metadata layout, concurrent workloads, drive health. (The FreeBSD Forums, TrueNAS Community Forums)
SMART Test Durations β
- Short: usually under 10 minutes (TrueNAS Open Enterprise Storage)
- Long: Several hours and can exceed 24 hours on large disks (e.g., multiple days on 20 TB drives) (TrueNAS Open Enterprise Storage, Reddit)
3. Recommended Frequencies (Community Best Practices) β
| Test Type | Frequency | Notes |
|---|---|---|
| Short SMART | Every 1β7 days | Quick health check (TrueNAS Open Enterprise Storage) |
| Long SMART | Every 1β4 weeks | In-depth surface scan (TrueNAS Open Enterprise Storage) |
| ZFS Scrub | Every 2β4 weeks | Maintains data integrity (TrueNAS Open Enterprise Storage) |
| Weekly Alternate | Alternate scrub and long SMART tests | Two scrubs and two long SMART tests per month (TrueNAS Open Enterprise Storage) |
Community-specific schedules β
Thread schedule:
βI run short SMART tests daily at midnight, long SMART tests weekly at 01:00 Saturdays, and scrubs every other Sunday at midnight.β (TrueNAS Open Enterprise Storage)
Alternate-week schedule:
βShort tests about twice per week. One week: ZFS scrub; next week: long SMART test. Alternate each weekβnever overlap.β (TrueNAS Open Enterprise Storage)
Monthly date-based schedule:
- Scrubs: 1st & 15th at 04:00 (threshold ~10 days)
- Short SMART: 5, 12, 19, 26 @03:00
- Long SMART: 8th & 22nd @04:00
- Avoid scheduling on 28β31 to prevent skipping in shorter months (TrueNAS Open Enterprise Storage)
Modern small-office approach:
- Scrub every 35 days (Sunday midnight)
- Long SMART weekly (Wednesday 19:00)
- Short SMART daily (16:00) (Practical ZFS)
4. Avoiding Yearly Conflicts β
If you schedule scrubs monthly and SMART long tests monthly (e.g., on fixed dates), they may eventually land on the same day. Strategies to prevent conflict:
Alternate weekly schedules
- Week 1: ZFS scrub
- Week 2: SMART long test
- Ensures they never clash and maintains steady coverage (TrueNAS Open Enterprise Storage)
Date offset schedule
- e.g., Scrub on 1st & 15th; Long SMART on 8th & 22nd; Short SMART in between. (TrueNAS Open Enterprise Storage)
Threshold tuning
- Use thresholds (e.g., run scrub when last scrub β₯ 10 days ago) to avoid unintended overlaps (TrueNAS Open Enterprise Storage)
Scripted chaining
- Use
zpool scrub -wto wait for scrub to finish, then trigger SMART test β ensures they never run simultaneously. (Practical ZFS)
- Use
5. Sample Markdown Schedule Template β
TrueNAS Maintenance Schedule β
Recommended Frequencies β
| Task | Frequency | Schedule Example |
|---|---|---|
| Short SMART | Every 1β7 days | Daily at 03:00 |
| Long SMART | Every 2 weeks | Alternate Saturdays at 02:00 |
| ZFS Scrub | Every 2 weeks | Night after long SMART (Sunday) |
Sample Alternating Weekly Schedule β
- Week A:
- Sunday 02:00 β ZFS Scrub (Pool A)
- Monday 03:00 β Short SMART (All disks)
- (No Long SMART this week)
- Week B:
- Sunday 02:00 β Long SMART (All disks)
- Monday 03:00 β Short SMART
- (No Scrub this week)
Repeat every 4 weeks β ensures no overlap and consistent checks.
Tips β
- Never schedule SMART tests and scrubs on the same day β avoid performance conflicts. :contentReference[oaicite:17]
- Tune thresholds lower than desired intervals to compensate for task run time. :contentReference[oaicite:18]
- Consider cooling impact when running tests across many disks simultaneously β stagger SMART tests if needed. :contentReference[oaicite:19]
- After each task, check results via Storage β Disks β [disk] β S.M.A.R.T. Test Results (or via
smartctl). :contentReference[oaicite:20]
6. Final Notes β
- Adjust task times to off-peak hours to minimize impact on users and services.
- Monitor disk health reports and examine SMART test logs regularly.
- If you change pool usage patterns (more data used, slower disks, heavier workload), revisit your schedule and adjust intervals as needed.