Categories
Linux Self-hosting Technology

Offsite backup solution – Part 2

Chunk-sized tutorial is back! In the previous part, we booted into Armbian and watched it all via a USB-to-serial console. But that was just the beginning, since we need to set it up before it becomes useful.

Step 1: Initial Armbian setup

  1. root password: Generate some from your password manager and paste it twice.
  2. Live in the fast lane: Consider the warning that this is only an automated build for developers and think to yourself “Well, I already have this Neo3, why not make it do some work?”
    • PS: using something fully supported would be a more reasonable idea.
  3. Select your shell: either bash or zsh are fine.
  4. Create a standard user: Again make use of your password manager and create the user that will be doing the actual backups.

Step 2: Reboot to verify

After restarting, you might be greeted with a root filesystem journal error. In other words, the SD card went bad and corrupted the data. Looks like it is time to go back to the first part of the tutorial and try again with a different SD card!

See you there!

Categories
Linux Self-hosting Technology

Offsite backup solution – Part 1

Welcome back! In Offsite backup solution – Part 0 we discussed the importance of offsite backups and self-hosted solutions. We also went through the general steps of setting this all up. Now, let’s dive into getting Armbian running on a NEO 3 ARM computer since that is what I have at hand. We’ll cover everything from downloading the Armbian image to seeing the Neo3 booted up.

Step 1: Downloading the Armbian Image

Simple, right?

  1. Visit the Armbian Website: Head over to the Armbian download page.
  2. Search for the Neo3: The image should match your hardware.
  3. Download via Torrent: Opt for the torrent link. Your download client will handle the rest.

Why Torrent?
Downloading the large image via torrent is the way to go. Not only does it help share the bandwidth load, but it’s also a nod to the volunteer-supported nature of the project. Let’s give back to the community while we get what we need.

Step 2: Flashing the SD Card

Choosing Your Tool
For flashing your SD card on Linux, we have some great tools available. While Etcher is popular, let’s highlight Popsicle—a simple yet effective tool for this job.

  1. Install Popsicle:

Either from your distribution’s repository, or via Flatpak.

  1. Flash the Image:
  • Open Popsicle: Launch the tool.
  • Select Image: Choose the Armbian image file you downloaded.
  • Select Target: Pick your SD card as the target device.
  • Flash: Hit ‘Next’ and let it work its magic.

Step 3: Connecting via USB-to-Serial Adapter

Compatibility Matters
Not all USB-to-serial adapters are equal. The Neo3 requires a high baud speed: 1500000. Not all adapters support this and they won’t even give you an error when you try it. The CH340 chipsets are reliable and widely available, making them an excellent choice.

  1. Connecting the Adapter:
  • Plug In: Connect the USB-to-serial adapter to your Neo3 and your computer.
  • Check Compatibility: Ensure your adapter supports the required baud speed.
  1. Using GNU Screen to Connect:
  • Install Screen,
  • Start the Connection,
    bash screen /dev/ttyUSB0 1500000

At this point, you should see…nothing! Because the device is not running.

Step 4: Booting the Neo3

  1. Insert the SD Card: Place the flashed SD card into your Neo3.
  2. Power Up: Connect the power supply. Your Neo3 should start booting with Armbian Linux.

Now if you look at your serial console, you should see the Neo3 boot into Armbian Linux:

Welcome to Armbian_community 24.11.0-trunk.351 noble!

Congratulations! In the next part, we’ll build the software stack to perform an automated backup onto an external drive. Things will get interesting!

Categories
Guides Privacy Self-hosting Technology

Offsite backup solution – Part 0

Our digital belongings are growing in size and importance. Family photos, accounting documents, beloved video games, losing them would be a nightmare. Having a backup is definitely mandatory. And if you’re self-hosting a lot like me, an offsite backup is a good way to be able to sleep calmly at night. I recently needed to rebuild my offsite storage system and so I decided to share my setup and my experience using it. This might be a long series, so hold on!

What Are Offsite Backups?

Offsite backups mean storing copies of your data in a different physical location from your main data. That means outside of your house! This way, if something unexpected happens (like a fire, theft, or hardware failure), your data is not completely lost. You could use cloud services for this, but we’ll focus on self-hosted solutions. I like to be in control, plus it gives me good understanding of how it all works.

Benefits of Offsite Backups

  1. Data Security: Keeping your data in a separate place protects it from local disasters.
  2. Redundancy: Extra copies of your data mean you’re covered if something goes wrong.
  3. Peace of Mind: Knowing your data is safe offsite gives you one less thing to worry about.

Additionally, if your backup is offline (in cold storage), it will be cheaper to run. No electricity or compute needed. And no need for fancy firewalls or access management, no one has access to the data unless they physically get to the hard drive.

My Self-Hosted Offsite Backup Setup

I run a local NAS with mirrored hard drives, shared over SMB on the LAN. This is the primary storage.

Next, there is a tiny ARM computer with an external hard drive that receives a weekly snapshot from the NAS, stored and encrypted via BorgBackup.

Lastly, a lonely external hard drive lives in my relative’s flat. And every time I make a visit there, I bring the other hard drive and swap them out.

Self-Hosted Backup Solution Overview

Step 1: Set Up Your Backup Server

  1. Choose Your Hardware: An old computer, a NAS, a Raspberry Pi. Make sure you have enough storage space on two separate drives.
  2. Install Linux: A lightweight Linux distro like Ubuntu Server or Debian works great.
  3. Secure Your Server: Set up SSH for remote access, configure a firewall, and keep your system updated.

Step 2: Configure the Backup Software

  1. Install the backup software: BorgBackup in this case.
  2. Configure mount points: both to the source and the destination of the backup.

Step 3: Automate and Monitor Your Backups

  1. Set up the automation: Fetch the data diff, compress and encrypt it, store it.
  2. Monitoring: Make sure you periodically find out that things DO work.
  3. Swap the drives: This is the actual offsite step!

Step 4: Test Your Backups

  1. Regular Testing: Periodically try and restore some data to make sure your backups and tools work.
  2. Health Checks: Inspect the state of the drives to replace them before they go ERR!

Is that it?

I didn’t even start yet! This was just a brief introduction of what I’m about to discuss in this series. More details to come in the next part where I’ll look into setting up the hardware.