I want a server running nextcloud, immich and others.

I have a N100 mini server with a 2TB external HDD. I want to secure the system against data loss. Hence, I want a backup and redundancy.

  1. Most important question: How do I build everything? Is this a NAS? My naive approach is to buy 3 external HDDs and connect them to the N100 with a USB hub. I assume this is not “the right way” but to use/build a NAS. Do I have to build a separate NAS computer? When I lookup NAS buying, it is a computer with a case for 4 drives, excluding the drives and costs 400 bucks. I am confused because this is incredibly expensive compared to what I already have. What is the additional benefit compared to my setup? Am I cheap?

  2. Regarding redundancy, is RAID still the way to go? At 2 TB, using RAID 5 with 3 drives sounds good. I’d have 4 TB of usable space, much more than I intend to use in the next years, and adding a drive increases the storage by 2 TB, effectively increasing space by 50%.

  3. I have 4 TB usable space, but I won’t reach 2 TB in the next one or two years. I’d use a 2 TB HDD for a local backup via borg. Once my hot storage needs to increase, I replace the backup drive with a larger one and use it to increase the RAID storage. Is one backup sufficient? Or should I keeping multiple versions of the data. Daily, weekly, monthly backups? What is your experience with it?

  4. Another 2 TB HDD for an offsite backup, LUKS encrypted, backed up once a year (that’s the goal for now).

Does that sound good?

  • MentalEdge@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    8 days ago
    1. There is no “special” benefit to a pre-built NAS. They have convenient software but there is nothing exceptional about them. They’re just computers with storage drive slots. Using a bunch of external drives via a USB hub would be fine. But is that your only expansion option on the system you have? Access speeds via USB, especially if using a hub, won’t be ideal. It’ll certainly work, though. You can also get enclosures to put full size HDDs in, which can connect to an existing system.

    2. RAID is still the way to go, but since you don’t need much storage, I’d start with RAID 1, not 5. 5 will require a rebuild with a new drive if something goes wrong, while RAID 1 will work with 2 drives and give you complete mirroring. Since you intend to have a “local” backup copy anyway, why not just skip that and use RAID 1? It’s literally the same thing, except it’ll actually provide uptime in case of failure, unlike a backup drive or raid 5.

    3. So RAID 5 plus a local backup, plus another offsite? This is overkill IMO. (Not the offsite backup that’s good. But raid+local copy. Just use two drives and mirror them using whatever you prefer.) In your place, I think I’d go with BTRFS in raid1c2 mode. This is like raid1, in that with two drives, you only get the capacity of one drive. But, the “c2” means that each data block is mirrored to two drives. With more than two drives, you can expand storage. (With three 2TB drives you’d get 3TB) You don’t get as much available storage as with raid5, but you get expandability, which you normally don’t with raid1. And you get uptime in case of failure without an array rebuild (though for this you must mount the volume with the “degraded” option, unlike actual raid using mdadm). You also get filesystem snapshots.

    4. You intend to do this manually? That is fine. My current solution is a second NAS at my dad’s home, to which my system is backed up daily using Kopia. Kopia deduplicates and compresses the backups, efficiently keeping versions up to two years back. The simplest version of this would be a router that can host an FTP server using an external drive in its usb port. This way you could automate off-site backup and have it happen more frequently. Asus routers can do this, and even come with free dynamic DNS and automatic https with letsenrypt. You literally just plug it into WAN somewhere, and you’ll be able to back up to it over the internet.


    Finally, just some mentions.

    MDADM, is what you’d use to create a software RAID array.

    BTRFS has built-in multi-device storage, of which only single, raid0, and raid1 are stable. Do not use the raid5 and 6 modes. While named raid, the modes differ from actual raid. BTRFS is able to convert from one mode to another, and can add drives in any mode (though will need to “balance” the drives after changes, to make additional capacity available). It is also able to evict drives. It will not auto-mount a volume after drive failure, and requires the “degraded” option be added.

    Mergerfs can be used to merge filesystems to expand storage non-destructively. It is able to arbitrarily combine volumes of any type, to combine their capacity. This way, it can for example be used to expand a raid1 array by combining it with a single disk, or another raid1 array, or whatever else. This can be done temporarily, as the combined volume can also be disassembled non-destructively, with each file simply remaining on whatever drive they were on.

    • selfmate@lemmy.zipOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      7 hours ago

      is that your only expansion option on the system you have?

      For now, yes, that’s the only option. I’ll look into internal drives the next time.

      thanks for the info about RAID 1 and BTRFS in raid1c2

      I’ll look into kopia as well since I only knew about borg.

      I am using mergerfs for years, it’s really neat.

      thanks for sharing all of that!

      • MentalEdge@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        6 hours ago

        The main advantages of Kopia, are speed and destination flexibility.

        The off-site storage does not need to have Kopia installed. It can be a mounted network location, an FTP server. Whatever. A generic cloud storage bucket like Backblaze B2.

        That’s why just a router with and external drive hooked up is able to suffice.

        For all of these, you can connect multiple Kopia instances to that same destination, and each client can browse backups, restore from them, and backup their own files to the destination. It even performs file deduplication across different source device. All while that destination device or service, has no access to your encrypted files.

        With borg, you need something like a Pi that can have borg installed. (You can also do this with Kopia, in which case the Kopia instance on the destination device is also able to manage the backups).

        Kopia also beats borg and restic in speed. My daily backups typically complete within a minute or two. I used to use Duplicati, with which it was common for it to take up to an hour. When it started regularly taking more than an hour, I switched to Kopia.

        Kopia is not the fastest for initial backup. The speed of this varies depending on destination type. It does not compress by default, but you can enable almost any type of compression you want. No, what it is fastest at is updating backups. If there is nothing to update, it does not take forever for it to figure that out. Kopia does it in seconds.

        • selfmate@lemmy.zipOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          2 hours ago

          I can’t find anything related to systemd or cron. Does it have its own scheduler? I already set policies. I’m just wondering if I forgot something to setup.

          • MentalEdge@sopuli.xyz
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            2 hours ago

            Depends. If you are running it as a service that starts with the system (sudo sysemctl enable kopia should work with most install methods, as kopia comes with a systemd service you only need to enable) then yes, it will use its own scheduler.

            If you want to use your own scheduling, you’d use anything that can execute a command on a schedule.

        • selfmate@lemmy.zipOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          3 hours ago

          thanks! I installed it and created my first backup. I’ll test it and see how it goes. It looks good. Thank you!