Learn Rocky Linux 10 RAID 1 setup with mdadm, including array creation, filesystem setup, mounting, persistence, and verification.
Introduction
This tutorial shows how to build a RAID 1 mirror on Rocky Linux 10 for a dedicated server, then make the array available across reboots with mdadm. The goal is to take two unused disks, create the mirror, format it with XFS, mount it, and confirm the configuration is persistent and healthy.
For server operators planning storage layouts, this is the practical baseline for redundant block storage. If you are comparing disk strategies for a bare-metal RAID for databases deployment, RAID 1 is the simplest mirrored design to validate first.
Prerequisites
- Rocky Linux 10 installed on the dedicated server
- Root access or a normal administrative user with sudo privileges
- Two unused target disks with no data you need to keep
- Network access to install or update the required RAID utilities if needed
- The dedicated server must be ready for local storage configuration
Tutorial steps
Before creating the array, identify the disks and confirm they are not already mounted or carrying filesystem signatures. Replace the device names in the commands below with the two intended target disks on your system.
lsblk
Review the output carefully. The disks you plan to use should not have partitions, mount points, or existing data that you want to preserve. This check is essential because the next step initializes the devices for RAID.
Create the RAID 1 array with mdadm using the two selected disks. The example below uses a mirrored array named /dev/md0; adjust the device paths to match your server.
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdX /dev/sdY
After creation starts, inspect kernel RAID status to confirm the array is assembling as expected.
cat /proc/mdstat
Then inspect the array in detail to verify the metadata, RAID level, and member devices.
mdadm --detail /dev/md0
Once the mirror is active, create an XFS filesystem on the array.
mkfs.xfs /dev/md0
Create a mount point and mount the new filesystem.
mkdir -p /mnt/raid1
mount /dev/md0 /mnt/raid1
Confirm the mounted filesystem is writable by creating a test file, then remove it after verification if you do not need it.
touch /mnt/raid1/raid1-test-file
To make the array persistent, capture the array definition and write it to the mdadm configuration file. First, scan the array definition.
mdadm --detail --scan
Use the scanned output to update /etc/mdadm.conf on your system. After that, rebuild the initramfs so the array metadata is available early in boot.
dracut -f
Enable the mdmonitor service so the system tracks array status across boots.
systemctl enable --now mdmonitor
For storage planning on dedicated hardware, it can help to compare RAID layouts and drive types. If you are evaluating mirror performance and capacity tradeoffs, see RAID 10 vs ZFS for Databases and NVMe vs SATA for Dedicated Servers.
Verification
Verify that the RAID 1 array appears in both /proc/mdstat and the detailed mdadm view.
cat /proc/mdstat
mdadm --detail /dev/md0
Confirm the filesystem is mounted and writable.
mount | grep /mnt/raid1
ls -l /mnt/raid1
Verify the array definition was written to mdadm.conf by checking the scanned output against the configuration you saved, then reboot the server and confirm the mirror comes back online with both devices active.
cat /proc/mdstat
mdadm --detail /dev/md0
After reboot, the array should show both member disks as active and the mount point should remain available if you configured persistence correctly.
Troubleshooting
If the array does not assemble, first recheck the disk names with lsblk and confirm you targeted the correct unused devices. A common cause is a mismatch between the devices passed to mdadm --create and the actual disk identifiers present on the server.
If cat /proc/mdstat shows a degraded or incomplete mirror after reboot, verify that the mdadm configuration contains the correct array definition from mdadm --detail --scan, then rebuild the initramfs again with dracut -f so early boot can assemble the mirror properly.
If the mount fails, verify that /dev/md0 has a valid XFS filesystem and that the mount point exists. If the filesystem mounts but is not writable, review the output of mount and confirm the array is not read-only due to an unfinished resync or member failure.
Rollback
If you need to remove the RAID 1 setup, unmount the filesystem first.
umount /mnt/raid1
Then stop using the array and clear the md metadata from the member disks after you have confirmed you no longer need the mirror.
mdadm --zero-superblock /dev/sdX
mdadm --zero-superblock /dev/sdY
After clearing the metadata, remove the array entry you added to /etc/mdadm.conf, rebuild the initramfs with dracut -f, and delete the mount point if it is no longer required.
Conclusion
You have completed a Rocky Linux 10 RAID 1 setup for a dedicated server using mdadm, created and mounted an XFS filesystem, and made the mirror persistent across reboots. You can now verify the array in /proc/mdstat, confirm it with mdadm --detail, and check that both devices return active after a reboot.

