HI Folks,
I recently lost quite a bit of data (my fault and unimportant files thankfully) and snapraid wasnt able to recover much of it as it spanned multiple drives.
This got me thinking about changing my setup and I've been reading about zfs, btrfs and many combinations of options available.
For me the following requirements exist:
- recovery from disk failure
- recover from accidental deletion (bar the cross disk issue which wont be possible)
- drive pooling
- different disk sizes
My initial investigation has been into:
- ZFS pools
- I have disks of different sizes but enough to create multiple vdevs into a single pool which covers 3 of the above but I have no undelete option (unless I take regular snapshots)
- btrfs raid
- I can use many disk sizes but raid 5/6 aren't stable and undelete again isn't there (unless I take regular snapshots)
- btrfs + mergerfs + snapraid
- This one popped up in a self-host wiki page ( https://wiki.selfhosted.show/tools/snapraid-btrfs/ ) and seemed like an interesting idea as my biggest bug with Snapraid has been its sync which requires everything else to stand still until its complete, the option to sync from a snapshot whilst other apps do their thing is very useful.
- This option fulfils every requirement except the guide isnt OMV specific and the way it creates/mounts the btrfs disks doesn't align with how OMV now creates shared folders as subvols.
So I decided to have a play with the latest OMV and btrfs filesystems and shared folders + mergerfs + snapraid.
The setup:
Filesystems
- 3 disks as btrfs (data)
- 1 disk as ext (parity)
Shared Folders
- 3x data on the 3 btrfs disks
- btrfs(1,2,3)
- 3x content on the same btrfs disks
- content
This aligns with the snapraid-btrfs requirements to have a top level subvol and a content subvol but no longer aligns with the guide as the disks are mounted as full disks by OMV not as subvolumes as the guide shows so I had to diverge from the guide.
To use mergerFS with this setup I have chosen to use absolute paths to the data subvols which are created by OMV:
Finally I have setup SnapRAID config similar to the guide but NOT via the OMV plugin, its not possible so I've done it via CLI (you need to install snapraid outside OMV as well):
# SnapRAID Config
# Parity
parity /srv/dev-disk-by-uuid-98e29516-7a75-428a-8181-b80493c526b4/snapraid.parity
# Content
content /var/snapraid.content
content /srv/dev-disk-by-uuid-2eb67b10-9522-43a1-982e-4a7f88a4976b/content/snapraid.content
content /srv/dev-disk-by-uuid-cd5d3536-e4fe-4bfe-b2d9-463b5e224976/content/snapraid.content
content /srv/dev-disk-by-path-pci-0000-0d-00.0/content/snapraid.content
# Data
data d1 /srv/dev-disk-by-uuid-2eb67b10-9522-43a1-982e-4a7f88a4976b/btrfs1
data d2 /srv/dev-disk-by-uuid-cd5d3536-e4fe-4bfe-b2d9-463b5e224976/btrfs2
data d3 /srv/dev-disk-by-path-pci-0000-0d-00.0/btrfs3
exclude *.unrecoverable
exclude lost+found/
exclude aquota.user
exclude aquota.group
exclude /tmp/
exclude .content
exclude *.bak
exclude /snapraid.conf*
exclude /.snapshots/
Display More
From here I was able to create files in the mergerFS directory and see them populate the btrfs mounts as you would expect in any mergerFS setup.
Shared Folders can now be create on top of the mergerFS filesystem as normal which maintains the single data subvol per disk (as required by snapraid-btrfs) but we still have some flexibility in the shared folders created and being able to use those for other plugins.
There is also the option to create other shared folders on the btrfs disks but these will NOT be backed up by snapraid so you need to snapshot them via OMV and add backups in another way (or use multiple snapraid configs and run the snapraid commands at different times specifying the config required.. untested!).
This is merely an exercise to see if it all works and it does but I want to see if anyone had any thoughts on this, is there an easier way, a smarter way or are there any pitfalls I've missed etc?
This setup doesnt provide me a fix for the deletion across many disks but I dont think anything mentioned here is going to do that so I'm going to look at my folder structure to limit blast radius if such things happen again.
CH