Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

smartd: "Currently unreadable (pending) sectors" on a Linux disk: what to check first

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

When smartd logs Device: /dev/sda, 8 Currently unreadable (pending) sectors, the disk has told smartd that some sectors could not be read and are waiting to be replaced with spare sectors. The data in those sectors is unreadable now. Check the disk's health, attributes and self-test log, copy the data you cannot lose, and plan to replace the disk if the count stays above zero or rises.

What the symptom means

smartd polls each disk it monitors. For ATA disks it reads SMART attribute 197 (Current Pending Sector Count) by default. The message text comes from the smartd source code (release 7.3), not from a manual page. The source builds the line from the format "Device: %s, %" PRId64 " %s", where the first %s is the device name, the number is the raw count of attribute 197, and the last %s is the message text. For the default setting the text is Currently unreadable (pending) sectors. The line is logged at critical level. When the previous count was above zero and the count has changed, the source appends the format " (changed %+" PRId64 ")", which gives (changed +16) or (changed -3) style endings.

The smartd.conf manual page defines the terms. Under the -C directive it says: "A pending sector is a disk sector (containing 512 bytes of your data) which the device would like to mark as "bad" and reallocate. Typically this is because your computer tried to read that sector, and the read failed because the data on it has been corrupted and has inconsistent Error Checking and Correction (ECC) codes." It adds: "This is important to know, because it means that there is some unreadable data on the disk."

A related message, Offline uncorrectable sectors, comes from attribute 198 (the -U directive). The manual describes it as "a disk sector which was not readable during an off-line scan or a self-test."

The manual says the warning email counter resets when the pending count falls to 0, which "typically happens when all pending sectors have been reallocated or could be read again."

Likely causes

Cause What you see How to confirm
Media error found when a read failed Attribute 197 raw value above 0; smartd message after an application or backup read error smartctl -A shows the raw value; smartctl -l error may list read errors
Sectors found during an offline scan or self-test Attribute 198 above 0; a self-test that did not complete without error smartctl -l selftest shows a failed test and the first error LBA
Count stays high after the sectors were rewritten 197 does not return to 0 although reads now succeed smartd.conf manual: "Some disks do not reset this attribute when a bad sector is reallocated"; compare with a fresh read of the affected files
Disk behind a RAID controller or bridge /dev/sda is a logical volume, or SMART values look wrong smartctl needs a -d TYPE option for the controller; see the smartctl manual

Prove the cause before changing anything

These commands only read from the disk. Replace /dev/sda with your device.

1. Overall health.

smartctl -H /dev/sda

The manual says a failing result "means either that the device has already failed, or that it is predicting its own failure within the next 24 hours", and to "get your data off the disk and to someplace safe as soon as you can."

2. The attributes.

smartctl -A /dev/sda

