Some SSDs read data that has not been written for a few months many times more slowly than freshly written data. On the drives measured here, a single read operation requires 10 to 30 ms rather than 0.3 to 0.7 ms, and reading the whole file proceeds at 9 to 30 MiB/s instead of over 1000 MiB/s. SMART shows no media error and no warning, and the data remains intact: it is merely slow.
This repository holds a check for Linux and the measurements behind it: two GIGABYTE AORUS Gen4 7000s with the Phison E18 controller, whose brand has not released the firmware fix that others ship.
This line reads 40 randomly chosen files, each at least 32 MiB in size, from your home directory – specifically the first 32 MiB of each, past the page cache – and prints the age of each file’s data alongside its read speed. It changes nothing and needs no root privileges. To test a different drive, replace ~ with the mount point of that drive. Execute it in bash or zsh.
n=$(date +%s); find ~ -xdev -type f -size +32M -print0 2>/dev/null | shuf -z -n 40 | while IFS= read -r -d '' f; do set -- $(stat -c '%W %Y' -- "$f"); r=$(LC_ALL=C dd if="$f" of=/dev/null bs=1M count=32 iflag=direct 2>&1 | awk '/copied/ {printf "%6.0f MB/s", $1/$(NF-3)/1e6}'); printf '%5d days %s\n' $(( (n - ($1 > $2 ? $1 : $2)) / 86400 )) "${r:- read failed}"; done | sort -n
Which drive and firmware you are using: lsblk -d -o NAME,MODEL,REV
On a healthy drive, all lines exhibit comparable speeds. If files older than a few weeks are read at a small fraction of the speed of newer ones, the drive has the fault. Not every old file is slow, as this depends on how the data was written, so a few fast old files prove nothing. Run the check twice: a single slow line might also come from another program accessing the drive simultaneously.
What the line cannot see and an example of its output are included in the measurements.
stalescan performs the same task with greater thoroughness. It reads a sample of 240 files beneath a directory, drawn from one filesystem only, evenly spread across age groups spanning from less than two weeks to more than two years, and for each file reads the first 4 MiB using O_DIRECT. For each age group, it shows the number of files, the median read speed, and the share of slow files, culminating in a verdict that is also reflected in the exit status. It names the drive beneath the filesystem, including its firmware, even when layered via dm-crypt, LVM, software RAID, btrfs, or ZFS. It needs no root privileges, writes nothing to the drive, and shows file paths solely upon request.
On Arch Linux, obtain it via the AUR (stalescan); on Debian and Ubuntu, use the .deb available in the releases. It is a single Python file requiring only Python 3.9 or newer, so you may also download stalescan.py and execute it using python3 stalescan.py.
stalescan # files below your home directory
stalescan /mnt/data/me # another filesystem: a directory of yours on it
sudo stalescan /mnt/data # as root, name the directory: ~ is root's home
stalescan --paths # also list every file read, with its path
stalescan --report # lines to paste into an issue
--files and --mib determine the number of files it reads and the amount per file; stalescan --help provides a complete list of available options. This is the output generated on the system drive from the measurements, on 28 November 2026:
stalescan 0.1.0
Drive: GIGABYTE GP-AG70S2TB, firmware EIFM31.3, 2.0 TB, NVMe
Temperature: 66 C at the start, 67 C at the end
Filesystem: zfs 2.4.4 on a partition, 68% full
Sample: 240 files, the first 4 MiB of each, read with O_DIRECT, out of
12500 files of at least 4 MiB written in one go; files changed
after they were written do not count (193 of them)
Age of data Files Median MB/s Slow
< 2 weeks 40 1790 0% reference
2-4 weeks 40 1641 0%
4-8 weeks 40 1499 10%
8-13 weeks 40 267 50%
3-6 months 40 668 40%
6-12 months 40 1369 25%
1-2 years 0 - -
> 2 years 0 - -
Slow means below 358 MB/s, a fifth of the median of the reference group, on a
first and a second read.
Verdict: affected. Old data reads much more slowly than fresh data.
50 of 200 files older than 2 weeks are slow, and 0 of 40 fresh files.
Notes:
- 1 read came from a cache, not from the drive, and was left out.
- 159 files stored compressed were left out: the drive delivers less than such
a file holds, so its speed is not the drive's.
- 1 file read slowly once but fast on a second read; such files do not count
as slow (another program probably used the drive).
How it decides. The age of a file’s data is determined by the later of its birth time or its last modification, reflecting the same logic as the line above. Only files written in one go are taken into account: a file altered more than a day after its birth combines older and new blocks under a single timestamp. If the filesystem does not record birth times, all files are included, and stalescan indicates this accordingly. The youngest age group serves as the reference, or the two youngest together if fewer than eight files from the youngest group could be read. A file is deemed slow if it reads at a rate below a fifth of the median rate of the reference group, both during the initial read and on a second read at the end: aged data continues to be slow when accessed repeatedly, whereas delays due to another program do not persist. In cases where the first read filled a cache, as with ZFS before 2.3, the second read takes the last piece of the file instead, which is as old as its beginning; a file for which no second read from the drive can confirm the slowness is classified neither as slow nor as fast. The age groups are read in a random order, so that other drive activity affects each group uniformly.
If more than a tenth of the fresh files read slowly, the drive was busy, and there is no verdict. Otherwise, the verdict is "affected" if an age group older than the reference holds at least three slow files accounting for at least 10 % of that group, or if at least five of all older files and at least 5 % of them are slow, in both cases with old files being slow at least three times as often as fresh ones. Unconfirmed files never result in a drive being labelled "affected", though they may keep the verdict open. "No sign of the fault" requires at least 20 files older than three months and no older age group in which 10 % or more of the files are slow. In all other cases there is no verdict, for instance when fewer than eight files younger than four weeks could be read. The exit status is 0 when there is no sign of the fault, 1 when affected, 2 when there is an error, and 3 when there is no verdict.
What it checks, and what it cannot see. stalescan evaluates each read against the read counters of the block devices beneath the filesystem. A read that the drive did not supply originated in a cache and is excluded: ZFS before 2.3 ignores O_DIRECT, and later versions still serve data already in the ARC from memory. Files stored with compression reducing their size to less than half, and on btrfs any file with compression applied, are also excluded, since the drive transmits far less than the data actually held. On a filesystem mounted without noatime, it omits files and directories not owned by you, as accessing them would write their access time; run it as root to incorporate them, and specify the directory name, since ~ would then refer to root’s home. For the same reason, it does not inspect a filesystem managed by a FUSE program like ntfs-3g unless that filesystem is mounted with noatime or in read-only mode. It gives no verdict for a filesystem located on a loop device, nor for ZFS or btrfs when read counters are not available. Similar to the line above, it cannot detect data rewritten beneath the filesystem (through a balance, via zfs rewrite, or by the drive itself): such data is treated as old yet reads quickly. The same applies to all data after a drive was cloned, a pool resilvered, or data relocated using pvmove or zfs send: everything was rewritten, yet timestamps remain old. A copy made as a reflink or a ZFS block clone is considered recent, despite sharing the original blocks. On a mirror or RAID configuration, reads may come from any member, so the result applies to all members collectively.
- Firmware. Seek a firmware update from the brand of your drive. For the Phison E18, Corsair (EIFM31.7), Kingston (EIFK31.7), and Sabrent (R4PB47.5, via its support) have released one. The table reflects the information provided in their notes.
- Rewriting. Data that is rewritten reads swiftly once more, for some weeks. The cure says how and at what cost.
If you have run stalescan, please open an issue using the measurement form and include the output from stalescan --report. The report holds the model, firmware, and drive size, the filesystem and its level of fullness, the kernel, the drive temperature, and the values per age group, but excludes paths, serial number, and host name. If you utilized the line instead, paste its output alongside the line from lsblk and name the filesystem. Measurements from drives that are functioning normally are just as useful as those from drives that are not.
Stefan Zipproth (acrion)