Getting a failed drive replaced
Drive replacement is part of the rental: technicians swap the hardware, you supply the evidence and rebuild the array afterwards.
How do I know a drive needs replacing?
When the RAID layer has dropped it, or SMART reports growing damage. The clearest sign is a missing member in /proc/mdstat, shown as [U_] instead of [UU]. Earlier warnings come from SMART: a rising count of reallocated or pending sectors on a hard drive, or a high percentage used and media errors on an NVMe drive. Kernel messages about I/O errors or command timeouts on one device point the same way.
cat /proc/mdstat dmesg -T | grep -iE 'i/o error|timeout|reset' | tail -n 20 smartctl -H /dev/sdb nvme smart-log /dev/nvme1n1 | grep -E 'critical_warning|percentage_used|media_errors'
Which SMART values actually matter?
A handful of counters predict failure far better than the overall health verdict, which often says PASSED until the very end.
| Drive type | Value | Replace when |
|---|---|---|
| SATA or SAS hard drive | Reallocated_Sector_Ct, Current_Pending_Sector | Non-zero and rising between checks |
| SATA or SAS hard drive | Offline_Uncorrectable, grown defect list | Any increase |
| SATA SSD | Wear levelling count, reported uncorrectable errors | Wear near end of life or any uncorrectable error |
| NVMe SSD | critical_warning, media_errors | critical_warning not 0, or media errors growing |
A single CRC error count on a SATA drive is usually a cable or backplane issue rather than the disk itself; mention it in the ticket, because the fix is different.
What information do technicians need?
The serial number of the faulty drive, and ideally the serial of every healthy one, so the right disk comes out. Bays are often not numbered the way Linux names devices, which makes the serial the only reliable identifier. The Find a disk serial number guide shows several ways to read it, including from rescue mode when the drive has dropped out of the system.
for d in /dev/sd? /dev/nvme?n1; do printf '%s ' "$d"; smartctl -i "$d" | awk -F: '/Serial/ {print $2}'; done
Open a ticket in the hardware topic with the server name, the faulty serial, the list of good serials, and the output of cat /proc/mdstat and the relevant SMART lines. Say whether the machine may be shut down for the swap and in which time window.
Should I prepare the array before the swap?
Yes: mark the failing member as failed and remove it, so the array stops waiting for it. If the kernel already kicked it out, only the remove step is needed. Do this for every partition of the disk that belongs to an array, which on our standard layout means the boot, root and sometimes swap mirrors.
mdadm --manage /dev/md2 --fail /dev/sdb3 mdadm --manage /dev/md2 --remove /dev/sdb3 mdadm --manage /dev/md1 --fail /dev/sdb2 --remove /dev/sdb2
Before any hardware work, make sure your backups are current. A mirror running on one disk has no margin left, and the rebuild afterwards reads the surviving disk end to end, which is exactly when a second weak drive tends to show itself.
Does the server go offline during the replacement?
Plan for a short shutdown. Some chassis allow a hot swap while running, others need the power off; the technician confirms in the ticket. Expect the machine to be down for 15 to 60 minutes in the agreed window. The rest of the hardware, the IP addresses and your data on the healthy drive stay exactly as they were.
What do I do once the new disk is in?
Copy the partition table from the healthy disk to the new one, give it fresh unique identifiers, and add each partition back to its array. The rebuild starts at once and runs in the background while the server works normally.
sgdisk --replicate=/dev/sdb /dev/sda sgdisk --randomize-guids /dev/sdb mdadm /dev/md2 --add /dev/sdb3 watch -n 30 cat /proc/mdstat
Note the argument order: --replicate takes the target, then the source disk. Getting it backwards would copy the empty layout over your good disk, so read the line twice. The full procedure, including the EFI partition and NVMe naming, is in Replace a disk in software RAID.
How many hours will the resync need?
About as long as reading the whole disk once. A 960 GB NVMe mirror resyncs in 10 to 20 minutes; a 14 TB hard drive in STORAGE-1 needs roughly a day at typical rebuild speeds, and a 22 TB drive longer. Keep heavy batch jobs off the machine during a large rebuild, and check SMART on the surviving disks once it finishes.
Mirrored machines and their drives
| Model | Processor | Cores | Memory | Drives | Port | Per month |
|---|---|---|---|---|---|---|
| STORAGE-1 | AMD Ryzen 7 Pro 3700 | 8 | 32 GB | 2x 480 GB SSD SATA + 4x 14 TB HDD SAS | 1 Gbps unmetered | $109.80 |
| STORAGE-2 2024 | AMD EPYC 4344P | 8 | 32 GB | 2x 960 GB SSD NVMe + 2x 22 TB HDD SAS | 3 Gbps unmetered | $187.80 |
| ESSENTIAL-4 | AMD EPYC 7313 | 16 | 64 GB | 2x 960 GB SSD NVMe | 1 Gbps unmetered | $106.20 |
| BUSINESS-3 2024 | AMD EPYC 4464P | 12 | 64 GB | 2x 960 GB SSD NVMe | 3 Gbps unmetered | $141.60 |
Related pages
Replace a disk in software RAID
The full command sequence to remove a dead member from an mdadm mirror, partition the new drive, rebuild and restore boot on both disks.
Read moreFind a disk serial number
Read the serial number of every SATA, SAS and NVMe drive with smartctl, lsblk, udev or sysfs, even when the drive has dropped out of the array.
Read moreRAID levels explained
RAID 0, 1, 5, 6 and 10 compared with usable capacity worked out for our storage chassis.
Read moreQuestions and answers
Is a failed disk replaced at no charge?
Yes. Failed disks, memory and power supplies are replaced by the data centre team as part of the rental.
Why do you ask for the disk serial number?
Device names like sdb do not map reliably to physical bays. The serial number lets the technician pull exactly the faulty drive.
Will I lose data when a disk is replaced?
Not on a mirrored layout, as long as the other disk is healthy. The new drive is rebuilt from it. Keep backups current regardless.
Does the replacement disk come partitioned?
No, it arrives blank. Copy the partition table from the healthy disk with sgdisk and add the partitions back to the arrays.
How do I know the rebuild is finished?
cat /proc/mdstat shows [UU] for every array and no recovery line. mdadm --detail reports the state as clean.