هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
The quick answer
dnf -y install smartmontools
smartctl -H /dev/sda
SMART overall-health self-assessment test result: PASSED
smartctl -a /dev/sda | grep -Ei 'Reallocated_Sector|Current_Pending|Offline_Uncorrectable|Power_On_Hours'
smartctl -a /dev/nvme0
dmesg -T | grep -Ei 'I/O error|medium error|reset' | tailOn Ubuntu: apt-get install -y smartmontools.
Step by step
- List the disks:
lsblk -d -o NAME,MODEL,SIZE,ROTA,TRAN
smartctl --scanROTA 1 = spinning disk (HDD), 0 = SSD/NVMe.
- The overall verdict (
-H) —PASSEDis not a guarantee;FAILEDmeans replace now. - The values that matter:
| Attribute (HDD/SATA SSD) | Bad sign |
|---|---|
Reallocated_Sector_Ct | Growing above 0 — the disk is replacing bad sectors. |
Current_Pending_Sector | > 0 — sectors that could not be read. |
Offline_Uncorrectable | > 0 — data could not be read back. |
UDMA_CRC_Error_Count | Growing — often the cable, not the disk. |
| NVMe field | Bad sign |
|---|---|
Critical Warning | Not 0x00. |
Percentage Used | Near 100 % — the SSD is worn out. |
Media and Data Integrity Errors | > 0. |
- Run a self-test (the disk keeps working meanwhile):
smartctl -t short /dev/sda
smartctl -l selftest /dev/sdashort takes ~2 minutes; long can take hours.
- Software RAID (mdadm) — is an array degraded?
cat /proc/mdstat
md0 : active raid1 sdb1[1] sda1[0]
976630464 blocks super 1.2 [2/2] [UU]
mdadm --detail /dev/md0[UU] = both disks fine; [U_] = one disk missing — replace it now.
- Monitor automatically —
smartdchecks the disks and mails on problems:
DEVICESCAN -a -o on -S on -s (S/../.././02|L/../../6/03) -m ops@example.comsystemctl enable --now smartd(On Ubuntu the file is /etc/smartd.conf.) In Prometheus use smartctl_exporter.
- VMs and cloud disks have no SMART (virtual disks) — there the provider watches the hardware; you watch I/O errors and latency.
Check that it worked
Every disk shows PASSED, the bad attributes are 0 (or not growing), RAID arrays show all U, and smartd is active with a working mail address (test with -M test in the config once).
Common problems
| Problem | Cause | Fix |
|---|---|---|
Unable to detect device type | Behind a RAID controller. | smartctl -d megaraid,0 /dev/sda (or the controller's own tool). |
SMART support is: Unavailable | Virtual disk (VM) or a USB bridge. | Check on the host/provider; for USB try -d sat. |
PASSED, but many I/O errors in dmesg | SMART does not see everything (cable, controller). | Trust the kernel log; check cables; replace the disk if errors continue. |
UDMA_CRC_Error_Count grows | Bad SATA cable or connector. | Replace the cable first. |
RAID shows [U_] | One disk failed or was removed. | mdadm --detail; replace the disk and add it back (mdadm --add). |
NVMe Percentage Used 95 % | SSD worn out by writes. | Plan the replacement; check what writes so much. |
Go further
- Command pages: lsblk, dmesg.
- Next how-tos: Check disk space, Find out why a server is slow, Back up a server with restic, Repair a file system after a crash.
- Learn it: RHCSA — Storage basics, TLCL — fsck. Monitoring: Prometheus, Alertmanager.
1Which SMART values show a disk is starting to fail?
Growing Reallocated_Sector_Ct, and Current_Pending_Sector or Offline_Uncorrectable above 0.
2/proc/mdstat shows [U_]. What does it mean?
The RAID array is degraded — one disk is missing or failed.