I found how to enable the SCTERC equivalent on an NVMe drive
From: Edward Kuns <hidden>
Date: 2021-11-28 20:22:46
I'm on RHEL 8.5. I don't know how new this feature is, nor what
kernel is required for it to work. However, this command gives the
following output after I've set TLER:
# for drive in /dev/nvme?n? ; do nvme get-feature $drive -f 5 -H ; done
get-feature:0x5 (Error Recovery), Current value:0x000046
Deallocated or Unwritten Logical Block Error Enable (DULBE): Disabled
Time Limited Error Recovery (TLER): 7000 ms
get-feature:0x5 (Error Recovery), Current value:0x000046
Deallocated or Unwritten Logical Block Error Enable (DULBE): Disabled
Time Limited Error Recovery (TLER): 7000 ms
"Feature 5" (-f 5) is TLER. "-H" gives human-readable output. The
nvme command doesn't seem to refer to features by any name, but just
by their hex ID. The values before I set them were all 0. I have
added this block to my /etc/rc.d/rc.local:
# Force NVMe SSDs to play nice with MD
for i in /dev/nvme?n? ; do
if nvme set-feature $i -f 5 -v 70 > /dev/null ; then
echo -n $i " TLER successfully set "
else
echo -n $i " TLER NOT SET "
fi
smartctl -i $i | egrep "(Device Model|Product|Model Number):"
# The default is 256 for my NVMe drives
blockdev --setra 1024 $i
done
(NVMe devices don't seem to have an equivalent of
/sys/block/sda/device/timeout.)
Some of the nvme commands seem to allow permanent setting, but TLER at
least on my drives doesn't allow that.
My spinning hard drives and my non-NVMe SSDs have a default read-ahead
of 8192, so I commented out the blockdev command for those drives. I
assume the goal of that command is to INCREASE the read-ahead?
Here are the versions of packages used:
# rpm -q nvme-cli kernel
nvme-cli-1.14-3.el8.x86_64
kernel-4.18.0-305.el8.x86_64
kernel-4.18.0-305.7.1.el8_4.x86_64
kernel-4.18.0-348.2.1.el8_5.x86_64
Eddie