[opensuse-support] btrfs backup and reconstruction - to/from 2nd machine via ssh on Leap 15.1
Hi all, I thought this was a pretty "standard scenario" - however, I failed to find reasonable tutorials or wikis about this subject. Please correct me if I am wrong. Idea: I have two machines, both running openSUSE Leap 15.1. Both use btrfs in openSUSE's standard configuration (except for /home, but this is beyond the scope of my question). I.e. there are subvolumes for /var, /usr/local, /tmp, /srv, /root, /opt, /boot/grub2/x86_64-efi and /boot/grub2/i386-pc. Both machines also run snapper, also in openSUSE's standard configuration. One machine is a workstation, the other is a data sink (i.e. a backup system or NAS). The backup system has plenty of unpartitioned and unformatted space available. The workstation is supposed to backup its subvolumes and snapshots (created by snapper) to the backup system. Right now, I do not care whether this is manual labor or a cron job - it's about principles. I am interested in how to configure both systems so that in the event of e.g. a disk failure in the workstation I am able to recover quickly and efficiently from my backups on the backup system. Just for fun, let's say in one scenario I want to recover to the exact same (wiped) harddrive in the workstation and in another scenario I want to recover to a new hard drive in the workstation. So far, I have not had a defect requiring such actions. And I surely do not want to provoke anything similar. However, I'd be very interested in going through the steps with two "live" virtual machines - all the way from system configuration, backup and "failure" to recovery. *Would someone here on this mailing list be willing to support this little experiment? I'd be more than happy to wrap the eventual findings into a readable wiki article / tutorial.* I have performed similar actions successfully with ZFS before (though not for root/system partitions). As far as ZFS is concerned, I am fairly certain about procedures and terminology. However, btrfs has slightly different interpretations of snapshots, subvolumes and mounting (configurations) and how (incremental) send/receive works on top of that. After studying various articles at btrfs.wiki.kernel.org I am admittedly left somewhat more confused than before. Best regards, Sebastian -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
On Sunday, 21 July 2019 14:45:13 BST Sebastian M. Ernst wrote:
Hi all,
I thought this was a pretty "standard scenario" - however, I failed to find reasonable tutorials or wikis about this subject. Please correct me if I am wrong.
Idea: I have two machines, both running openSUSE Leap 15.1. Both use btrfs in openSUSE's standard configuration (except for /home, but this is beyond the scope of my question). I.e. there are subvolumes for /var, /usr/local, /tmp, /srv, /root, /opt, /boot/grub2/x86_64-efi and /boot/grub2/i386-pc. Both machines also run snapper, also in openSUSE's standard configuration. One machine is a workstation, the other is a data sink (i.e. a backup system or NAS). The backup system has plenty of unpartitioned and unformatted space available.
The workstation is supposed to backup its subvolumes and snapshots (created by snapper) to the backup system. Right now, I do not care whether this is manual labor or a cron job - it's about principles. I am interested in how to configure both systems so that in the event of e.g. a disk failure in the workstation I am able to recover quickly and efficiently from my backups on the backup system. Just for fun, let's say in one scenario I want to recover to the exact same (wiped) harddrive in the workstation and in another scenario I want to recover to a new hard drive in the workstation.
I use btrfs-sxbackup which allows me to stream the subvolumes. I can stream all of my subvolumes with a simple btrfs-sxbackup run * from the backup location and another script that allows me to restore subvolumes. I have tested this building a duplicate drive as well as had to use it for real. It is a pretty good tool built around btrfs send and receive commands. Hope this helps. -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
Hi Andrew,
I use btrfs-sxbackup which allows me to stream the subvolumes. I can stream all of my subvolumes with a simple btrfs-sxbackup run * from the backup location and another script that allows me to restore subvolumes. I have tested this building a duplicate drive as well as had to use it for real. It is a pretty good tool built around btrfs send and receive commands. Hope this helps.
I stumbled across this tool a while ago. Looks very promising. Thanks for pointing it out. Though it still leaves the question how to properly bootstrap this setup and what steps have to be taken for restoring a standard openSUSE Leap system from such backups. Best regards, Sebastian -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
On Monday, 22 July 2019 09:01:50 BST Sebastian M. Ernst wrote:
Hi Andrew,
I use btrfs-sxbackup which allows me to stream the subvolumes. I can stream all of my subvolumes with a simple btrfs-sxbackup run * from the backup location and another script that allows me to restore subvolumes. I have tested this building a duplicate drive as well as had to use it for real. It is a pretty good tool built around btrfs send and receive commands. Hope this helps.
I stumbled across this tool a while ago. Looks very promising. Thanks for pointing it out.
Though it still leaves the question how to properly bootstrap this setup and what steps have to be taken for restoring a standard openSUSE Leap system from such backups.
Best regards, Sebastian
Hi Sebastian I have made my poor scripts available on my gitlab server https://git.acolvin.me.uk/backups/btrfs-backup (signed by my own CA so either accept certificate issue in the browser or download my CA cert from http:// www.acolvin.me.uk/acolvinCA2.pem) The restore script is the interested one and is based around the subvolume structure openSUSE used when I created the system so will need changing now as there are fewer subvolumes on the last VM I created. You can restore to a spare drive (ie from a rescue session with a drive mounted or onto a usb drive) and then you should be able to boot Hope it helps Andrew -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
participants (2)
-
Andrew Colvin
-
Sebastian M. Ernst