BTRFS-BACKUP-NG-RESTORE(1)
β¨ btrfs-backup-ng-restore π
okay bestie, settle in, because this is the manual for btrfs-backup-ng-restore, a User Commands page (section 1), and it's a whole vibe. π It's part of the btrfs-backup-ng family, and it's the one you call when you need your snapshots to come back home. No cap.
πΈ NAME πΈ
btrfs-backup-ng-restore β restore snapshots from backup location π¦
β¨ SYNOPSIS β¨
btrfs-backup-ng restore [OPTIONS] SOURCE DESTINATION
btrfs-backup-ng restore --list SOURCE
btrfs-backup-ng restore --volume PATH --to DESTINATION
btrfs-backup-ng restore --list-volumes
btrfs-backup-ng restore --status SOURCE
π DESCRIPTION π
Pull snapshots from backup storage back to a local system. That's it, that's the whole job, and honestly it's giving main character energy. This command is what handles disaster recovery, migration between machines, and point-in-time restoration. π Imagine losing everything and then this thing walks in like "hey girl, I got you" β iconic.
The restore command automatically handles incremental chains, meaning it makes sure all the parent snapshots required for a successful restore actually get transferred. You don't have to babysit the chain. It just knows. β¨
π ARGUMENTS π
- SOURCE β Backup location to restore from. This can be a local path (like
/mnt/backup/home) or an SSH URL (likessh://user@host:/path/to/backup). π - DESTINATION β Local path to restore snapshots to. Must be on a btrfs filesystem. It gets created if it does not exist: it's an output location, the place this command was asked to put something new. That's the key difference between it and a backup location, which must exist (see PATHS in
btrfs-backup-ng(1)). π
π OPTIONS π
Listing and Selection π
-l,--listβ List available snapshots at the backup location, without restoring anything. Just window shopping. ποΈ-s,--snapshot NAMEβ Restore one specific snapshot, by name.--before DATETIMEβ Restore the snapshot closest to the specified time. Format:YYYY-MM-DDorYYYY-MM-DD HH:MM:SS.-a,--allβ Restore all snapshots from the backup location (a full mirror). 1:1, no crumbs. π―-i,--interactiveβ Interactively select which snapshot to restore from a list. You get to pick, bestie, choose wisely. π«Ά--fs-checks auto|strict|skipβ Filesystem verification mode:auto(warn and continue),strict(error on failure),skip(no checks). Default:auto.--skip-remote-lockβ Proceed even if a pin cannot be recorded on the location, wherever its lock store lives (a remote target's lock directory, or a local location's lock file). Only safe when nothing else can prune this location during the run. A medium mounted read-only needs no pin and none is asked for.--skip-verifyβ Skip the pre-restore integrity check for raw backups (restore even if the stored stream's checksum no longer matches, and skip the extra read). Use this for last-copy recovery of a partially-corrupt backup. π It's the "I have no other copy" button, so treat it with care.--timestamp-format FMTβstrftimeformat for parsing snapshot timestamps in direct mode (defaults to the config's[global] timestamp_format, else the built-in).
Transfer Options π
--dry-runβ Print the restore plan and stop. It's the same plan a real run prints and executes, and it refuses exactly what the run would refuse. Love a preview that doesn't lie. π--no-incrementalβ Send every snapshot in full (no-p). The chain a snapshot depends on is still brought, but as full sends. Big, chunky, honest transfers.--compress METHODβ Compress the transfer from anssh://backup location: the remote runsbtrfs sendthrough the compressor, and this host decompresses beforebtrfs receive. Any methodrun --compressaccepts works (zstd,gzip,lz4,xz, ...). Other sources ignore it: a local source has no wire, and araw://orraw+ssh://stream is sent exactly as it was stored. The decompressor must be installed on this host; the restore refuses before connecting when it is not. π«--rate-limit RATEβ Bandwidth limit for transfers. Examples:10M,1G,500K. Throttle it, queen. π’--progressβ Show progress bars during transfers. β¨--no-progressβ Disable progress bars. For the calm, no-drama runs. π§
Safety Options π‘οΈ
--overwriteβ Not supported in this release. Snapshots already at the destination are left exactly as they are, and a warning says so; anything missing is still restored. To replace an existing snapshot, remove it yourself and run the restore again. Why the option does not replace, and what a replacement must satisfy, is indocs/RESTORE-OVERWRITE.md.--in-placeβ Not implemented in this release. The command refuses and restores nothing (exit status 2). A restore receives each snapshot as a nested subvolume atDESTINATION/nameand never replacesDESTINATIONitself. To replace a location, restore into a staging directory, verify it, and swap the subvolumes yourself; the README's Strategy 2 gives the commands and the rollback. The running root filesystem can only be replaced from a rescue system. π--yes-i-know-what-i-am-doingβ Confirm dangerous operations. Heads up: it does not unlock--in-place. Nice try though. π
SSH Options π
--ssh-sudoβ Usesudofor btrfs commands on the remote host.--ssh-key FILEβ Path to SSH private key file.--ssh-auth-sock PATHβ Explicitssh-agentsocket (overrides auto-discovery; useful undersudo).--ssh-host-key-policy POLICYβ Host-key verification for this run:accept-new(default) orstrict. π«Ά
Decryption Options π
--gpg-keyring PATHβ GPG keyring to decrypt an encrypted raw backup (raw:///raw+ssh://). Must match the keyring the backup was encrypted for.--openssl-cipher CIPHERβ OpenSSL cipher fallback for a legacy raw backup whose.metasidecar does not record one. Modern sidecars record the cipher and are authoritative, so this is only consulted for backups written before that was sealed.
Other Options π¦
--prefix PREFIXβ Filter snapshots by prefix (e.g.,"home-"to only show home snapshots).--no-fs-checksβ Skip btrfs subvolume verification. Needed when backup directories are regular directories rather than btrfs subvolumes.
Config-Driven Restore Options βοΈ
-c,--config FILEβ Path to configuration file.--volume PATHβ Restore backups for volume defined in config (e.g.,/home). Uses the backup target(s) configured for that volume.--target INDEXβ Target index to restore from (0-based). Default: first target (0). Use with--volumeto select which backup target to restore from.--to PATHβ Destination path for config-driven restore. Required when using--volume.--list-volumesβ List volumes and their backup targets from the configuration file.
Recovery Options π©Ή
--statusβ Show status of locks and incomplete restores at the backup location. A location holding snapper backups (numbered.snapshots/<n>slots, or raw streams with.snapper-meta.jsonsidecars) lists those backups as well, each with the pins a snapper restore holds on it.--unlock [LOCK_ID]β Unlock stuck restore sessions. Use"all"to unlock all restore locks, or specify a specific lock ID.--cleanupβ Remove what an interrupted restore left atDESTINATION. Each receive is recorded in a run marker underDESTINATION/.btrfs-backup-ng/restore/and the marker is removed once the copy is verified. A subvolume is deleted only when a marker whose restore is no longer running names it, directly under the destination (never.., never through a symlink), and it has noreceived_uuid. Everything else is reported and left, including any subvolume no marker names, however empty. Honours--dry-runand asks for confirmation. π§Ή
π₯ RESTORE STRATEGIES π₯
Strategy 1: Direct Restore (Default) π«
Restore the latest snapshot directly:
btrfs-backup-ng restore /mnt/backup/home /mnt/restore \
--prefix "home-" --no-fs-checks
Strategy 2: Specific Snapshot π―
Restore a specific point in time:
btrfs-backup-ng restore /mnt/backup/home /mnt/restore \
--snapshot home-20260101-120000 --no-fs-checks
Strategy 3: Interactive Selection π«Ά
Choose from a list:
btrfs-backup-ng restore /mnt/backup/home /mnt/restore \
--interactive --no-fs-checks
Strategy 4: Full Mirror πͺ
Restore all snapshots:
btrfs-backup-ng restore /mnt/backup/home /mnt/restore \
--all --no-fs-checks
π EXAMPLES π
- List available snapshots:
btrfs-backup-ng restore --list /mnt/backup/home --no-fs-checks - Restore latest snapshot from local backup:
btrfs-backup-ng restore /mnt/backup/home /mnt/restore --no-fs-checks - Restore from SSH backup with sudo:
btrfs-backup-ng restore ssh://backup@server:/backups/home /mnt/restore --ssh-sudo - Restore specific snapshot:
btrfs-backup-ng restore /mnt/backup/home /mnt/restore --snapshot home-20260101-120000 - Restore snapshot closest to a date:
btrfs-backup-ng restore /mnt/backup/home /mnt/restore --before 2026-01-01 12:00 - Check for stuck locks:
btrfs-backup-ng restore --status /mnt/backup/home --no-fs-checks - Unlock all stuck restore sessions:
btrfs-backup-ng restore --unlock all /mnt/backup/home --no-fs-checks - Clean up partial restores:
btrfs-backup-ng restore --cleanup /mnt/restore - List configured volumes and targets:
btrfs-backup-ng restore --list-volumes - List snapshots for a configured volume:
btrfs-backup-ng restore --volume /home --list - Restore using config (knows backup location):
btrfs-backup-ng restore --volume /home --to /mnt/restore - Restore from second configured target:
btrfs-backup-ng restore --volume /home --target 1 --to /mnt/restore
π§ INCREMENTAL CHAINS π§
A restore brings the chain a snapshot depends on: the older snapshots at a btrfs backup location, or the parent recorded in the .meta sidecar of a raw:// store. Whatever is already at the destination is skipped, and "already there" is decided by identity (the copy's received_uuid against the backup's own), never by name. Each snapshot is sent as an increment from the newest one the destination holds, or in full when it holds none. A request that is already satisfied succeeds with Already at the destination, so nothing to do. π
Example chain:
snap-1 (full) -> snap-2 (incr) -> snap-3 (incr) -> snap-4 (incr)
To restore snap-4 onto an empty destination, snapshots 1, 2, 3 and 4 are all transferred; if snap-2 is already there, only 3 and 4 are. β¨
π WHAT IS ALREADY AT THE DESTINATION π
Okay so bestie, before literally anything gets transferred, the restore does a lil vibe check on every single name it's about to receive. π
And if the destination already has something sitting under that name that is not this backup's copy? Like:
- a partial from an interrupted restore π
- a subvolume somebody made by hand π
- a copy of a different snapshot π
- or just a plain directory πΈ
β¦then the whole restore refuses. It names the path, tells you what that thing actually is, and transfers nothing. No cap.
And it is never deleted. Not touching it. Not even a little. Hands off. π
Same energy for a raw:// increment whose parent is no longer in the store β refused the exact same way, because fr fr, a stored increment only applies onto its parent. That's just how it works. β¨
π©Ή RECOVERY FROM FAILURES π©Ή
So when a transfer fails, the restore cleans up after itself like the responsible main character it is: the partial copy it made gets removed, and its pin on the backup gets released. Slay. π«Ά
But when a restore gets killed outright β SIGKILL, power loss, the whole dramatic exit π β it leaves behind a partial subvolume and its run marker. And guess what? The next restore will straight up refuse to receive onto it. Iconic boundaries, honestly.
Meanwhile, a pin that a killed restore held on an ssh:// or raw+ssh:// target expires on its own a few minutes later. It justβ¦ heals. π§
But if you don't wanna wait? To recover at once:
- Check status:
btrfs-backup-ng restore --status SOURCE - Unlock any stuck sessions:
btrfs-backup-ng restore --unlock all SOURCE - Clean up partial restores:
btrfs-backup-ng restore --cleanup DESTINATION - Retry the restore
Four steps. That's it. You got this. π
π SEE ALSO π
And that's the whole page, bestie!! π This was btrfs-backup-ng β BTRFS-BACKUP-NG-RESTORE(1) β your girl, dated January 2026. Go forth and restore responsibly. Periodt. β¨π
π
π¦ where this page comes from
- fedora 43: btrfs-backup-ng 0.9.20-2.fc43 Β· MIT
- fedora 44: btrfs-backup-ng 0.9.20-1.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms