Ubuntu 26.04 LTS RAID 1 Setup

Infrastructure

By Jennifer Webb

Updated on Aug 19, 2026

Ubuntu 26.04 LTS RAID 1 Setup

Learn how to set up RAID 1 on Ubuntu 26.04 LTS with mdadm, create a mirrored array, mount it, and verify redundancy.

Introduction

This tutorial shows how to build a RAID 1 mirror on Ubuntu 26.04 LTS for a dedicated-server storage volume using mdadm. You will create the array, format it, mount it persistently, and confirm that the mirror is healthy and ready for use.

The steps are written for administrators who need predictable redundant storage on a dedicated server and want to validate both array status and boot-time persistence after configuration.

Prerequisites

  • Ubuntu 26.04 LTS installed on the dedicated server
  • Two unused block devices available for the mirror, such as /dev/sdb and /dev/sdc
  • Root access or a normal administrative user with sudo privileges
  • Network access to install packages

Tutorial steps

Identify the Disks

Start by confirming the target disks that will become the RAID 1 members. Make sure they do not contain data you need to keep.

lsblk

Use the output to verify the intended device names before continuing.

Install mdadm

Update package metadata and install mdadm, which manages Linux software RAID arrays.

sudo apt update
sudo apt install mdadm

Create the RAID 1 Array

Create the mirrored array on /dev/md0 with the two selected disks.

sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc

After creation starts, check the array progress and confirm that the kernel recognizes it.

cat /proc/mdstat

Save the RAID Configuration

Capture the current array definition so the system can assemble it automatically on boot.

sudo mdadm --detail --scan

Copy the resulting array line into the mdadm configuration file.

sudo nano /etc/mdadm/mdadm.conf

After saving the configuration, rebuild initramfs so the array metadata is available during early boot.

sudo update-initramfs -u

Create a Filesystem and Mount Point

Create an ext4 filesystem on the RAID device, then prepare the mount point that will hold the mirrored storage.

sudo mkfs.ext4 /dev/md0
sudo mkdir -p /mnt/raid1

Get the UUID of the new filesystem for persistent mounting.

sudo blkid /dev/md0

Mount the Array Persistently

Mount the array now, then add the filesystem entry to /etc/fstab using the UUID you retrieved. This ensures the array mounts automatically after reboot. After editing /etc/fstab, test it without rebooting.

sudo mount /mnt/raid1
sudo mount -a

Confirm that the mount is active and that the system recognizes the filesystem at the expected path.

df -h /mnt/raid1

Verify RAID 1 Status and Persistence

Check the detailed array status to confirm that mdadm reports a clean mirror with two active devices.

sudo mdadm --detail /dev/md0

Verify that the array UUID is present in /etc/mdadm/mdadm.conf and that sudo update-initramfs -u completed after the configuration change. Then confirm the mount still succeeds when you run sudo mount -a.

At this point, you should be able to confirm all of the following:

  • /proc/mdstat shows /dev/md0 as an active RAID 1 array
  • mdadm --detail /dev/md0 reports the array as clean with two active devices
  • df -h /mnt/raid1 shows the mounted filesystem
  • The array UUID is saved in /etc/mdadm/mdadm.conf
  • mount -a succeeds without errors

Troubleshooting

If /proc/mdstat does not show the array, recheck the selected device names with lsblk and confirm that the disks were created as /dev/sdb and /dev/sdc in the command you used to create the mirror.

If the filesystem does not appear in df -h /mnt/raid1 after mount -a, verify that the UUID from sudo blkid /dev/md0 matches the entry you placed in /etc/fstab and that the mount point exists.

If mdadm does not assemble the array at boot, confirm that the correct array line is present in /etc/mdadm/mdadm.conf and that sudo update-initramfs -u was run after saving the file.

Rollback

If you need to remove the RAID 1 array, make sure it is not mounted before stopping it.

sudo mdadm --stop /dev/md0
sudo mdadm --remove /dev/md0

After removal, delete or adjust any related /etc/fstab entry and configuration references before reusing the disks for another purpose.

Conclusion

You have now completed a RAID 1 setup on Ubuntu 26.04 LTS for a dedicated server with mdadm, mounted it persistently, and verified that the mirror is healthy. You can confirm the array appears in /proc/mdstat, mdadm reports two active devices, and the filesystem mounts correctly after mount -a.