digint / digint/btrbk

How do I backup my root filesystem? - suggested FAQ entry

Open
#130 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
Perl
Stars
2.1k
Forks
139
PR merge metrics
No merged PRs in 30d

Description

I've read the FAQ, but still am wondering about best practices to backup my root filesystem. The example given there was not sufficient for me to use as a template, so I wrote the following for inclusion / comment:

**Backing up the root filesystem**
For this section, it is assumed that your rootfs is mounted with option `subvol=/rootfs` (See section titled _"How do I convert '/' (subvolid=0) into a subvolume?"_). Also, it is assumed that you have created a `subvol=/btrbk-snap` for storing snapshots generated by `btrbk`.

You will need to mount the rootfs volume a second time with `subvol=/` so that the snapshots can be created in a different namespace (`subvol=/btrbk-snap`) than the one being backed up (`subvol=/rootfs`).

The following setup will mount rootfs's `subvol=/` volume RO (to prevent mishaps inside `/rootfs`) at `/mnt/btrfs-volume/rootfs`. The snapshots directory (`subvol=/btrbk-snap`) will be RW mounted, overlayed on top of the RO version at `/mnt/btrfs-volume/rootfs/btrbk-snap`).

**`btrbk.conf`:**
```
snapshot_dir btrbk-snap
volume /mnt/btrfs-volume/rootfs
subvolume rootfs
```

**`etc/fstab`:**
```
# RO mount of rootfs volume, subvol=/
LABEL=rootfs /mnt/btrfs-volume/rootfs btrfs ro,subvol=/
# RW mount of btrbk-snap, overlapping RO version above
LABEL=rootfs /mnt/btrfs-volume/rootfs/btrbk-snap btrfs rw,subvol=/btrbk-snap
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.