Conversation

Quick question. Is there a decent software RAID setup for Arch that I can utilize to mirror two identical SATA drives with?

I'm looking for a RAID 1 setup for redundancy.

8
1
0

@foxyloon I’d say a zfs raidz mirror, though I don’t know offhand how to set that up. I’ve been spoiled with TrueNAS neofox_laugh_sweat

1
0
0

@foxyloon Try mdraid, maybe? I think that's the Linux standard block device RAID

1
0
0

@foxyloon There's also ZFS/btrfs raid but those are filesystem level not block device level.

1
0
0

@IceWolf Yeah, I was previously using these in a ZFS pool in the TrueNAS server I just decommissioned. I'm not going out of my way to compile a new kernel just to enable ZFS on this machine.

I'll look into mdraid.

1
0
0
@foxyloon md / mdadm is the traditional simple way to do it. doesn't have fancy features but it's also a lot simpler than LVM, ZFS, btrfs, etc
0
0
0

@maddy These drives came out of the recently decommissioned TrueNAS box that didn't pan out for me.

So I've heard, I'd have to custom compile the kernel on this machine just to enable ZFS support, which is why I'm trying out other options this time around.

2
0
0

@foxyloon
Zfs is your best bet for software raid

1
0
0

@fish4203 I'd gladly be using ZFS right now, as that's what I was recently using on them when I had that TrueNAS box going, but I'm not willing to compile a custom kernel just to have ZFS support on this machine.

1
0
0

@foxyloon I use btrfs. It has the advantage over md-raid that it checksums data/metadata so if one copy gets corrupted btrfs scrub will be able to detect which device has the correct data and repair the other one.

To create a raid1 filesystem across multiple devices, use mkfs.btrfs -d raid1 -m raid1 /dev/device1 /dev/device1

To add a new device and convert existing filesystem to raid1 do btrfs device add /dev/device2 /mountpoint to add the new device followed by btrfs balance start -dconvert=raid1,soft -mconvert=raid1,soft /mountpoint to convert data and metadata to raid1

1
0
2

@foxyloon btrfs raid-1 is stable and safe to use (unlike raid-5/6 which has the write hole and I wouldn’t trust), but there are several things to note:

  • if you have more than two devices, raid1 just means that it keeps at least two copies on different devices. if you want three or four-way mirroring there’s raid1c3 and raid1c4 profiles for that
  • if you want to mount a filesystem with some devices missing (e.g. a drive failed), you need to use the degraded mount option
  • if a device was temporarily missing and data was written to it during that time you’ll need to use btrfs balance to resync it and ensure everything is on both devices
  • nodatacow (chattr +C) disables data checksumming so btrfs won’t be able to detect or correct errors on such files. I would just avoid using that attribute (especially on an SSD where fragmentation isn’t such a big issue), but some stuff like systemd-journald sets it by default for performance reasons
0
0
2

@foxyloon @maddy

So I've heard, I'd have to custom compile the kernel on this machine just to enable ZFS support, which is why I'm trying out other options this time around.

uh. not the entire kernel 🙃 dynamic kernel module whatever means doing only AUR zfs-dkms. though read the first link's wiki page on that

0
0
0

@foxyloon there's btrfs where you have to be fairly involved in things compared to like zfs (mounting a btrfs RAID setup with missing drives requires -o degraded explicitly specified, and probably more).

zfs is kind of at the automagic level of hands-off but it's a pain so far for me trying to get into any of the specifics of it, things like figuring out why my raidz2 5 drives * 4TB (raw 20, "usable" 12) setup only has maybe like around 9 TB available at best (so far i've gathered is that ZFS must reserve free space to do stuff, and that zfs list is at best an estimation). one thing that has been bothering me so far is that you can't really change change your setup (except for adding drives into a raidz group), like changing raidz levels, removing drives (except for like mirrors), most of which basically require a full reformatting

can't say anything about mdraid. not LVM either (at least not mirroring part of it, i don't use that). yes i've used btrfs and zfs :p

0
0
0

@foxyloon @maddy neobot DKMS ZFS works a treat with the official linux-lts kernel on Arch. the typical linux kernel also works, but the build will often break for a few days after breaking releases to the kernel, until ZFS updates to patch it. it takes a few minutes to build on low-powered boxes, but haven't had any significant issues with it in a few years of use.

although, if you want software RAID on your root filesystem, ZFS is going to be a lot more fiddly than mraid

0
0
0

@foxyloon

mdadm is built into linux and can do RAID 0, 1, 5, and 6.

RAID1 is the device mirroring.
https://wiki.archlinux.org/title/RAID

0
0
0

@foxyloon
I mean it might not be the best idea but I've been running arch with https://github.com/archzfs/archzfs

So far I've had less problems with this then with truenas

0
0
0

@foxyloon ZFS works quite well. And as long as you're not trying to boot off these drives, setup should be quite simple

0
0
0