Skip to main content
Community Scripts logo
Skip to Content
Tools & Add-onsPVE Tools

PVE Disk Health Tool

Print a SMART health summary for every physical disk of the host and optionally start a short self-test.

disk-health.sh reads the SMART data of each disk and prints the values that matter for spotting a failing drive.

Website entry: disk-health. Source: tools/pve/disk-health.sh.

Run

In the Proxmox VE host shell, as root:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/disk-health.sh)"

The script exits with 1 if it is not run as root or if pveversion is missing.

What it installs

PackageWhenIf the installation fails
smartmontoolssmartctl is missingThe script exits with 1.
nvme-clinvme is missingIt continues with a notice.

Report

Disks are taken from lsblk (type disk, without loop, zram and dm- devices). For each one the script prints path, size, model and:

Disk typeValues
AllOverall result of smartctl -H: green for PASSED or OK, red otherwise, or "SMART not available for this device".
NVMeThese lines from smartctl -A: Temperature, Available Spare, Percentage Used, Data Units Written, Power On Hours, Unsafe Shutdowns, Media and Data Integrity Errors.
SATA/SASTemperature_Celsius, Power_On_Hours, Wear_Leveling_Count (or Media_Wearout_Indicator), and Reallocated_Sector_Ct, Current_Pending_Sector, Offline_Uncorrectable, UDMA_CRC_Error_Count. The last four are printed red when greater than 0.

Prompts

DialogChoicesEffect
"SMART Self-Test"Yes / NoNo ends the script.
"Select Disk for Short Self-Test" (radio list)One diskRuns smartctl -t short /dev/<disk>. The test runs in the background on the drive.

Read the result later with:

smartctl -a /dev/sda

Environment variables

VariableDefaultPurpose
COMMUNITY_SCRIPTS_CORE_URLhttps://raw.githubusercontent.com/community-scripts/core/mainBase URL for core/core.func and api/api.func.

Limits

  • The report is a snapshot on screen. Nothing is logged and no monitoring or alerting is set up.
  • A disk for which smartctl -H returns no health line is shown as "SMART not available for this device".
  • The printed number is the raw value of each attribute. Vendors encode some raw values differently, so compare with smartctl -a when a figure looks implausible.
  • The installed packages stay on the host.