DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
VGSources
Blog

How to Configure RAID Arrays on Ubuntu with mdadm

A practical Ubuntu RAID guide covering RAID-level selection, installer setup, mdadm commands, persistent assembly, monitoring, failed-disk replacement and boot constraints.
Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Ubuntu software RAID is Linux MD, managed by mdadm. You can create an array in the Ubuntu Server installer or build one from the command line for finer control. Choose the RAID level first, back up anything important, verify every disk by stable identifiers, then create, format, mount and monitor the array. RAID improves availability or combines disks; it does not replace an independent backup.

What Ubuntu RAID is—and what it is not

RAID (Redundant Array of Independent Disks) makes multiple physical drives operate as one logical storage device. Ubuntu’s software implementation is Linux MD, with mdadm providing creation, assembly, inspection and repair operations. The Ubuntu Server installer can configure common arrays during installation; the command-line interface is preferable when you need exact metadata, partitioning or boot decisions.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

RAID protects against particular disk failures, depending on its level. It does not protect against accidental deletion, filesystem corruption, malware, theft, fire or an administrator formatting the wrong device. Keep a separate, tested backup before changing partition tables or creating an array. A backup should be restorable without the RAID host being available.

Choose the RAID level before touching a disk

The level determines minimum device count, usable capacity, failure tolerance and how exposed the array is while rebuilding. There is no universal performance ranking: results depend on the workload, controller path, filesystem, queue depth and drives.

#1 Best Overall
SAS HBA Card Compatible with LSI 9300-8i IT Mode 8-Port with SATA Cables
  • Compatible with: LSI 9300-8i; Controller: LSI/Broadcom SAS3008 (12Gb/s SAS)
  • Firmware (FW): HBA IT Mode (Non-RAID); Data Transfer Rate: up to 12Gbps SAS, SATA 6Gbps
  • Host Interface: PCIe 3.0 x8; Internal Connectors: 2× Mini-SAS HD SFF-8643. --Direct attach up to 8 drives, and expand via external SAS Expander for large arrays
  • PERFECT FOR: ZFS, FreeNAS/TrueNAS, unRAID, Proxmox, ESXi home-lab & NAS storage
  • Packing List: HBA Card ×1; 2× SFF-8643 to 4× SATA cables (8× SATA ends). --Cables in box are for SATA drives. They are not compatible with SAS drives. To connect SAS drives, use SFF-8643 to 8482 SAS cables (sold separately) or our matched HBA + cable kit.
Level Minimum devices Usable capacity Failed-device tolerance Workload behavior Rebuild exposure Boot suitability
RAID0 (striping) 2 Approximately the sum of member capacities, limited by the smallest member in each stripe None; one failed member makes the array unavailable Parallel I/O can help throughput, but every file spans the set and has no redundancy There is no redundant rebuild; restore from backup after a failure Not suitable when you need boot resilience
RAID1 (mirroring) 2 Approximately the capacity of one member One member in a two-device mirror Reads may be served by either copy; writes must reach the mirror Replacing a member copies all required data and leaves the mirror degraded until complete The stock Ubuntu bootloader supports softRAID level 1 for /boot
RAID5 (striping with distributed parity) 3 Approximately the sum of all but one member’s capacity One member Parity work affects writes; suitability depends on workload and device type During recovery, the array has no remaining single-device margin The stock Ubuntu bootloader cannot use a softRAID level other than RAID1 for /boot
RAID6 (striping with dual parity) 4 Approximately the sum of all but two members’ capacity Two members Dual-parity calculations add write overhead but provide more failure tolerance Recovery can be lengthy and performance-sensitive while two-device tolerance is being restored The stock Ubuntu bootloader cannot use a softRAID level other than RAID1 for /boot

The Ubuntu guide lists two drives for RAID0 and RAID1, three for RAID5 and four for RAID6. A larger set can change usable capacity, recovery time and operational risk, so size the array for the failure policy you actually need rather than choosing a level from capacity alone.

Prepare disks and a recovery plan

Back up and document the host

  • Make and test an independent backup before repartitioning or creating the array.
  • Record the intended operating-system disk, each prospective member and any disk that must remain untouched.
  • Plan where boot, swap, metadata and data filesystems will live. Do not consume every sector if your boot design or future replacement strategy needs reserved space.
  • Have console or out-of-band access available. A storage mistake can make a remote server unbootable.

