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 -t select runs a smart self-test on just one range of sectors

Smart
~/tips/tip-smart-selective-selftest

sudo smartctl -t select,1000000-2000000 /dev/sda

Tests only a suspicious area of a disk instead of the whole surface.

A long self test on a large disk takes many hours. When the log already points at a bad spot, you can have the drive test only that neighbourhood.

Give a first and last LBA, the drive’s block address:

sudo smartctl -t select,1000000-2000000 /dev/sda

Or write it as a start plus a size, which is handy around a single bad address:

sudo smartctl -t select,1500000+10000 /dev/sda

The numbers above are examples. Take yours from the LBA_of_first_error column in smartctl -l selftest. To see how the run is going and what the spans were:

sudo smartctl -l selective /dev/sda

You can also walk a disk in slices. After a first span, -t select,next continues with the range that follows the previous one, so a nightly job can cover a big drive bit by bit without a single long session.

The test only reads, and the drive keeps serving your system meanwhile, though busy disks take longer. It is an ATA feature, so NVMe and some USB bridges won’t accept it. A clean result for one range says nothing about the rest of the surface. If the drive still reports pending sectors, I’d run the full long test too and start thinking about a replacement.

Further reading: smartctl man page

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 -l sataphy /dev/sda All Smart tips (19) All topics

Link