cat /proc/mdstat: [UU] means every disk is working, [U_] means the array is degraded and a disk has failed. sudo mdadm --detail /dev/md0 shows which one. To replace it, mark it failed and remove it (mdadm --manage /dev/md0 --fail /dev/sdb1 --remove /dev/sdb1), have the disk swapped, copy the partition table to the new disk, then --add it and watch the rebuild.
Before you start
- This page is mainly for dedicated servers with two or more physical disks in Linux software RAID. On a VPS you see virtual disks, and
/proc/mdstatnormally lists no arrays. Protect VPS data with panel backups and your own off-server backups instead. - RAID is not a backup. It keeps the server running when a disk dies, but deletions, corruption and ransomware hit every disk at once. Back up before you touch a degraded array: a second disk can fail during a rebuild.
- Commands use
sudo; root users can leave it out. Install mdadm if needed:sudo apt install mdadmorsudo dnf install mdadm. - If your server uses a hardware RAID controller, mdadm does not manage it. Open a ticket if you are unsure which you have.
How to check RAID status
For details on one array:
State : (clean is good; degraded means a disk is missing), Failed Devices :, and the table at the bottom, which shows each member as active sync, faulty or removed.
How to replace a failed disk in mdadm RAID 1
The examples assumesda is healthy and sdb has failed, with partitions sdb2 in md1 and sdb3 in md2. Use your own names from /proc/mdstat.
1
Identify the failed disk by serial number
2
Mark its partitions as failed and remove them
Do this for every array the disk belongs to:If a partition is already gone,
mdadm says so; continue with the next one.3
Ask for the disk to be replaced
Open a ticket with the failed disk’s serial number and the healthy disk’s serial number, and ask when the swap will happen.
4
Find the new disk
After the swap, run
lsblk. The new disk has no partitions. It may get a different name, so confirm by serial number.5
Copy the partition table from the healthy disk
- GPT disks
- MBR (msdos) disks
-R /dev/sdb /dev/sda copies from sda to sdb. -G gives the copy new unique IDs. sgdisk is in the gdisk package.sudo parted /dev/sda print (Partition Table: gpt or msdos).6
Add the new partitions to the arrays
7
Watch the rebuild
[UU] again. Press Ctrl+C to leave watch. The server stays usable, but disk-heavy work is slower until the rebuild finishes.8
Install the boot loader on the new disk
So the server can still boot if the other disk fails later. On BIOS (legacy) boot:On UEFI servers the EFI system partition is set up differently per installation. Open a ticket if you are not sure how yours boots.
How to get email alerts when a RAID disk fails
mdadm’s monitor sends an email when an array degrades. It needs a working mail setup on the server (a mail transfer agent such as Postfix).- Set the address in the config file,
/etc/mdadm/mdadm.confon Ubuntu / Debian or/etc/mdadm.confon AlmaLinux / Rocky: - Restart the monitor:
sudo systemctl restart mdmonitor. - Send a test alert for each array:
/proc/mdstat from your own monitoring. See get email alerts when your server goes down.
How to run a RAID consistency check
A check reads every block and compares the disks:mdcheck_start.timer, which starts a check on the first Sunday of each month. Seeing check = …% in /proc/mdstat at that time is normal.
Frequently asked questions
Can I keep using the server while the array is degraded?
Yes, but you have no redundancy: if the remaining disk fails, the data is gone. Back up and replace the disk as soon as you can.How long does a RAID rebuild take?
It depends on disk size and speed./proc/mdstat shows an estimate as finish=. Large hard disks can take many hours.
How do I check if a disk is about to fail?
Use SMART data: see check disk health with smartctl. Reallocated or pending sectors are early warnings.Does software RAID exist on my VPS?
Normally you only see virtual disks inside a VPS, andcat /proc/mdstat shows no arrays. Protect VPS data with backups.
Related guides
VPS and dedicated server guides
Every guide in this section.
Check disk health with smartctl
Spot failing disks early.
Back up a Linux server
RAID is not a backup.
Use LVM on Linux
Flexible volumes on top of RAID.
VPS vs dedicated server
What changes with physical disks.
Checked against the official Red Hat Enterprise Linux guide to replacing a failed disk in RAID and the Linux kernel md documentation on 4 November 2026; the
sgdisk -R/-G and sfdisk partition-table copy was tested on Ubuntu 24.04 LTS using loop devices, and the mdadm options were checked against mdadm 4.3’s built-in help. Array commands could not be run in our test environment. Commands can differ on other distributions or releases.Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026