Installing Fedora 23 with hybrid RAID1 SSD + HDD

I’ve had a Dell Dimension 4400 desktop running as home server since 2009 — starting off with Ubuntu, but recent years with Fedora. Lately the hardware had been showing signs of wear and tear, and a recent power outage took the whole thing to the point of not booting up properly. So time had come to replace this workhorse.

Not being interested in paying too much for a home server setup, I was for some time considering another Intel NUC. But it turns out prices for this, probably backed by the demand, has increased quite a bit in recent years. I got one early for a HTPC, but this very model has increased in price with 70% since. So I fell back to building something on my own again, succeeding my first ever build — an AMD based home computing desktop computer from 2010 initially bought to perform OpenFOAM simulations.

In short I ended up with a Cooler master Elite 110 Mini ITX cabinet and a Celeron processor. But upon installing the Fedora 23 server, I noticed that actually software raid was available, which I up this point had not considered at all. I considered for a while a motherboard with hardware RAID controller, but couldn’t find a satisfactory solution in terms of cabinet size and actual storage. But here I was, having the possibility still, though knowing that the software raid performance probably wouldn’t be as good as the hardware. Still – it would be a huge relief to have some sort of redundancy, which the previous server did not have at all.

Long story short – I bought only 1 new SSD, and tried to re-use an old 2.5″ laptop HDD. But I somehow got the idea that it should be possible to benefit from the better read spead from the SSD. Fortunately it does, and somebody have already taken their time to write about it: tansi.info/hybrid/.

Though being all new to the software raid and hybrid raid approach, it took me a while to grasp the actual system setup. Could the software raid be setup «standalone», and the raid still be visible in a new Anachonda setup? It seemed so when running Gparted. But numerous tries using the Anachonda installer revealed that it was practically impossible to setup the raid as a part of the installation. I read about the LVM and Btrfs systems, which also offer software raid, but none of them where really good options as they did not include the «write mostly» feature (at least not Btrfs), which is needed to have the hdd write mostly, and the ssd read mostly. So, after maybe 15 different Fedora installations with different approaches, I ended up with this one:

  1. Partition the SSD as you like, or have the Anachonda setup do it for you. Do not include the HDD in the original setup.
  2. Make sure that «mdadm» is installed on your new machine (I believe it is not by default, which resulted in one of the new system installations on my end).
  3. Start a «live» session from USB with, say, torrent.fedoraproject.org/torrents/Fedora-Live-Xfce-x86_64-23.torrent.
  4. Create a new software raid «partition», perhaps called /dev/md1, using the command line options from tansi.info. I used something like this:
    mdadm --create --metadata=0.90 -n 2 -l 1 /dev/md1 /dev/sda2 -W /dev/sdb
  5. You can keep an eye on the synch-process withcat /proc/mdstat
  6. Then update the /etc/fstab on your main system, which also can and should be done from the live session. Following this example, I had the line specifying my /home partition, starting with /dev/md1.
  7. Boot back up your main system, and check your /etc/fstab. It should be denoted with a (W) if the drive/partition is running with write-mostly. If not, you can add it by adding «writemostly» to the state-file/sys/block/md1/md/dev-sdxX/state, where the final drive/partition (sdxX) depends on your system.

Hopefully this should do the trick! Running the Fedora 23 server, this setup is ecen well recognized in the Cockpit monitor interface:

 

 

 

Legg igjen en kommentar

Din e-postadresse vil ikke bli publisert. Obligatoriske felt er merket med *