Disk & Filesystem Management (Du/Df/Lsblk/Fstrim)
Stop worrying about the actual health of your hardware
š§© The Challenge
You look at lsblk and see a disk, but you have no idea if that drive is secretly dying behind the scenes. I once spent three days chasing random data corruption only to realize the disk controller was reporting errors the OS just wasnāt shouting about.
š” The Fix
Use smartctl to pull the raw health data directly from the drive firmware. It saves you from guessing if that weird IO hang is a cable issue or a drive heading for the silicon graveyard.
smartctl -a /dev/sda | grep -E 'SMART overall|Reallocated_Sector_Ct|Current_Pending_Sector'
āļø Why It Works
By grabbing these specific attributes, youāre looking at the driveās internal counters for bad sectors that have already been swapped out or are waiting for a write attempt to finalize their failure.
š Pro-Tip: Alias this to something like ācheck-diskā so you actually run it before pulling your hair out during a production outage.
Linux Tips & Tricks | Ā© ngelinux.com | 9/27/2026
