Live data from Hacker News

Ask HN: How do you backup your linux system?

news.ycombinator.com

31–40 of 86 posts

Re: Ask HN: How do you backup your linux system?

#31
rsync /home, /etc, and a text file of the currently installed package list to my homebuilt ZFS RAIDZ2 NAS running Arch Linux. This has been enough to recover when my laptop drive fails.

Each device gets its own ZFS filesystem and is snapshotted after rsync.

FolderSync on Android does this automatically when I'm on home wifi. AcroSync for Windows. Both FolderSync and AcroSync are worth the small purchase price. Cronjobs for nix machines. iPad syncs to Mac which has a cronjob.

Stuff I really don't want to lose (photos, music, other art) are on multiple machines + cloud.

Re: Ask HN: How do you backup your linux system?

#33
Just keeping my home folder safe, everything else is up and running in less than one hour if I had to start over. Daily backups with borg backup plus a couple of git repos for the dotfiles. All the important stuff is small enough for this, my backup is like 25 gb (a lot of random crap included), and all the photos and videos we used to worry about a few years ago is up in some unlimited sized google cloud for free. Times are pretty good :)

Re: Ask HN: How do you backup your linux system?

#34

Crashplan for docs/media. As for the system, I've been meaning to set up proper automatic btrfs snapshots/rsync but haven't gotten around to it yet. Worst case scenario all the docs/media are on their own RAIDZ array, so if some weird system corruption ever happens I can just reformat/reinstall.

Used to use btrfs until I learned about raid5/6 write hole. Using zfs and very happy.

Re: Ask HN: How do you backup your linux system?

#35
I use `btrbk` as a systemd service to snapshot my `/home` subvolume hourly & any other important subvolumes daily. `btrbk` manages the retention policy, which is roughly something like:

- daily snapshots for 1 week

- the first snapshot of every week for 4 weeks

- the first snapshot of every month for 2 years

- the first snapshot of every year for 5 years

Since I use entirely SSD storage I also have a script that mails me a usage report on those snapshots, and I manually prune ones that accidentally captured something huge. (Like a large coredump, download, etc. I do incremental sends, so I can never remove the most recent snapshot.)

Since snapshots are not backups I use `btrfs send/receive` to replicate the daily snapshots to a different btrfs filesystem on spinning rust, w/ the same retention policy. I do an `rsync` of the latest monthlies (once a month) to a rotating set of drives to cover the "datacenter burned down" scenario.

My restore process is very manual but it is essentially: `btrfs send` the desired subvolume(s) to a clean filesystem, re-snapshot them as read/write to enable writes again, and then install a bootloader, update /etc/fstab to use the new subvolid, etc.

---

Some advantages to this setup:

* incremental sends are super fast

* the data is protected against bitrot

* both the live array & backup array can tolerate one disk failure respectively

Some disadvantages:

* no parity "RAID" (yet)

* defrag on btrfs unshares extents and thus in conjunction with snapshots this balloons the storage required.

* as with any CoW/snapshotting filesystem: figuring out disk usage becomes a non-trivial problem

Re: Ask HN: How do you backup your linux system?

#36
post #3

Put all personal data on a zfs z2 RAID system (FreeNAS). Take regular snapshots. Someday I'm going to get a second offsite system to do ZFS backups to, but so far the above has served well. Then again I've been lucky enough to never have a hard drive fail, so the fact that I can lose 2 without losing data is pretty good. I'm vulnerable to fire and theft, but the most likely data loss scenarios are covered.

Your raid array hasn't failed you until it does one day. Make backups, they don't have to be off-site. Don't wait, speaking from irreparable experience.

Re: Ask HN: How do you backup your linux system?

#37
Excellent rsync-time-backup for local machine, backing up etc and home to external disk: https://github.com/laurent22/rsync-time-backup

Duply for servers, keeping backups on S3: http://duply.net/

Cron does daily DB dumps so Duply stores everything needed to restore servers.

Re: Ask HN: How do you backup your linux system?

#38
I don't back up my systems. Everything important is in some cloud storage somewhere, and I have network boot into installers set up on my network. There's actually one machine where I ran out of space on the local disk and didn't feel like getting up to replace it, so I copied it into a bigger volume on one of my servers and it's been booting off of that ever since.

My customers and employers have all had these rube goldberg enterprisey backup systems, usually Symantec or Veritas talking to HP MSAs.

Re: Ask HN: How do you backup your linux system?

#39
Mostly local network storage which is backedup multiple times automatically, for the laptop I do manual btrfs send/receives manly to get things restored exactly the way they were.

#helps to see the fstab first

    UUID=   /          btrfs   subvol=root 0 0
    UUID=      /boot/efi  vfat    umask=0077,shortname=winnt,x-systemd.automount,noauto 0 0

    cd /boot
    tar -acf boot-efi.tar efi/
    mount  /mnt
    cd /mnt
    btrfs sub snap -r root root.20170707
    btrfs sub snap -r home home.20170707
    btrfs send -p root.20170706 root.20170707 | btrfs receive /run/media/c/backup/
    btrfs send -p home.20170706 home.20170707 | btrfs receive /run/media/c/backup/
    cd
    umount /mnt

So basically make ro snapshots of current root and home, and since they're separate subvolumes they can be done on separate schedules. And then send the incremental changes to the backup volume. While only incremental is sent, the receive side has each prior backup to the new subvolume points to all of those extents and is just updated with this backups changes. Meaning I do not have to restore the increments, I just restore the most recent subvolume on the backup. I only have to keep one dated read-only snapshot on each volume, there is no "initial" backup because each subvolume is complete.

Anyway, restores are easy and fast. I can also optionally just send/receive home and do a clean install of the OS.

Related, I've been meaning to look into this project in more detail which leverages btrfs snapshots and send/receive. https://github.com/digint/btrbk

Re: Ask HN: How do you backup your linux system?

#40
Not Linux, but same answer as it would be.

`rsync -av --files-from=".backup_directories"` on a daily cron job.

iMac and work hackintosh rsynced to local and remote backup machine daily. Windows machine (where all my music and pictures live) both rsynced to local and remote backup machine, and Cobian'd to a second drive daily. I also will run the same Cobian backup to a cold external drive every month or so.

Deathly afraid of data loss.

Post reply on HN