Find attributes 197 and 198 (and 5, Reallocated_Sector_Ct, which smartd's own example message names). Read the RAW_VALUE column. A raw value of 0 for 197 and 198 is a good result. A raw value above 0 means unreadable sectors exist. The manual notes that each vendor converts raw values to normalised values its own way. Read the raw value for 197 and 198 here.

3. The error and self-test logs.

smartctl -l error /dev/sda
smartctl -l selftest /dev/sda

The self-test log shows "the type of test (short or extended, off-line or captive) and the final status of the test", the hours of disk lifetime when it ran, and, if errors were detected, "the Logical Block Address (LBA) of the first error".

4. The pending defects log, where the disk has one.

smartctl -l defects /dev/sda

The manual says this prints LBA and hours values from the ATA Pending Defects log, introduced in ACS-4, so older disks do not have it.

5. The smartd history. smartd writes to syslog, "typically /var/log/messages or /var/log/syslog". Search that file for smartd and note when the count first appeared and each (changed ...) figure.

6. Controller check. If the disk is a virtual drive from a hardware controller, run smartctl -a with the -d type the smartctl manual lists for that controller, for example -d megaraid,0, because plain /dev/sda may describe the controller's logical volume rather than a physical disk.

Optional: run a self-test

A self-test reads the disk and can find more unreadable sectors. The manual says "A running self-test can, however, degrade performance of the drive."

First save the current SMART report:

smartctl -a /dev/sda > /root/smart-sda-before-2026-11-22.txt

Risk: the next command starts a short self-test on a disk that is already reporting unreadable sectors, and it adds read load that can slow the server's own I/O while it runs.

smartctl -t short /dev/sda

The manual says the short test usually runs "under ten minutes" and that results appear in the log read with -l selftest. A long test (-t long) takes "tens of minutes to several hours".

To back out, abort the test with smartctl -X /dev/sda. The manual says this "Aborts non-captive SMART Self Tests." Then read smartctl -l selftest /dev/sda to see the status.

Fix

The manual states the choices: "Depending upon the type of problem, you may want to run self-tests on the disk, back up the disk, replace the disk, or use a manufacturer's utility to force reallocation of bad or unreadable disk sectors."

Media error: protect the data, then replace the disk

Copy first. A disk that returns read errors can get worse, so take a full copy or a current backup before you test further or run any repair. The guide titled "A failing disk in a Linux server: image it before you repair it" covers imaging with ddrescue. If the disk is a member of a software RAID array, read "Linux software RAID after a server fails: assembling mdadm arrays on replacement hardware" before touching the array.

The smartd.conf manual explains why not to rely on a rewrite: "You can typically force the sector to reallocate by writing to it (translation: make the device substitute a spare good sector for the bad one) but at the price of losing the 512 bytes of data stored there." It also says that working out which file owns a bad sector "is operating system and file system specific."

If attribute 197 or 198 keeps rising, or the health result fails, plan the replacement of the disk. The unreadable data stays unreadable either way.

Count stuck after reallocation: change how smartd reports it

If a fresh read of the data succeeds and the count does not return to 0, the manual's -C ID+ form reports only when the number of pending sectors has "increased between two check cycles", and the manual says "Some disks do not reset this attribute when a bad sector is reallocated." The same applies to -U ID+ for attribute 198.

First check that the file exists. The manual says that "In the absence of a configuration file smartd will try to open all available devices", so if the listing below shows no file, stop here: creating a file would change which disks smartd monitors.

ls -l /etc/smartd.conf

If the file exists, save the current file:

cp -p /etc/smartd.conf /etc/smartd.conf.2026-11-22

Risk: the next edit changes which disk problems smartd reports, and the signal after it makes smartd reload the file. A rising count that would have raised a warning each cycle now raises one only when it increases, so a disk that stays at a bad but steady value stops generating warnings.

If the first entry in the file is DEVICESCAN, the file has no line for the disk, and the manual says that smartd "will ignore any remaining lines in the configuration file" after it. Put the disk's own line above DEVICESCAN. To apply the directives to every disk instead, put them after DEVICESCAN; the manual says it "may optionally be followed by Directives that will apply to all devices that are found in the scan."

Edit the line for the disk in /etc/smartd.conf. The manual says -a turns on -H, -f, -t, -l error, -l selftest, -l selfteststs, -C 197 and -U 198, so replace -a with the same directives and the + forms of the last two, for example:

/dev/sda -H -f -t -l error -l selftest -l selfteststs -C 197+ -U 198+

Keep any -m, -s or -d directives already on the line.

With the + form the message text changes. In the 7.3 source the -C 197+ text is Total unreadable (pending) sectors, so the log line reads Device: /dev/sda, 24 Total unreadable (pending) sectors, and the -U 198+ text is Total offline uncorrectable sectors. Update any log search or alert that looks for Currently unreadable (pending) sectors.

The manual says smartd re-reads the file on a HUP signal, and that if the file then has a syntax error smartd "will print an error message and then continue, ignoring the contents of the (faulty) configuration file". Send the signal, then read the smartd lines in the system log to see whether the file was accepted:

killall -HUP smartd

To back out, first test that the saved copy exists:

ls -l /etc/smartd.conf.2026-11-22

Only if the listing shows the saved copy, put it back under its own name and send the signal again:

cp -p /etc/smartd.conf.2026-11-22 /etc/smartd.conf
killall -HUP smartd

Example (illustrative): On web01, smartd logs Device: /dev/sda, 8 Currently unreadable (pending) sectors at 02:10 after the nightly backup. smartctl -H /dev/sda passes. smartctl -A /dev/sda shows attribute 197 with a raw value of 8 and attribute 198 with 0. The short self-test log shows one failure with a first-error LBA. A day later smartd logs 24 sectors with (changed +16), because 24 - 8 = 16. The administrator copies the data to another host, books the disk for replacement, and keeps the 197 count under watch until the disk is out.

Confirm the fix

  1. After the disk is replaced, smartctl -A on the new disk shows raw values of 0 for attributes 197 and 198.
  2. smartctl -H passes and smartctl -l selftest shows a completed test without errors.
  3. If you changed smartd.conf, a later smartd message with the Total ... text appears only when the count rises.
  4. Data you copied matches the source by a checksum you chose.

What to watch afterwards

  • Attribute 197, 198 and 5 raw values each week, and each (changed ...) figure.
  • New smartd messages and the figure in each (changed ...) suffix.
  • Application or filesystem read errors on the same host, which can show the same disk failing.
  • Scheduled self-tests. smartd's -s directive sets them; the manual's example -s L/../../7/04 schedules "a long Self-Test between 4–5 am every Sunday morning".

Risks and limits

  • These commands have not been run or lab-tested.
  • smartmontools does not say how many pending sectors are safe. Treat any non-zero count as unreadable data on a disk that may keep degrading.
  • The manual says a failing smartctl -H result means the disk has already failed or is predicting its own failure within the next 24 hours; a passing result is not a guarantee about the disk.
  • SCSI and NVMe devices use other reports. The smartd.conf manual marks -C and -U as "ATA only".
  • Reallocating a sector by writing to it destroys the 512 bytes it held.

Sources

  • smartd.conf(5) — smartmontools 7.3 manual page, Debian bookworm, 2022-10-16, accessed 22 November 2026
  • smartd(8) — smartmontools 7.3 manual page, Debian bookworm, 2022-10-16, accessed 22 November 2026
  • smartctl(8) — smartmontools 7.3 manual page, Debian bookworm, 2022-10-16, accessed 22 November 2026
  • smartd.cpp at tag RELEASE_7_3 — smartmontools project source code, GitHub release tag RELEASE_7_3, no date shown, accessed 22 November 2026