← Harden & defendcheck if your drive is dying with smartctl

check if your drive is dying with smartctl

$smartctl -H

your drive is probably trying to tell you something

hard drives and ssds almost never die with zero warning. they drop hints first. bad sectors, slow reads, weird reallocations happening quietly in the background. most people never check because there's no little dashboard light for "hey, i'm dying." there's just a tool sitting on your machine already, waiting for you to ask it a question. that tool is smartctl, and asking the question takes about two minutes.

what smartctl actually is

every modern drive, spinning or solid state, has a built in monitoring system called s.m.a.r.t. (self monitoring, analysis, and reporting technology). the drive tracks its own health stats internally, things like temperature, read errors, and how many sectors have gone bad. smartctl is just the command line tool that asks the drive to hand over that data so you can read it in plain terms instead of it staying locked inside the firmware.

on linux it's part of the smartmontools package. install it if you don't have it:

sudo apt install smartmontools

step 1: smartctl -H, the quick verdict

this is the fastest health check you can run. point it at your drive like this:

sudo smartctl -H /dev/sda

swap /dev/sda for whatever your actual drive is, check with lsblk if you're not sure. you'll get back either "PASSED" or "FAILED." passed is good news but it's not the whole story, it's just the drive's own self assessment based on its internal thresholds. think of it as a quick gut check, not a full physical.

step 2: smartctl -A, the actual numbers

this is where the real diagnosis happens. run:

sudo smartctl -A /dev/sda

you'll get a long list of attributes, but you only need to care about three:

reallocated sector count, this is how many bad sectors the drive has already swapped out for spares. every drive has a small reserve of backup sectors. once it starts using them, that's physical damage happening.

current pending sector, sectors the drive is unsure about but hasn't officially marked bad yet. these are the early warning sectors, the ones on the fence.

offline uncorrectable, sectors the drive tried to fix and genuinely couldn't. data in those spots may already be gone.

the rule is simple: anything above 0 in these three fields is not normal and not something to shrug off. a single reallocated sector isn't an emergency, but it's a flag. a climbing number over time is a countdown.

step 3: run an actual self test

the passive numbers tell you history. a self test tells you what's happening right now. a short test takes a couple minutes and checks the drive's core functions:

sudo smartctl -t short /dev/sda

then check the results a few minutes later:

sudo smartctl -l selftest /dev/sda

if you want a deeper scan that actually reads the full surface of the drive, there's a long test too, it just takes a lot longer depending on drive size:

sudo smartctl -t long /dev/sda

what to actually do with this information

if your numbers are clean, great, you just confirmed your drive is healthy and you lost two minutes doing it. if you're seeing nonzero pending or reallocated sectors, don't wait for "failed" to show up in the health check. by the time smartctl flags total failure, you may have already lost files silently.

the move is: back up anything important today, not this weekend, today. then plan to replace the drive. smart data is a heads up, not a prediction with a countdown timer attached, drives can fail slowly over months or suddenly over a weekend once sectors start going.

the takeaway

this isn't some advanced forensic trick, it's a built in health check most people never run because nobody told them it existed. two commands and two minutes can tell you whether your drive is fine or quietly falling apart. run smartctl -H and smartctl -A today, set a reminder to check again monthly, and actually have a backup before you need one. the drive is already giving you the warning. the only question is whether you're going to read it.

watch the reel ↗
the weekly drop

one command a week that makes you harder to hack.

a single tool, explained in plain english, every week. straight to your inbox.

no spam. one email a week. unsubscribe anytime.