I'm considering building a server with Ubuntu for Plex, a (small) webhost for my research, a private cloud service (NextCloud) for research and personal files, and frankly I've been wanting to learn to get comfortable with Ubuntu. Specifically, I've been interested in learning how to setup RAID5 with Mdadm, but I'm having a bit of trouble getting a fundamental understanding of how to use it. I'm very well aware of how all the raid levels work, so I'm more asking about how Ubuntu and Mdadm are actually interfaced with. There's no shortage of posts about how to set up, but I find the explanations of each step slightly lacking for me to feel comfortable with my important files stored in the system, as well as my own understanding.

I'm also curious about how drives are handled when they vary significantly in size and performance. For example, I've learned from another question (that I erroneously asked on another Stack Exchange site) that the following setup of three devices:

    • 1Tb Raid partition (viewed as one 'drive')
    • 1Tb Raid partition (viewed as one 'drive')
    • 1Tb Raid partition (viewed as one 'drive')
    • 0.5Tb Free space partition (viewed as something like /dev/sdb)

can have the extra 500Gb of free space partitioned and used (though, obviously not backed up via RAID), despite this post.

One of the main things I've been unable to figure out is if the Ubuntu OS is included in the "list of things backed up". Or... is it typically a (in this case) fourth drive which is separated from the RAID array?

If it's the latter, how would you go about even recovering your data if the OS fails? It appears there is not a very comprehensive source of information on the recovery part, though full tutorials on setting up RAID via Mdadm in the first place are easy to find. In short, could I easily unplug all three drives, plug them into a separate machine running Ubuntu, install Mdadm, and do something to get them accessible and running again? If so, how does that even work? How does the new system understand and access the 'big picture' of the RAID setup?

I want to note that I'm trying to get a more deep understanding of how these systems work and sort of use these questions as a proxy for finding more information to read up on. I would absolutely appreciate any related information or links to outside resources on getting started with server management / Ubuntu / etc.


Q0 : Documentation
kernel.org : a guide to mdadm

help.ubuntu.com : Advanced Installation, software Raid

Q1 : does the os filesystem be secured by raid?
If the RAID volume is mounted on root /, it is a yes

Q2 : Recovering
If one disk fails, mdadm enters the degraded mode, missing data is calculated, filesystem is available.
The recovery process can be run from a Live cd/usb or from the current OS if available.

Get raid status : sudo mdadm -D /dev/md0
Mark disk as failed : sudo mdadm --manage /dev/md0 --fail /dev/sda1
Filesystem is available, missing data is calculated.

Remove failing disk : sudo mdadm --remove <array> <device>
Shutdown, replace hardware, boot, create partition
Add new disk to raid : mdadm --manage <array> --add <device>
Raid array is synchronizing, watch /proc/mdstat to get status.

|improve this answer|||||
  • Thank you! Furthermore: are simple mirrors like Raid1 able to be swapped without consequence? For example, could I unplug one of my raid1 copies, plug it into a foreign machine (let's say even a machine running windows), and expect to be able to access the data? – Will Dec 28 '19 at 1:52
  • @Will : Yes! It would be a good idea to 'tell' to the current raid that you will unplug a disk – cmak.fr Dec 28 '19 at 4:52
  • Of course! Though, after doing more reading, I've heard from some that raid is becoming obsolete, citing rsync and other tools as better alternatives. Though these two methods have overlapping use cases, each definitely have their own specific advantages. So far raid appears as the best way to correctly manage my data. If I'm wanting to make a cloud storage server that is resistant to drive failure, is this not the best method to use? – Will Dec 29 '19 at 7:04
  • @will : probably the best solution for disk fault tolerance – cmak.fr Dec 29 '19 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.