• 4 Posts
  • 15 Comments
Joined 3 years ago
cake
Cake day: June 15th, 2023

help-circle

  • In layman’s speech (my speech) raid 1 and mirroring are essentially the same thing.

    Technically, IIUC RAID is only used for hardware raid controllers, ZFS calls their equivalent RAIDZ1 (and I think it stores data in one disk and parity in another?) and both LVM and btrfs call theirs mirroring (each with its nuances). Whichever you pick, it’s a mode where you use two disks at 50% efficiency and your data survives the loss of one disk.

    There are configurations that use more disks with higher efficiency than 50%, but I would avoid them in a homelab because the more disks you have, the higher the power drain and the higher the chance that at least one of them will fail, and in a homelab scenario you really want to minimize the change of needing to perform maintenance (replacing a drive in a RAID and restoring from a backup are both a hassle).

    In your shoes (and in mine, whenever I’ll need to redo my RAID1 NAS), I’d skip RAID altogether and use the extra disk for extra backups of the data I care about.

    Most of my NAS is filled with movies I’ve ripped, and I honestly wouldn’t really care much if I were to lose them: the movies I may want to re-watch are really few and I can just rip them again (or even buy them again) if the need arises.

    Backups are enormously more important than RAID (will RAID do anything for you if you accidentally delete your family photos? what if the NAS floods or gets dropped on the floor?): you should really direct your time/resources/effort towards setting up automatic and monitored backups before worrying about RAID.


  • A NAS is any computer with space/connectors for drives and an ethernet port… it doesn’t need to be powerful or state-of-the-art, and there’s really no reason it should be expensive (besides the drives).

    Of course companies will be more than happy to sell you an outdated J4125-based computer with 4 disk bays for over 500EUR, but that doesn’t mean you have to bite.

    As for RAID, if you want to use it, just setup mirrored drives (ZFS, BTRFS or even LVM) and be done with it: you’ll need backups anyway so don’t overthink it. Unless you want to avoid downtime (which isn’t probably a big issue for most of your data?), you can do without RAID and just restore from backup if a drive happens to break.

    If you don’t want to build your own PC, I’ve heard good things about these: https://aoostar.com/collections/nas-series (beware: I didn’t try any of them - my N3150-based NAS is not old enough to need replacement yet)













  • 2 more cents :)

    I’ve been using syncthing for a while now, on different devices, and the only unreliability I’ve run into is with android killing syncthing to save battery life, which is kinda hilarious, considering all the vendor- and google-provided crap they happily waste battery on (I don’t use it, but for what I’ve heard iOS is even worse in this regard).

    Specifically, I have a samsung tablet where, no matter how much I tinkered with system settings, synchthing would only run if I manually launched the app or while the tablet was charging (BTW I still use that same tablet, but it now runs LineageOS and syncthing works flawlessly).

    All this is to say, you should probably look into system settings and research ways to convince your OS to do what it’s supposed to rather than tinkering with syncthing itself.




  • IMHO Ansible isn’t much different than a bash script… it has the advantage of being “declarative” (in quotes because it’s not actually declarative at all: it just has higher-level abstractions that aggregate common sysadmin CLI operations/patterns in “declarative-sounding” tasks), but it also has the disadvantage of becoming extremely convoluted the moment you need any custom logic whatsoever (yes, you can write a python extension, but you can do the same starting with a bash script too).

    Also, you basically can’t use ansible unless your target system has python (technically you can, but in practice all the useful stuff needs python), meaning that if you use a distro that doesn’t come with python per default (eg. alpine) you’ll have to manually install it or write some sort of pythonless prelude to your ansible script that does that for you, and that if your target can’t run python (eg. openwrt on your very much resource-constrained wifi APs) ansible is out of the question (technically you can use it, but it’s much more complex than not using it).

    My two cents about configuration management for the homelab:

    • whatever you use, make sure it’s something you re-read often: it will become complex and you will forget everything about it
    • keep in mind that you’ll have to re-test/update your scripts at least everytime your distro version changes (eg. if you upgrade from ubuntu 22.04 to 24.04) and ideally every time one of your configured services changes (because the format of their config files may in theory change too)
    • if you can cope with a rolling-style distro, take a look at nix instead of “traditional” configuration management: nixos configuration is declarative and (in theory) guarantees that you won’t ever need to recheck or update your config when updating (in reality, you’ll occasionally have to edit your config, but the OS will tell you so it’s not like you can unknowingly break stuff).

    BTW, nixos is also not beginner-friendly in the least and all in all badly documented (documentation is extensive but unfriendly and somewhat disorganized)… good luck with that :)


  • With the very limited number of drives one may use at home, just get the cheapest ones (*), use RAID and assume some drive may fail.

    (*) whose performances meet your needs and from reputable enough sources

    You can look at the backblaze stats if you like stats, but if you have ten drives 3% failure rate is exactly the same as 1% or .5% (they all just mean “use RAID and assume some drive may fail”).

    Also, IDK how good a reliabiliy predictor the manufacturer would be (as in every sector, reliabiliy varies from model to model), plus you would basically go by price even if you need a quantity of drives so great that stats make sense on them (wouldn’t backblaze use 100% one manufacturer otherwise?)