Personally I would avoid rasperries like the plague here - they have many downsides when booting up rarely. I'd rather use a Mini PC or ZimaBoard, maybe a build on a MC12 leo (if you can still get it cheap),chuck it all in a cheap case and be good. Unless you have something with IPMI on it I would also invest in a semi professional KVM like PiKVM,JetKVM,NankKVM - and if you can't stop/start power with that due to the device not following the standards maybe an IP switchable plug.
Selfhosted
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:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
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.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
I was browsing and came across a zima 232 for same price as a pi 5. Piqued my interest. Reason for thinking to use a pi is because I have a spare 3b and 4 laying around. Mind you it seems every time I want to play with it I have to reinstall the os or get a new SD card because the kit ones die.
I have a remote backup setup at my parents, which consists of a rpi4 and an external hdd (old NAS HDD). The rpi also has a wireguard interface running. If I need to back stuff up (via a restic-rest container) I open the vpn from my side, start the container, mount/decrypt the hdd and trigger the restic update. Afterwards everything gets disconnected again.
The rpi needs to be always on and you need to be able to forward a port to the rpi.
The data should be secure though, as the disk is encrypted and not mounted. (You can even store the decryption key on your side of the network, so you need the vpn to be able to mount the hdd)
I think this is the play. I’ll likely just get an enclosure for the two 4TB drives I have and can always buy an external drive in the future and get them to plug it in.
I don’t have any experience in setting up wire guard so I’ll have to look into that. I was thinking to use syncthing since that skips the need for that, but I think someone in the thread mentioned that may not be ideal in case of file corruption.
Do you just have raspbian on the pi?
On the one running on my parents side I run raspberryOS. I do have an rpi on my side which is triggering the script and vpn (and also backs up their NAS) That one is running NixOS, but raspberryOS works fine.
I would consider also the case where something goes wrong. Maybe the whole thing crashes, maybe you misconfigure something, maybe there's a power outage or something else happens and you lose the connectivity. Is there someone on site who can do anything to your hardware as you can't easily just go and figure it out by yourself?
If the answer is 'no' then I would strongy reconsider the whole approach. On a worst case scenario the system goes down before you're even back home from the trip and then your hardware is just gathering dust.
In theory that is solvable by a PiKVM,JetKVM,nankKVM, etc.
It won't help if your power supply breaks and KVM itself can malfunction too. It's of course nice to have, but it has limitations.
We are talking about a hobbyist here - if you want to have precautions against all these points OP would need to have a redundant PSU, redundant power sources with automatic failover, backup power,etc. Of course paired with redundant data connections, redundant KVM solutions, physical access management, etc.
In other words: A freaking data center.
Sure, PSUs break. Happens. But very very rarely. And everything else that is on the side of his backup device can be handled through a KVM. And tbh, if that one fails, one can usually direct a "non IT user" to simply pull the plug and put it back on.
Obviously we're talking about hobbyist level stuff and with that there's always something what can go wrong and it's not always obvious what it is. So if the 'remote end' doesn't have someone who can do at least very basic troubleshooting it can be nearly impossible to fix the setup over the phone unless you just replace the whole thing and ship whole units back and forth.
But in this particular case the remote end has someone who knows their stuff so it's taken care of, with or without a KVM. I've been thinking a similar setup with my relatives and on my case the distance isn't an issue but it's still something I'd need to bother family members with and, for me, it was simpler to get a storage box from hetzner and run backups to that instead of getting more hardware.
Maintenance is anyways something you need to consider and viable options for that vary on a case-by-case basis, so there's no 'one size fits all' solution.
This is a good point. The answer in my case is yes, there is someone on site who is tech savvy and can help get it back up and running in the even that something goes down.
This scenario is why my offsite backup is primarily a backblaze b2 bucket, while also running a large media backup to an external HDD once a month which I keep in a storage unit. Janky but effective
Realistically I could coordinate with my brother to set up a backup system at my family's place but it feels like a hassle
I was thinking about backblaze but the cost would be too high I think, and I have so much spare hardware laying around I may as well use it.
Depends on how much you use it. Since I don't use mine for media, mostly for configs and service data folders, I barely scratch 120GB and I'm literally paying under a dollar a month for it right now.
Oh that makes sense, yeah that’s cheap. I have a VPS that has 1TB of storage available, so I can easily use that for configs, dbs, etc. That itself doesn’t have backup enabled, but it’s fine for my needs.
What are you using for your main backup? It probably has a feature for doing remote backup / duplication. You're best off using that.
If you don't, then I think that's probably your first order of business. There are a bunch of good COTS NAS devices that support remote backup to a similar device or to the cloud. Synology generally seems to be the easiest to use based on reviews, but recently they've been getting picky about hard drive support.
If you'd rather DIY then there are some FOSS software options to let you build your own NAS and then back it up to the cloud or to a remote device running the same software. These can get pretty complicated from what I can tell (I'm in the process of doing something similar, been researching). Options include OpenMediaVault, and TrueNAS. TrueNAS seems to be "better" but more complicated and easy to fuck up.
Unraid is also very popular, but it costs money to get a software license. Users swear by it, though.
And on the outside HexOS - a fork (or maybe alternative front end?) of TrueNAS, by some former Unraid devs, with the goal of making TrueNAS as easy to use as Unraid. But it's both paid and beta, so probably not a good choice yet.
These will all allow remote backup to cloud or to a remote device running the same software. They also typically support some kind of virtualization with an app store, so you can use your NAS to host other servers like a media server or immich or home assistant, etc (although app ecosystem abundance will vary).
Wrt hardware, you'll have to look up system requirements for the software you want to use. For example, TrueNAS uses ZFS filesystem, which wants a lot of ram if you need it to perform well.
If your r-pi can run the software you want, then you can get a SATA hat for your pi, to run a couple hard drives. You can also get NAS cases for your pi.
I probably wouldn't recommend leaving a mess of cables and parts at your friend's house across the country, it's better for both of you if the system is fairly well contained - enough for them to move it without risk of parts getting disconnected.
Thanks for the detailed reply.
So my main NAS is Unraid, and I also have a couple of proxmox boxes. Though I’m less concerned about the proxmox boxes as the main files are on the NAS, and I have a proxmox backup server vm set up on Unraid with regular backups there.
For most of my important files on unraid, I have an external drive that I periodically sync and store in a safe.
I also have access to a VPS with over 1TB of space which I am still figuring out how to best integrate into my backup strategy.
For what I’m asking here, I just want to have a simple solution that I can tuck away and have remote access to and just use syncthing or something to keep it updated.
Ah, ok then, never mind my answer. I greatly misjudged what you were really looking for
Depends a little of how you set it up. But for the target system at least use some kind of raid/raidz. With ZFS you can do "zfs-send" perhaps? Or something like good old rsync would work to.
Wake on LAN won't work remotely, so you'd either need to have access to a VPN at their location, or have a 2nd always on device that you can connect to and that could then WoL to your device... or... get a device with an IPMI which you remote into. (All non-VPN forms of remote connection are open to abuse)
I suspect (guess) you're not going to be able to setup a VPN, so perhaps an always on pi is going to be necessary - so maybe it'll be that with drives set to spin down when idle?
OpenMediaVault was my preferred choice until everything went docker on it which was getting too complex for a NAS... so I just created my own, which powers on at certain times of the day and off again when CPU / network IO was low enough.
Data transfer with syncthing is great, but I don't really recommend sync for snapshot backups... (consider your files are all corrupted, it'll happily sync those corruptions) but I have enough space for a few versions of my files, so in theory I can roll back, but it's cetainly not a Grandfather, Father, Son strategy.
Ahh gotcha, I misunderstood that then. I could probably set up a VPN there but don’t want to over complicate it. An always on Pi will be fine I think, they are low power. I could also add a smart switch and set up a schedule or something but I don’t think thats worth the hassle considering the low power usage of a pi.
Hmmm that’s a good point about syncthing backing up corrupt files. I was thinking to use it because I already use it extensively and I wouldn’t need to mess with port forwarding or anything of the sort.
I had multiple copies of files previously as a backup “strategy” and it got way out of hand where I have like 1.5m photos lol. What do you recommend as an alternative to syncthing?
The main point is that sync (like RAID) isn't a backup. If ransomware got in and started encrypting all your files, how would you know / protect yourself..
There's a lot of focus on 3-2-1 backups, so offsite is good, but consider your G-F-S strategy too - as long as this remote copy isn't your only long-term backup option, then sync might be ok for you
So, syncthing / rsync / etc is fine... but maybe just point it to your monthly / weekly / daily backup folder(s) rather than the main files?
You also had some other suggestions I think, like zfs / btrfs snapshots... which would be a point in time copy of your files.
Or burn the photos to DVD / Bluray and store them at the other location? No power requirements there...
I didn’t consider that, excellent point. Forgive my ignorance because I’m not certain how the backup systems work, and feel free to ignore this if you don’t know. I presume they compare some metadata or hash of a file against another file and then decide if it’s the same or not to back up? Let’s say I have a file that I have already backed up, and then there is some ransomware that encrypted my files. Would the back up software make a second copy of the file?
So for most of the important files, I just do a sync to an external drive periodically. Basically when I know there have been a lot of changes. For example I went on a trip last year and came back with nearly 2 TBs of photos/videos. After ingesting the files to unRAID, I synced my external drive. Since I haven’t done much with those files since that first sync, I haven’t done the periodic sync since then. But now you’ve opened my eyes that even this could be a problem. How would the G-F-S strategy work in this case?
I thought about zfs or btrfs but my Unraid array is unfortunately xfs and it’s too large at this point to restart from scratch.
Haha that would be a lot of blurays.
raspberry pi + USB raid enclosure in mirror mode with 2x HDD
Do you think a pi 3b would be enough for this?
I have two spare low performance 4TB drives I was thinking to use for this. It’s not quite enough though. Would be ideal to find a way to be able to have someone there easily add a drive when needed 🤔
The 3b just has USB 2, so even with slow spinning rust, that's going to be a bottleneck. But it's probably still plenty fast as a remote storage device for media storage.
Edit: said I didn't know OP's use case but in re-reading they did say. Edited accordingly.
Hmm good point on it being usb2. I would only occasionally power it on to sync, and the sync could be 50Mb or 20Gb, but even then I think that should be ok.