smartmontools-disk-health

Inspect disk S.M.A.R.T. health and configure smartd monitoring on NixOS.

4|Updated May 20, 2024
One-click install
npx skills add https://github.com/SpreadZhao/spreadconfig --skill smartmontools-disk-health-spreadzhao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: smartmontools-disk-health
Source: https://github.com/SpreadZhao/spreadconfig/tree/main/skills/local/smartmontools-disk-health
Command: npx skills add https://github.com/SpreadZhao/spreadconfig --skill smartmontools-disk-health-spreadzhao

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Checking disk, SSD, or NVMe health requires root-only smartmontools commands whose output is easy to misread, and setting up continuous smartd monitoring on NixOS involves declarative configuration choices that are hard to get right without guidance. ## Core Features & Use Cases - Health Inspection: Run smartctl device discovery, health checks, error log review, and short or long self-tests with correct sudo handling. - Output Interpretation: Identify high-risk signals such as reallocated sectors, NVMe critical warnings, media errors, and high percentage-used values. - NixOS smartd Configuration: Generate declarative services.smartd modules with autodetect or explicit /dev/disk/by-id devices, then validate with nix eval. - Use Case: A NixOS user suspects a failing NVMe drive; the skill runs smartctl -a, interprets the health log, runs a short self-test, and adds a smartd monitoring module to the system configuration. ## Quick Start Check the S.M.A.R.T. health of all disks on this machine and set up smartd monitoring in my NixOS configuration.

Frequently Asked Questions about smartmontools-disk-health

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check disk health with smartctl on Linux?

Run sudo smartctl -i -H -A -l error -l selftest DEVICE for a concise health report, or sudo smartctl -a DEVICE for a complete report. Use lsblk and sudo smartctl --scan first to identify whole-disk devices rather than partitions.

How do I run a SMART self-test on an NVMe or SATA drive?

First check capabilities and duration with sudo smartctl -c DEVICE, then start a test with sudo smartctl -t short DEVICE or sudo smartctl -t long DEVICE. Read results afterward with sudo smartctl -l selftest DEVICE.

How do I configure smartd monitoring in NixOS?

Enable services.smartd with autodetect set to true for simple monitoring, or set autodetect to false and list explicit devices using /dev/disk/by-id paths with custom options. Validate the change with nix eval before switching the system.

Why does smartctl --scan show no devices or report No such device?

Empty scan output or missing /dev/nvme nodes usually indicate missing root privileges or sandbox restrictions, not absent disks. Run commands with sudo, and in agent contexts use sudo -n so failures surface immediately.

When should I use explicit smartd devices instead of autodetect?

Use explicit devices when USB bridges or RAID controllers require a -d TYPE flag, when removable disks cause noisy errors, or when stable persistent names matter. Autodetect is sufficient for simple fixed-disk setups.