Identify disks by facts, not by letter order

Linux device names such as /dev/sda and /dev/sdb are not a safe identity scheme: enumeration can change after reboot or hardware changes. Before selecting members, inspect size, type, filesystem and mount points:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS
blkid

Confirm the serial number or another stable identifier in your hardware and operating-system inventory. Re-run the checks immediately before a destructive command. Never paste an example containing /dev/sdX without replacing it with the verified partition path for this host.

Partition members consistently

Create equivalent partitions on each member disk, with matching or deliberately planned sizes. If one disk is smaller, an array may be limited to the smallest corresponding partition. Keep the partition layout identical enough that a replacement disk can receive the same member partition, and leave room for any separate boot or swap arrangement. The installer and mdadm operate on partitions as well as whole disks; using partitions makes the intended boundaries explicit.

Create an array in the Ubuntu Server installer

An Ubuntu Server installation ISO includes software-RAID options. This path is convenient when the machine is being installed from scratch and you want the installer to create filesystems and mount points at the same time.

  1. Boot the Ubuntu Server installer and proceed to the storage or partitioning screen.
  2. Choose manual partitioning so you can create equivalent partitions on every intended member disk.
  3. Select Configure Software RAID and confirm the action when prompted.
  4. Choose Create new MD drive.
  5. Select the RAID type: RAID0, RAID1, RAID5 or RAID6. Ensure the number of selected partitions meets the level’s minimum requirement.
  6. Set the number of active devices and, if your design calls for it, spare devices.
  7. Select the member partitions. Check each disk’s size and identity rather than relying on its position in the list.
  8. Return to the storage layout and assign a filesystem and mount point to the resulting MD device. Keep boot-related filesystems on a design supported by your firmware and bootloader.
  9. Review the final layout, including disks that are not part of the array, then finish the installation.

The installer’s RAID configuration does not remove the need for backups or monitoring. After the first boot, verify that the array assembles and that synchronization has completed before placing important data on it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create a software RAID array with mdadm

Install the management tools

sudo apt install mdadm

On an existing system, stop services and unmount any partitions that will become members. Verify that the target partitions contain no data you need; mdadm --create initializes array metadata and the subsequent filesystem operation is destructive.

Create the array

The following is a pattern for a two-device mirror. Replace every placeholder with the actual, verified partition path and change the level and device count to match your plan:

sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/<partition1> /dev/<partition2>

For RAID0, RAID5 or RAID6, use the corresponding --level and provide the required number of member partitions. Do not blindly reuse /dev/md0; an existing host may already use that name. Read the command output for warnings about metadata, devices or an existing filesystem before proceeding.

Watch initial synchronization

cat /proc/mdstat
sudo mdadm --detail /dev/md0

/proc/mdstat reports active arrays and synchronization or recovery progress. mdadm --detail shows the level, state, member devices, active and failed counts, and rebuild information. A healthy mirror commonly displays a status such as [UU]; a three-member healthy set may show [UUU]. A missing member appears as an underscore, for example [U_], and means the array is degraded.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create a filesystem and mount it

sudo mkfs.ext4 /dev/md0
sudo mkdir -p /srv/raid
sudo mount /dev/md0 /srv/raid

Choose the filesystem and mount point for the workload. Formatting the assembled MD device, rather than an individual member partition, ensures the filesystem uses the array abstraction.

Make assembly and mounting persistent

An array that works only until reboot is not a finished configuration. Record the array definition in Ubuntu’s mdadm configuration, normally /etc/mdadm/mdadm.conf, using an ARRAY definition appropriate to the assembled device. The exact line should describe the array’s UUID and metadata as reported by mdadm --detail or an examine operation; do not copy an unrelated host’s UUID.

Rank #3
YiBaoTong LSI 9211-8I PCI Express 2.0 PCIe X8 IT Mode with SATA Cables
  • LSI 9211-8I SAS2008 CHIP
  • (LSI 9211-8i) FW: P20 IT Mode
  • 6Gbps PCI E X8 2.0
  • ZFS FreeNAS unRAID
  • Packing List: HBA Card ×1,High and low bracket*1,2*SFF-8087-SATA Cable

