Repository navigation
PhysicalDisk: adds SMART failing status for ATA disks - #2733
Conversation
|
This is out of my knowledge, and I don't have SATA drives to test. I asked AI to review your change. Please address the concerns. PR #2733 review — PhysicalDisk: SMART failing status for ATA disksThanks for the follow-up. I read through all three platform paths and checked the What I verified, so you do not have to re-check it
Blocking1. The performance numbers do not measure the new codeBoth machines used for the timing are NVMe-only, and every added call is behind a To make the claim you need at least one ATA disk attached and a number of the form 2. The Windows corroboration is not independent
Either drop that sentence, or corroborate with an independent source on the same For what it is worth, on my Windows 11 machine (one NVMe disk and one USB 3.
|
76e6282 to
67b38db
Compare
|
You're right, sorry. I was too vague in the PR description about how I tested this. I don't have any SATA hardware, so the SATA path was only tested in QEMU, on an emulated AHCI disk. On macOS it was only compiled; I couldn't run it on a SATA disk. So it has never run on a real SATA drive, and none of the drives I tested ever reported "failing". The performance numbers in the description came from my NVMe-only machines, so they didn't measure the new code either. I'll fix the description: the WMI check isn't independent, so I'll drop it, and I'll use the QEMU numbers instead. About waking up sleeping HDDs: I think yes, on Windows and macOS the check sends a real command to the disk. On Windows I could check the power state first and skip sleeping disks. On macOS, after some research I found that it doesn't have ATA pass-through: the only interface is IOATASMARTInterface, which supports only IDENTIFY and SMART commands, so CHECK POWER MODE can't be sent and there's no reliable way to know if the disk is asleep. smartctl has the same limitation (-n standby isn't supported on macOS). Do you prefer the power-state check on Windows plus a note in the health description for macOS, or just a note for both? |
Summary
Follow-up to #2728 and #2731: with
"health": true, ATA/SATA disks (SSDs and HDDs) now report the drive's own SMART verdict on Linux, Windows and macOS, as discussed in #2726.SATA has no standard wear percentage, so there is no
Health xx%for these disks. The drive's overall SMART status is reported as a new critical warning,failing:criticalWarning(JSON){critical-warning}[]["failing"]failing- Warning: failingnullfailingis the same statussmartctl -Hshows asFAILED!: the drive sets it itself when a pre-fail attribute crosses its vendor threshold. It doesn't depend on the vendor and works for SSDs and HDDs alike. NVMe behaviour is unchanged.Related issue
Closes #2726
Changes
PhysicalDisk (Linux): adds SMART failing status for ATA disksFF_PHYSICALDISK_WARNING_FAILING(bit 6; bits 0-5 stay the NVMe Critical Warning bits) and thefailingwarning nameorg.freedesktop.UDisks2.Drive.Ata: oneGetAllper non-NVMe disk, usingSmartEnabled,SmartUpdatedandSmartFailing(all readable without root)SmartUpdated == 0), same rule as NVMePhysicalDisk (Windows): adds SMART failing status for ATA disksIOCTL_STORAGE_PREDICT_FAILUREon the existingFILE_READ_ATTRIBUTEShandle, only forBusTypeAta/BusTypeSata(HDDs included)FF_DEBUGlinePhysicalDisk (macOS): adds SMART failing status for ATA disksIOATASMARTInterface::SMARTReturnStatus()viakIOATASMARTUserClientTypeID, structured like the existing NVMe SMART codeSMART Capable= true (kIOPropertySMARTCapableKey)Screenshots
Windows 11 Pro (build 26300) in a QEMU VM, with the system disk on an emulated SATA (AHCI) controller, run as a normal user:
The raw IOCTL returns
PredictFailure = 0both as a normal user and as admin. WMIMSStorageDriver_FailurePredictStatus(admin) agrees:PredictFailure False.Linux (Fedora 45 VM, udisks2 2.11.2, emulated SATA disk):
criticalWarning: [], and the default line is unchanged. WithSmartFailingtemporarily forced to true (not in this PR), the line ends with- Warning: failing,{critical-warning}isfailing, and JSON is["failing"]. Virtio disks, DVD drives and zram staynull.Performance (
-s physicaldiskwithhealth: true, median of 31 runs): no measurable change on NVMe-only machines (Linux 1.215 → 1.223 ms, Windows 16.2 → 16.5 ms, both within noise). An ATA disk adds one D-Bus call on Linux, one IOCTL on Windows, and one SMART status call on macOS.Checklist
ctest22/22, NVMe output unchangedctest21/21, NVMe output unchanged (the SATA path isn't triggered there because nothing hasSMART Capable)Not tested: real SATA hardware on any platform, a drive that actually reports
failing, and the macOS SATA path at runtime (I don't have a SATA Mac).