Clear Synology DSM drive error history so Storage Manager will accept a disk again.
Author: Zilloww
Inspired by 007revad/Synology_clear_drive_error.
DSM can mark a disk Critical and refuse Repair, even when S.M.A.R.T. looks fine.
Typical case:
- Storage pool is degraded
- One disk is Critical / kicked from the array
- Raw S.M.A.R.T. (5 / 197 / 198 / 199) is clean
- Repair says the disk does not meet requirements (must be Healthy)
DSM stores that judgment in sqlite DBs under /var/log/synolog/. This script deletes all history for the selected serial across disk / test / health DBs. It does not fix hardware.
Worth trying only if the disk looks like a false positive / transient glitch, not a dying drive.
Prefer yes if:
- Reallocated / Pending / Uncorrectable / CRC raw values are
0(or stable) - Extended S.M.A.R.T. passes (or you plan to run one after clearing)
- You understand you are wiping DSM’s memory of past errors for that serial
Prefer no if:
- SMART is already bad and getting worse
- The disk keeps dropping / reconnecting
- You have no backup of data you care about
- You are not comfortable with root SSH on the NAS
Risk reminder (RAID 5 / SHR-1): while degraded or rebuilding you have no redundancy. A second disk failure can kill the volume. Rebuilding on the same disk vs a new one: same catastrophe risk; same disk has a higher chance of rebuild abort / re-kick.
scp -O clear_drive_error.sh user@NAS_IP:~/scripts/
ssh user@NAS_IP
sudo -i
chmod +x /var/services/homes/USER/scripts/clear_drive_error.shNeeds: SSH, admin/root, sqlite3.
./clear_drive_error.sh --list
./clear_drive_error.sh --dry-run
./clear_drive_error.shPick the drive from the menu (model|serial). Use --yes to skip the final confirmation.
| Flag | Meaning |
|---|---|
-l, --list |
List drives with err/warning history |
-n, --dry-run |
Preview only |
-y, --yes |
No confirmation prompt |
Always clears everything for that serial. Backups are written as *.bak.<timestamp> before any write.
- Confirm pool degraded, note slot + serial, check SMART raw values.
- Clear history
./clear_drive_error.sh --dry-run # pick the drive, preview ./clear_drive_error.sh # pick the drive, confirm
- Reseat cleanly
- Deactivate if the Action exists (often missing when already Critical — fine)
- Pull the disk
- Reboot without that disk
- Reinsert in the same bay
- Expect Healthy / Not initialized / unused in Storage Manager.
- Soak (recommended) before Repair:
- Leave the disk in, do not Repair yet
- Run an extended S.M.A.R.T. test
- Next day, check for new errors:
sqlite3 /var/log/synolog/.SYNODISKDB \ "SELECT datetime(time,'unixepoch','localtime'),level,msg FROM logs \ WHERE serial='SERIAL' AND level IN ('err','warning') \ ORDER BY time DESC LIMIT 30;"
- Repair the storage pool only if still Healthy and no new
unc/ioerr/timeout/idnf. - After rebuild: wait for Healthy, then run a data scrub.
If Repair still refuses: repeat pull → reboot empty → reinsert. Last resort (experts only): manual mdadm --add — easy to brick the array if you pick the wrong device.
Use at your own risk. This edits internal DSM databases, is not an official Synology tool, and will not save a failing drive. Wrong target, bad timing, or a rebuild you do not understand can mean downtime or data loss.
You should know what a degraded RAID means and ideally have a backup of anything you cannot lose before you click Repair.
If unsure: stop, replace the disk, or get help.