Checking Disk and RAID Health¶
In this article
Signs of disk problems: I/O error messages in dmesg, the file system switching to read-only mode, the server "freezing" on writes, or a RAID array in the degraded state.
Note
Checking SMART and the RAID controller only makes sense on dedicated servers. On a VPS the disk is virtual and SMART data is not available — if you see I/O errors on a VPS, contact technical support.
If the system does not boot, you can run all the checks from Rescue mode.
Checking disks with SMART on Linux¶
-
Install the
smartmontoolsandnvme-clipackages: -
List the disks:
-
Run a quick health check and get the full report:
sudo smartctl -H /dev/sda # overall assessment: PASSED or FAILED sudo smartctl -a /dev/sda # all attributes, error log, serial numberFor NVMe drives:
-
If needed, run a short self-test (about 2 minutes) and view the result:
Tip
If the disks are connected through a hardware RAID controller, smartctl /dev/sda shows the logical volume, not the physical disk. Specify the device type, for example smartctl -a -d megaraid,0 /dev/sda (the number is the disk ID on the controller), or use the controller utility.
Which attributes to check¶
A PASSED assessment does not guarantee that the disk is healthy. Check the RAW_VALUE of these attributes:
| Attribute | Meaning | When to worry |
|---|---|---|
5 Reallocated_Sector_Ct | Bad sectors that have been reallocated | Greater than 0 and growing |
197 Current_Pending_Sector | Unstable sectors waiting to be reallocated | Greater than 0 |
198 Offline_Uncorrectable | Uncorrectable sectors | Greater than 0 |
199 UDMA_CRC_Error_Count | Transfer errors over the cable or backplane | Growing (usually a cable problem, not the disk) |
187 Reported_Uncorrect | Uncorrectable read errors | Greater than 0 |
Media and Data Integrity Errors (NVMe) | Media errors | Greater than 0 |
Percentage Used (NVMe) | Write endurance used | Close to 100% |
Critical Warning (NVMe) | Critical controller warning | Not equal to 0x00 |
Also check the kernel log:
Checking mdadm software RAID¶
Software RAID is built with mdadm if it was selected during OS installation.
A healthy RAID1 array shows [2/2] [UU]. If there is a _ instead of a U (for example, [2/1] [U_]), the array is degraded — one of the disks has dropped out.
Detailed information about the array:
Check the State field (clean is normal, degraded means the array is missing a disk) and the list of disks at the end of the output: a disk with the faulty or removed status should be checked with SMART.
Attention
A degraded array keeps working but no longer protects your data: if a second disk fails, the data will be lost. Make a backup immediately.
When the array is rebuilding, /proc/mdstat shows a recovery or resync line with the progress percentage. You can monitor the process with watch cat /proc/mdstat.
Checking hardware RAID¶
Find out which controller is installed:
The management utilities depend on the vendor. Download them from the controller or server manufacturer's website.
Broadcom / LSI MegaRAID — storcli (MegaCli on older systems):
sudo storcli64 /c0 show # overall controller and volume status
sudo storcli64 /c0/eall/sall show # physical disk status
sudo MegaCli64 -LDInfo -Lall -aALL # logical volumes (legacy utility)
sudo MegaCli64 -PDList -aALL | grep -iE 'slot|firmware state|media error|predictive'
Dell PERC — perccli (the syntax is the same as storcli):
A logical volume should be in the Optl (Optimal) state. The Dgrd (Degraded), Pdgd (Partially Degraded), and OfLn (Offline) states indicate a problem. For physical disks, Onln is normal, while Failed, Offline, UBad, and non-zero Media Error Count and Predictive Failure Count values indicate a problem.
Note
You can also view the state of the disks and the controller in the IPMI/iDRAC/iLO web interface (the event log and storage sections). Access to it is described in Hardware remote control.
Checking disks on Windows¶
In PowerShell:
Get-PhysicalDisk | Select-Object FriendlyName, SerialNumber, MediaType, HealthStatus, OperationalStatus
Get-PhysicalDisk | Get-StorageReliabilityCounter | Select-Object DeviceId, ReadErrorsUncorrected, WriteErrorsUncorrected, Temperature, Wear
On older Windows Server versions (2008/2012), you can use:
Any value other than Healthy / OK indicates a problem. The free CrystalDiskInfo utility is handy for viewing SMART attributes. Disk errors are also shown in Event Viewer (the System log, sources disk, Ntfs, storahci, stornvme).
What to do if a disk is failing¶
- Back up your important data first to another server or storage, for example a storage server. Do not run
fsck, write tests, or an array rebuild until your data is saved. - Identify the failing disk: its model, serial number (
smartctl -i /dev/sdX,storcli /c0/eall/sall show all), and its position in the array. - Submit a Remote Hands request from the server card. Diagnostics and replacement of dedicated server components fall within the scope of Remote Hands. In the request, include:
- the server ID;
- the serial number and model of the failing disk;
- the
smartctl -a(ornvme smart-log) output for this disk; - the output of
cat /proc/mdstatandmdadm --detail, orstorcli /c0 showfor hardware RAID; - confirmation that a backup has been made, and a convenient time for the work.
-
After the disk is replaced, add it to the array. For mdadm, copy the partition table from the healthy disk and add the partitions to the array:
sudo sfdisk -d /dev/sda | sudo sfdisk /dev/sdb # for GPT: sgdisk -R /dev/sdb /dev/sda && sgdisk -G /dev/sdb sudo mdadm --manage /dev/md0 --add /dev/sdb1Replace the disk and array names with your own, and make sure you copy the partition table from the healthy disk to the new one. If the disk had a boot loader, install it on the new disk as well (
grub-install /dev/sdb). A hardware controller usually starts the rebuild automatically.
Information
To learn about RAID levels and creating arrays during OS installation, see Creating a RAID Array.