this post was submitted on 08 Aug 2024
46 points (96.0% liked)

Selfhosted

39948 readers
220 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

I have a load-bearing raspberry pi on my network - it runs a DNS server, zigbee2mqtt, unifi controller, and a restic rest server. This raspberry pi, as is tradition, boots from a microSD card. As we all know, microSD cards suck a little bit and die pretty often; I've personally had this happen not all that long ago.

I'd like to keep a reasonably up-to-date hot spare ready, so when it does give up the ghost I can just swap them out and move on with my life. I can think of a few ways to accomplish this, but I'm not really sure what's the best:

  • The simplest is probably cron + dd, but I'm worried about filesystem corruption from imaging a running system and could this also wear out the spare card?
  • recreate partition structure, create an fstab with new UUIDs, rsync everything else. Backups are incremental and we won't get filesystem corruption, but we still aren't taking a point-in-time backup which means data files could be inconsistent with each other. (honestly unlikely with the services I'm running.)
  • Migrate to BTRFS or ZFS, send/receive snapshots. This would be annoying to set up because I'd need to switch the rpi's filesystem, but once done I think this might be the best option? We get incremental updates, point-in-time backups, and even rollback on the original card if I want it.

I'm thinking out loud a little bit here, but do y'all have any thoughts? I think I'm leaning towards ZFS or BTRFS.

you are viewing a single comment's thread
view the rest of the comments
[–] possiblylinux127@lemmy.zip 0 points 3 months ago (2 children)

ZFS isn't going to perform well on a Raspberry Pi

[–] avidamoeba@lemmy.ca 3 points 3 months ago* (last edited 3 months ago) (1 children)

I used it on a Pi 4 in 2019 for an USB-connected mirror and it worked well. Unencrypted throughput was upwards from 200MB/s. Encrypted throughput dropped down to under 100MB/s due to insufficient compute. The Pi 4 is a powerful computer and the Pi 5 even more so. Pi 3 and older, not so much.

[–] traches@sh.itjust.works 2 points 3 months ago (2 children)

It’s a 4gb pi4, think it could boot from ZFS?

[–] possiblylinux127@lemmy.zip 4 points 3 months ago

You could boot from from an SD and then store data on a external drive. I would go Btrfs over ZFS unless you have at least 3 or more disks

[–] avidamoeba@lemmy.ca 1 points 3 months ago

I would try it. My only issue is I have no idea how to set it up on root on a Pi. Perhaps there's docs somewhere. If had to setup a new Pi with Pi OS/Debian/Ubuntu today I'd definitely try it. Most of my Pis are running OpenWrt though.

[–] traches@sh.itjust.works 1 points 3 months ago (1 children)

Performance is all but irrelevant in this case

[–] possiblylinux127@lemmy.zip 1 points 3 months ago (1 children)

You say that but when the system starts to lock up you might change your tune

[–] avidamoeba@lemmy.ca 1 points 3 months ago* (last edited 3 months ago)

Why would it lock up? ZFS will use as much RAM as you give it and it doesn't seem CPU-bound unless you turn on encryption. It's not a cluster FS like Ceph. Why do you expect ZFS to lock up and Btrfs not to?