Use the filesystem UUID or a filesystem label in /etc/fstab, not a potentially changing member path. Obtain the UUID with blkid, then create an entry for the mounted filesystem. Test the entry with a controlled unmount and mount, and check for errors before rebooting.

If the array is required during boot, ensure the initramfs includes the mdadm configuration. On Ubuntu this commonly means rebuilding the initramfs after editing the configuration:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo update-initramfs -u

Reboot during a maintenance window, confirm the array assembles automatically, and check the mount. A successful first assembly test is important evidence that the configuration is persistent; it is not a substitute for a backup.

Monitor health, synchronization and degraded states

Check immediately after creation

  • Run cat /proc/mdstat and note whether the array is resyncing, recovering, inactive or degraded.
  • Run sudo mdadm --detail /dev/md0 and verify the expected level, UUID, member count and device roles.
  • Confirm the filesystem is mounted on the intended directory and that applications can read and write expected data.
  • Review system logs for device resets, I/O errors or assembly failures.

Keep watching during a rebuild

Synchronization can continue after the shell command returns. Monitor until the progress line disappears and the detail output reports all expected devices active. On a server, retain alerts and logs so a second failure or an interrupted recovery is noticed promptly. Rebuild exposure is the period in which a redundant array has less protection than intended; do not treat a degraded array as normal operating mode.

Reassemble an existing array

If an array was created previously but is not active, verify the member identities and use the documented scan operation:

sudo mdadm --assemble --scan

Do not force assembly merely to make a device appear. First determine whether the members belong to this array, whether metadata is current and whether another array has claimed one of the partitions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Replace a failed RAID member safely

Confirm the failure

Start with the array, not with the disk’s position in the chassis:

sudo mdadm --detail /dev/md0
cat /proc/mdstat
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS
blkid

Correlate the failed partition shown by mdadm with a physical serial number and with system logs. A transient cable or power problem can look like a disk failure; investigate it before removing hardware. Never remove a healthy member because its /dev/sdX letter changed.

Mark and remove the failed partition

After confirming the identity, mark the member failed and remove it from the active set. The operation syntax is:

sudo mdadm /dev/md0 --fail /dev/<failed-partition>
sudo mdadm /dev/md0 --remove /dev/<failed-partition>

Some arrays mark a device failed automatically. In that case, the explicit --fail step may already have been completed, but verify the state before issuing any command.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare the replacement

Install a replacement with a compatible interface and at least the required usable size. Recreate the member partition with the same intentional boundaries as the surviving disk; a replacement that is nominally the same capacity can still be too small if its usable sector count differs. Re-run lsblk and blkid to make sure you are adding the new partition, not an existing filesystem or a partition from another array.

Add it and monitor recovery

sudo mdadm /dev/md0 --add /dev/<replacement-partition>
cat /proc/mdstat
sudo mdadm --detail /dev/md0

The array should enter recovery or resynchronization. Keep monitoring until every expected member is active and the status returns to a healthy marker such as [UU]. If the add operation is rejected, stop and inspect size, partition type, metadata and UUIDs rather than forcing the device.

Best Value
GLOTRENDS SA3026C 6 Port PCIe SATA Expansion Card, SATA III 6Gbps, ASM1166
  • 6-PORT SATA EXPANSION CARD: Adds 6 SATA III (6Gbps) drives to your desktop at once, turning one PCIe x4 slot into a 6-bay storage pool for unRAID, TrueNAS, ZFS, Proxmox or Windows Storage Spaces software RAID. Hardware RAID is not supported.
  • 277MB/S ON EVERY PORT: PCIe 3.0 X2 upstream runs at 16GT/s, and each of the 6 SATA ports delivers up to 277MB/s, so large multi-drive transfers, media libraries and backup jobs finish fast with no bottleneck.
  • NO DRIVER, WIDE COMPATIBILITY: Plug and play on Windows (except XP), Mac OS, Linux and NAS systems. Set SATA mode to AHCI in BIOS or UEFI before first install. This is a data storage HBA and does not boot an operating system.
  • 6 BUILT-IN LED INDICATORS: A steady red LED means the drive is powered, a flashing LED means it is reading or writing, so you can check every SATA drive at a glance without opening the case.
  • FITS X4/X8/X16 SLOTS, FULL KIT INCLUDED: Ships with 6 x SATA III cables (350mm/13.5in), a 1:5 SATA power splitter cable, and both a 12cm regular and an 8cm low-profile bracket for any PC or NAS case.

