User Tools

  • (equal to forum credentials)

Site Tools


snapshots

This is an old revision of the document!


BTRFS Snapshots

BTRFS Snapshots

The primary reason for XBian moving to the btrfs filesystem is its automated system for taking snapshots both whenever major system changes are made (such as upgrading the system) and on a scheduled basis. XBian automatically takes a snapshot when apt-get upgrade is run (either from xbian-config or from the console) and takes daily and weekly snapshots as well.

List existing snapshots

To get a list of all existing snapshots, you just have to run

btrfs-auto-snapshot list [{data | home | modules | root}]

with root privilege. Example:

sudo btrfs-auto-snapshot list root

will list all available snapshots for the root partition. The output will look similar to below

root/@
root/@btrfs-auto-snap_daily-2014-06-04-1905
root/@btrfs-auto-snap_weekly-2014-06-04-1905
root/@last_good_known

In this case there are two snapshots available for root - the daily and the weekly one.

Restoring a snapshot

To restore a snapshot, just run

btrfs-auto-snapshot rollback <snapshot>

with root privilege. The changes will take effect after a reboot. Example:

sudo btrfs-auto-snapshot rollback root/@btrfs-auto-snap_daily-2014-06-04-1905
sudo reboot

Removing a snapshot

Removing a snapshot - e.g. for getting more disk space - does work analog to the rollback command. So, you just have to run

btrfs-auto-snapshot destroy <snapshot>

with root privilege. Example:

sudo btrfs-auto-snapshot destroy root/@btrfs-auto-snap_daily-2014-06-04-1905

Removing all snapshots at once

If you want to remove all existing snapshots at once, just execute: 1)

sudo btrfs-auto-snapshot list | grep -v /@$ | grep auto-snap | xargs -L1 sudo btrfs-auto-snapshot destroy

1) Post #18701 from mk01
snapshots.1401957469.txt.gz · Last modified: 2014/06/05 10:37 by josch