I am facing an issue with my RAID 1 (mdadm softraid) on an AlmaLinux/CloudLinux OS server, which is a production server with live data. Here's the chronology of events:
- Initially, I created a RAID 1 array with two 1TB NVMe disks (2 x 1TB).
- At some point, the second NVMe disk failed. I replaced it with a new 2TB NVMe disk. I then added this new 2TB NVMe disk to the RAID array, but it was partitioned/configured to match the 1TB capacity of the remaining active disk.
- Currently, the first 1TB disk has failed and was automatically kicked out by the RAID system when I rebooted the server. So, only the 2TB NVMe disk (which is currently acting as a 1TB member of the degraded RAID) remains.
Replacement and Setup Plan
I have already replaced the failed 1TB disk with a new 2TB NVMe disk. I want to utilize the full 2TB capacity since both disks are now 2 x 2TB.
[root@id1 ~]# cat /proc/mdstat Personalities : [raid1] [raid6] [raid5] [raid4] md124 : active raid5 sdd2[3] sdc2[1] sda2[0] 62945280 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] bitmap: 1/1 pages [4KB], 65536KB chunk md125 : active raid5 sdd1[3] sdc1[1] sda1[0] 1888176128 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] bitmap: 7/8 pages [28KB], 65536KB chunk md126 : active raid5 sda3[0] sdc3[1] sdd3[3] 2097152 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] bitmap: 0/1 pages [0KB], 65536KB chunk md127 : active raid1 nvme1n1p1[2] 976628736 blocks super 1.2 [2/1] [_U] bitmap: 8/8 pages [32KB], 65536KB chunk unused devices: <none> mdadm --detail /dev/md127
[root@id1 ~]# mdadm --detail /dev/md127 /dev/md127: Version : 1.2 Creation Time : Tue Aug 29 05:57:10 2023 Raid Level : raid1 Array Size : 976628736 (931.39 GiB 1000.07 GB) Used Dev Size : 976628736 (931.39 GiB 1000.07 GB) Raid Devices : 2 Total Devices : 1 Persistence : Superblock is persistent Intent Bitmap : Internal Update Time : Thu May 29 01:33:09 2025 State : active, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 0 Spare Devices : 0 Consistency Policy : bitmap Name : idweb.webserver.com:root (local to host idweb.webserver.com) UUID : 3fb9f52f:45f39d12:e7bb3392:8eb1481f Events : 33132451 Number Major Minor RaidDevice State - 0 0 0 removed 2 259 2 1 active sync /dev/nvme1n1p1 lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
[root@id1 ~]# lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL NAME FSTYPE SIZE MOUNTPOINT LABEL sda 931.5G ├─sda1 linux_raid_member 900.5G web1srv.serverhostweb.com:home2 │ └─md125 ext4 1.8T /home2 ├─sda2 linux_raid_member 30G web1srv.serverhostweb.com:tmp │ └─md124 ext4 60G /var/tmp └─sda3 linux_raid_member 1G web1srv.serverhostweb.com:boot └─md126 xfs 2G /boot sdb ext4 5.5T sdc 931.5G ├─sdc1 linux_raid_member 900.5G web1srv.serverhostweb.com:home2 │ └─md125 ext4 1.8T /home2 ├─sdc2 linux_raid_member 30G web1srv.serverhostweb.com:tmp │ └─md124 ext4 60G /var/tmp └─sdc3 linux_raid_member 1G web1srv.serverhostweb.com:boot └─md126 xfs 2G /boot sdd 931.5G ├─sdd1 linux_raid_member 900.5G web1srv.serverhostweb.com:home2 │ └─md125 ext4 1.8T /home2 ├─sdd2 linux_raid_member 30G web1srv.serverhostweb.com:tmp │ └─md124 ext4 60G /var/tmp └─sdd3 linux_raid_member 1G web1srv.serverhostweb.com:boot └─md126 xfs 2G /boot nvme0n1 1.8T nvme1n1 1.8T └─nvme1n1p1 linux_raid_member 931.5G web1srv.serverhostweb.com:root └─md127 ext4 931.4G / What are the steps to repair my soft RAID 1, maximize the storage to 2TB, and ensure the data remains safe?
I have some example step but not really sure, does the below step right?:
# Create a partition on the new disk with a full size of 2TB fdisk /dev/nvme0n1 mdadm --manage /dev/md127 --add /dev/nvme0n1p1 # Wait for First Sync # Fail and remove the old disk mdadm --manage /dev/md127 --fail /dev/nvme1n1p1 mdadm --manage /dev/md127 --remove /dev/nvme1n1p1 # Repartition the old disk for full 2TB gdisk /dev/nvme1n1 # Add back to RAID mdadm --manage /dev/md127 --add /dev/nvme1n1p1 # Wait for Second Sync # Expand RAID array to maximum mdadm --grow /dev/md127 --size=max # Verify new size mdadm --detail /dev/md127 # Resize ext4 filesystem resize2fs /dev/md127 # Update mdadm.conf mdadm --detail --scan > /etc/mdadm.conf # Update initramfs dracut -f Server Spec:
- Os Almalinux/Cloudlinux 8