Skip Navigation

RAID setup for Ubuntu media server

I recently acquired two used blade servers and a short rack to put them in. I'm planning to use one or the other as the replacement for a media server that died on me a bit ago. The old media server was just a little refurb dell workstation, with a single SSD in it, but the servers have 6 and 8 bays, respectively.

I would like to RAID them so that one drive dying doesn't lose any of my media, and I was leaning towards Ubuntu server as an OS. I'm not sure how to do that, and I'm kind of poking around for info and advice. Hit me with it.

23 comments
  • I use openmediavault for my home NAS, it does all the heavy lifting for you with a nice GUI so you don't have to config everything yourself. I'd recommend checking it if you don't have a lot of experience with RAID setups or don't want to do manually.

    Just please remember that RAID is not a backup solution, it's a redundancy solution. If you have data corruption on one side, it can copy itself to the other mirror and then you're screwed. If your media is important, keep a proper separate backup.

  • Basically you need the mdtools package. I use Debian, but Ubuntu is based on Debian, so it should be pretty similar. It's likely mdtools will be installed, but if not, apt install mdtools as root should do it.

    The one thing I strongly, strongly, strongly recommend, after a harrowing week or so a few months back: Do not use the entire disc for the raid arrays. Partition each disk with a single Linux partition, then use those partitions as the array. If you use the entire disc, you run the risk of losing the array if the BIOS thinks those drives are messed up, which is what happened to me. I was able to recover, fortunately, but it was EXTREMELY stressful, and I was to the point where I was starting to figure out what I had lost.

    When you issue the command to build the array, such as:

    mdadm --create --verbose /dev/md0 --level=5 --raid-devices=5 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 --spare-devices=1 /dev/sdf1

    Keep a copy of that command somewhere so you know how you created it, in case you ever need to recreate it.

    I also kept copies of the output of /dev/mdstat, blkid (for the RAID drives and partitions), and mdadm --examine for each drive, just in case. Doing this probably means I'll never need it, so that's a good tradeoff.

    And, as always, RAID is not a backup. In my case, my array is small enough that a single drive can back it up (which wasn't the case when I original built it ~5 years ago), so I have a large drive in my desktop machine that backs up the array every night.

    It's pretty straightforward though. Install Ubuntu on a drive that isn't part of the array and get that working, which should be pretty easy. Partition the array drives like I said above (use gparted or other tools, which will be installed with Ubuntu). Issue the mdadm command similar to what I wrote above, note your partitions will very likely be different. Do not overwrite your Ubuntu partitions with it. That is Bad.

    mdadm will create a /dev/md0 or /dev/md127. Some versions do one or the other. It'll tell you.

    After mdadm finishes, do a mkfs.ext4 /dev/md0 (or md127) to create the array assuming you want to use ext4.

    Add a line like this to your fstab: /dev/md0 /mnt/media ext4 defaults 0 1

    Reboot and go.

    There are a bunch of more detailed guides out there, I've just given the high level steps.

  • you would want to use the hardware raid that likely already exists. its been a minute since i setup dell, but you should be able to boot into the raid controller bios (some ctrl-key sequence) and configure your raid there... then you just install whatever you want on the defined logical drives (linux/windows/hypervsior)

    • @originalucifer @blackstampede if you can just do software raid and if possible get the disks to look like JBOD (just a bunch of disks) CPUs are so much faster these days software raid even ZFS offers so much more than hardware raid.

      • i wouldnt on a non-jbod, retail server box. if this was a random workstation without onboard hardware raid, then sure.

        im not sure how you think sharing the main processor with the raid when there is already a perfectly good set of processors for the raid is going to be faster.

23 comments