-
Notifications
You must be signed in to change notification settings - Fork 19
Mount Raid Arrays After Ubuntu Server Install
If you found this guide helpful and are feeling extra appreciative, consider supporting the channel:
- Donate me a KO-FI: https://www.ko-fi.com/kltechvideos
- Follow on X (Twitter): https://x.com/kltechvideos (Help me beat the algorithm! 😂)
- Subscribe on YT (YouTube): https://www.youtube.com/@kltechvideos
- Checkout the Blog for more cool projects!: https://blog.kltechvideos.co.uk
- Don't forget to let me know what content you are watching or reading on my socials!
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.
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.
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
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.
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".
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
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).
- Open the config file:
sudo nano /etc/fstab
- Add this line to the bottom (using your UUID):
UUID=7b31a8a9-78c0-4660-a69a-f9334dcf45dd /mnt/Main_Storage ext4 defaults,nofail 0 2
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
Once the RAID is mounted at /mnt/Main_Storage, CasaOS will automatically see it.
- Open the CasaOS Dashboard.
- Go to the Files app.
- Main_Storage will now appear as a usable drive in the file explorer, under root and under mnt! 🎊
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
When you run sudo mdadm --assemble --scan, you are telling the Linux kernel to perform a Discovery Mission:
- 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).
- 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.
-
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.
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:
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
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
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.
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).