Subvol is a simple tool for BTRFS subvolumes and snapshots.
- subvol help
- subvol list
- subvol create SUBVOLUME
- subvol delete SUBVOLUME
- subvol snapshot help
- subvol snapshot list SUBVOLUME
- subvol snapshot create [SUBVOLUME|all] [HINT]
- subvol snapshot delete SUBVOLUME [SNAPSHOT|NUMBER|RANGE]
- subvol snapshot rollback SUBVOLUME [SNAPSHOT|NUMBER]
- subvol struct help
- subvol struct check
- subvol struct init
- subvol free
The subvolumes and snapshots are organized in the folowing directories:
- /subvol
- /subvol/subvolumes
- /subvol/snapshots
Note that by default the structure is on the file system root. You can change the variable SUBVOL_BASE_DIR
to use another directory.
- Copy the script
subvol
to/usr/local/bin/
sudo cp 'subvol' '/usr/local/bin/';
sudo chmod x '/usr/local/bin/subvol';
- Initiate the
subvol
structure on/subvol
directory
subvol struct init
Execute these steps to enable automatic snapshots on boot.
- Copy the service script to
/etc/systemd/system
:
sudo cp 'subvol-snapshot-auto.service' '/etc/systemd/system/'
- Enable the service script:
sudo systemctl enable subvol-snapshot-auto.service
// The end