Design boot correctly

Boot storage has stricter requirements than an ordinary data mount. The Ubuntu Community Help Wiki warns: “the /boot filesystem cannot use any softRAID level other than 1 with the stock Ubuntu bootloader.” Therefore, a RAID5 or RAID6 data array should not be assumed to make /boot bootable.

A common resilient design is a separate RAID1 arrangement for boot-related partitions, with the data array using the level selected for the workload. Another design may keep boot outside the data array, but it must be validated for the target firmware, partition scheme and installer. Do not infer compatibility from the fact that Linux can assemble a data array after boot.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When the design requires boot from more than one disk, install boot code on every boot-capable disk. The Ubuntu guide provides grub-install examples for additional disks; adapt the device names to the actual machine and firmware mode. Test a controlled degraded boot only in a maintenance window, with a verified backup and a way to restore the original boot order.

Degraded operation and recovery decisions

An array can remain available while degraded, depending on its level and the nature of the failure. Availability is not the same as safety: RAID1, RAID5 and RAID6 have less redundancy until a replacement finishes rebuilding, while RAID0 has no degraded protection. Limit writes and nonessential maintenance during recovery when practical, but do not interrupt a healthy rebuild without a clear reason.

  • If mdadm --detail reports an unexpected number of devices, stop and identify whether the problem is a failed disk, a detached device, a cabling issue or an assembly problem.
  • If a replacement will not add, compare its partition size and metadata with a surviving member.
  • If the array will not assemble, check the recorded UUID and member metadata before considering any force option.
  • If the filesystem is damaged, use the backup and filesystem-specific recovery procedures; rebuilding RAID metadata does not repair filesystem corruption.

Ubuntu 24.04 LTS considerations

Ubuntu 24.04 LTS receives security maintenance for five years, through 31 May 2029. That support window does not remove the need to test kernel, firmware and storage changes on the particular server.

Ubuntu’s release notes warn that TPM-backed full-disk-encryption kernel constraints can make hardware such as the vmd module required for NVMe RAID unavailable in some configurations. If you are combining NVMe RAID with that encryption path, validate module availability and the complete boot sequence before enabling encryption on production data. A configuration that works with an unencrypted installer environment may fail when the encrypted initramfs must assemble the array.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Bestseller No. 1
SAS HBA Card Compatible with LSI 9300-8i IT Mode 8-Port with SATA Cables
SAS HBA Card Compatible with LSI 9300-8i IT Mode 8-Port with SATA Cables
Compatible with: LSI 9300-8i; Controller: LSI/Broadcom SAS3008 (12Gb/s SAS); Firmware (FW): HBA IT Mode (Non-RAID); Data Transfer Rate: up to 12Gbps SAS, SATA 6Gbps
$89.80
Bestseller No. 3
YiBaoTong LSI 9211-8I PCI Express 2.0 PCIe X8 IT Mode with SATA Cables
YiBaoTong LSI 9211-8I PCI Express 2.0 PCIe X8 IT Mode with SATA Cables
LSI 9211-8I SAS2008 CHIP; (LSI 9211-8i) FW: P20 IT Mode; 6Gbps PCI E X8 2.0; ZFS FreeNAS unRAID
$69.88

Operational checklist

  • Backups are independent of the array and have been restored in a test.
  • The RAID level matches the required capacity and failure tolerance.
  • Every member partition was verified with lsblk, blkid and, where possible, hardware serial information.
  • Boot, swap and data filesystems follow a deliberate layout; /boot uses RAID1 if it is on softRAID with the stock Ubuntu bootloader.
  • mdadm --detail and /proc/mdstat show the expected level and members.
  • The filesystem is mounted by UUID or label in /etc/fstab.
  • /etc/mdadm/mdadm.conf and the initramfs contain the information needed for assembly during boot.
  • A reboot test confirmed automatic assembly and mounting.
  • Alerts and logs are monitored, and the failed-member replacement procedure is documented for this host.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.