Skip to content

Mount Raid Arrays After Ubuntu Server Install

Keith Lewis edited this page Jun 1, 2026 · 8 revisions

Support the Channel ☕

If you found this guide helpful and are feeling extra appreciative, consider supporting the channel:

🛡️ Ubuntu RAID 5: Post-Install Mounting & Recovery Guide

If you created a RAID 5 array during the Ubuntu Server installation but it isn't showing up in your file system or CasaOS, this guide will help you "import" that storage, mount it safely, and make it permanent.

🚀 Step 1: Assemble the Array

Even if the RAID was created during setup, the new OS needs to "discover" it. We use mdadm to scan the disks and assemble the virtual device.

# Scan all drives and reassemble any detected RAID arrays
sudo mdadm --assemble --scan

Note

This command tells the kernel to find the RAID metadata on your disks. It will usually create a device named /dev/md127 or /dev/md0.


💾 Step 2: Save the Configuration (The sudo tee Step)

Don't skip this! Even if the array is assembled, Ubuntu needs a record of it to ensure it starts correctly every time you reboot. We pipe the current scan details into the configuration file.

# Save the current RAID configuration so it survives a reboot
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf

# Update the boot image to include the new RAID info
sudo update-initramfs -u

💡 Why sudo tee?

Normal redirection (>) doesn't work well with sudo. Using tee -a (append) allows you to write the RAID's "fingerprint" into the protected system config file safely.


🔍 Step 3: Identify Your RAID

Now, let's verify that the array is active and find its UUID. The UUID is a unique "fingerprint" that ensures we mount the correct disks every time.

# View your disk hierarchy
lsblk

# Get the UUID for your RAID device (replace md127 if yours is different)
sudo blkid /dev/md127

Expected Output: Look for TYPE="raid5" and copy the UUID="your-unique-id-here".


📁 Step 4: Create a Mount Point

Linux needs a folder to "attach" the RAID to. We will create a professional path at /mnt/Main_Storage.

sudo mkdir -p /mnt/Main_Storage
sudo mount /dev/md127 /mnt/Main_Storage

🛠️ Step 5: Make it Permanent (The "No-Fail" Mount)

To ensure your RAID mounts automatically when you reboot—and to prevent your server from crashing if a drive is missing—we must edit the File Systems Table (fstab).

  1. Open the config file:
sudo nano /etc/fstab
  1. Add this line to the bottom (using your UUID):
UUID=7b31a8a9-78c0-4660-a69a-f9334dcf45dd  /mnt/Main_Storage  ext4  defaults,nofail  0  2


✅ Step 6: Test the Configuration

Never reboot without testing your fstab first! If there is a typo, this command will catch it.

# Attempt to mount everything in fstab
sudo mount -a

# Check if it worked
df -h | grep Main_Storage

🏠 Step 7: View in CasaOS

Once the RAID is mounted at /mnt/Main_Storage, CasaOS will automatically see it.

  1. Open the CasaOS Dashboard.
  2. Go to the Files app.
  3. Main_Storage will now appear as a usable drive in the file explorer, under root and under mnt! 🎊

🚨 Troubleshooting & Health Checks

Want to see the health of your 18TB drives? Use these commands:

  • Check RAID Status: cat /proc/mdstat
  • Detailed Health Report: sudo mdadm --detail /dev/md127

🛠️ Deep Dive: What does assemble --scan actually do?

When you run sudo mdadm --assemble --scan, you are telling the Linux kernel to perform a Discovery Mission:

  1. Header Scanning: Linux looks at every connected disk (your 18TB drives) and reads the "Superblock" (a small hidden section at the start of the drive).
  2. Metadata Matching: It looks for a "RAID Signature." If it finds three disks that all have the same Array UUID, it realizes they are part of a team.
  3. Logical Assembly: It links those physical disks into a single logical device (e.g., /dev/md127) and starts the driver so the OS can talk to the data.

❓ What if it doesn't "Auto-Find" the array?

Sometimes, the system won't find the array automatically if the metadata is "stale" or if the drives were moved from a different controller. Here is how to handle that:

Option A: Force a Direct Assembly

If the scan fails, you can manually point Linux to the specific drives you know are part of the RAID.

# Replace /dev/sdX with your actual 18TB drive letters (e.g., sda, sdb, sdc)
sudo mdadm --assemble --run /dev/md127 /dev/sdX /dev/sdY /dev/sdZ

Option B: The "Incremental" Assembly

If the array is stubborn, you can tell mdadm to add the drives one by one.

sudo mdadm --assemble --incremental /dev/sdX
sudo mdadm --assemble --incremental /dev/sdY
sudo mdadm --assemble --incremental /dev/sdZ

Option C: Examining the Disks

If you aren't sure which drives are which, "interrogate" a single drive to see what RAID it thinks it belongs to:

sudo mdadm --examine /dev/sda1

Viewers Note: If this command says No md superblock detected, then that specific drive is either blank or not part of your RAID.


⚠️ Important Warning

If the scan fails and you see an error like Device or resource busy, it usually means the OS has already partially claimed the drives. Run cat /proc/mdstat to see if the RAID is already there but just misnamed (like md126 instead of md127).


Clone this wiki locally