Skip to content
Back to skills

Drive Health

BSecurity

Check the media drive's SMART health, temperature and, in a USB enclosure, its link. Use when asked about the hard drive, disk failure risk, disk temperature, or slow disk performance.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 1, 2026
devopsgobashgitapiperformance

Works with

  • api

Security analysis

B88/100
  • criticalSends environment variables or credentials to an external URL

Pro shows the line behind each finding and how to fix it

Scanned October 1, 2026

npx -y skills add bugrauluyurt/homelab-media-stack --skill drive-health --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Drive Health?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Drive Health
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/bugrauluyurt-drive-health/badge)](https://www.skillsdirectory.com/skills/bugrauluyurt-drive-health)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: drive-health
description: Check the media drive's SMART health, temperature and, in a USB enclosure, its link. Use when asked about the hard drive, disk failure risk, disk temperature, or slow disk performance.
---

# Media drive health

Read-only. The media drive is mounted at `STORAGE_MOUNT` (`.env`, default `/mnt/storage`); `smartctl` needs `sudo`.
A drive in a USB enclosure needs `-d sat`; internal SATA and NVMe drives don't.

```bash
STACK=${MEDIA_STACK_DIR:-$(git rev-parse --show-toplevel 2>/dev/null)}; [ -x "$STACK/scripts/stack-health" ] || STACK=~/homelab-media-stack
MOUNT=$(sed -n 's/^STORAGE_MOUNT=//p' "$STACK/.env"); MOUNT=${MOUNT:-/mnt/storage}
SOURCE=$(findmnt -no SOURCE "$MOUNT" | sed 's/\[.*//')
PARENT=$(lsblk -no PKNAME "$SOURCE" | head -1)
DEV=/dev/${PARENT:-${SOURCE#/dev/}}
TYPE=$([ "$(lsblk -dno TRAN "$DEV")" = usb ] && echo "-d sat")
sudo smartctl $TYPE -H "$DEV"
sudo smartctl $TYPE -A "$DEV" | grep -iE 'temp|realloc|pending|uncorr|crc|power_on|start_stop|media_err|percent'
[ -n "$TYPE" ] && cat "/sys/block/${DEV#/dev/}/device/../../../../speed" 2>/dev/null
sudo journalctl -k --since '-7 days' --no-pager | grep -ciE 'uas.*(abort|reset)|reset SuperSpeed|USB disconnect|I/O error'
```

The USB link speed line prints the enclosure's negotiated speed in Mbps (5000 is USB 3); it is
empty for internal drives.

Scrutiny (`http://<host>:3006`, `curl -s localhost:3006/api/summary`) keeps the
same attributes as history, so a trend is visible without sudo.

## Reading it

- **These rising above 0 means failure is approaching:** `Reallocated_Sector_Ct`,
  `Current_Pending_Sector`, `Offline_Uncorrectable`. If you see that, recommend
  replacing the drive calmly.
- **`UDMA_CRC_Error_Count` rising** points to the cable or enclosure, not the disk.
- **Temperature:** under 50 °C is comfortable, 55 °C or more deserves attention,
  and the rated limit is 70 °C.
- **Ignore the large raw values** of `Raw_Read_Error_Rate` and `Seek_Error_Rate`.
  On Seagate they are packed counters; compare the normalized value with the threshold instead.
- **If performance is slow,** check whether qBittorrent is busy before blaming USB.
  Many simultaneous downloads saturate the disk (look at the `%util`-style busy
  figure in `/proc/diskstats`).

If the drive dies, only media is lost, and that can be re-downloaded. Settings live on the
system disk and are backed up nightly to this drive.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…