brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: smartctl -l scterc shows how long a disk keeps retrying a bad sector

Smart
~/tips/tip-smart-smartctl-l-scterc

sudo smartctl -l scterc /dev/sda

Shows and sets how long a hard disk retries a bad sector before it reports an error.

When a hard disk hits a sector it can’t read, it keeps trying for a while before it gives up and reports the error. In a RAID set, a disk that stays silent too long can get kicked out while it’s still busy retrying. The setting that limits those retries has a different name at every maker: TLER at Western Digital, CCTL at Samsung and Hitachi/HGST, ERC at Seagate. smartctl calls it SCT Error Recovery Control.

To see what a drive is set to:

sudo smartctl -l scterc /dev/sda

You get a read and a write value, in deciseconds, so 70 means 7 seconds. If the drive doesn’t support SCT ERC, smartctl tells you so. To set a limit for both reads and writes:

sudo smartctl -l scterc,70,70 /dev/sda

The man page calls 70,70 the typical value for RAID configurations. A value of 0 disables the limit, and values below 65 are probably not supported.

Persistence is the catch. The man page only promises that the values survive a power-on reset with the ,p variant, -l scterc,70,70,p, and that needs a drive with ATA ACS-4 or newer. On older drives, assume the setting is gone after a power cycle and run the command at every boot; on Unraid that would be a line in /boot/config/go. It’s an ATA-only feature, so it does nothing for NVMe. My advice is to change it only for disks in a real RAID set. A lone disk holding the only copy of your data is better off trying a bit longer.

Further reading: smartctl man page (smartmontools)

More Smart tips sudo nvme smart-log /dev/nvme0 sudo smartctl -q silent -a /dev/sda sudo smartctl -l devstat /dev/sda sudo smartctl -l scttemphist /dev/sda sudo smartctl -t select,1000000-2000000 /dev/sda All Smart tips (19) All topics

Link