camcontrol
instead of
hdparm -R
Originally written .
Last updated .
See revision history below.
Hard disk drives (HDDs) can only really catch bad disk sectors during read-time and not during write-time, according to [source 2]. Furthermore, catching bad disk sectors is more easily corrected, if the disk controller still knows what data should go into the broken sector.
ATA8 feature write-read-verify (WRV) seems to offer a solution on the HDDs that support it. The disk controller reads sectors back that were just written and compares them to the write cache. It still knows what data it should be seeing and can compare to what it is actually seeing. The price is higher latency, sometimes even double the latency. The upside is that S.M.A.R.T. error counts and OpenZFS read-error accounting might be triggered early. On the whole, this seems to eliminate fragility in long-term data storage.
Assumptions: SATA hard disk drive (HDD) on
FreeBSD 13 named ada0.
Sufficient privileges like root privileges must
be available.
For SAS or SCSI drives instead of SATA, see
[source 3], instead.
For Linux instead of FreeBSD, see
hdparm(1)
with option
-R
, instead.
To activate desirable write-read-verify (WRV) level 0 run the following snippet at the command line:
camcontrol cmd ada0 -a "EF 0b 00 00 00 00 00 00 00 00 00 00" -v ;
To activate write-read-verify (WRV) level 2 run the following snippet at the command line:
camcontrol cmd ada0 -a "EF 0b 02 00 00 00 00 00 00 00 00 00" -v ;
To deactivate write-read-verify (WRV) run the following snippet at the command line:
camcontrol cmd ada0 -a "EF 8b 00 00 00 00 00 00 00 00 00 00" -v ;
To read, check availability of and validate the setting of SATA feature write-read-verify (WRV) run one of the following snippets at the command line:
camcontrol identify ada0 ;
smartctl --identify=wb /dev/ada0 ;
"
write-read-verify"
.
Date | Notes |
---|---|
Add smartctl
--identify=wb call and reference
to ATA8 standard. | |
Original writeup. |