Utility to help manage btrfs snapshots on Slackware linux with elilo UEFI boot
|
|
1 year ago | |
|---|---|---|
| README.md | 1 year ago | |
| config.toml | 1 year ago | |
| snap-slack.SlackBuild | 1 year ago | |
| snap-slack.info | 1 year ago | |
| snap-slack.py | 1 year ago |
Snap-Slack is a Python-based utility for managing Btrfs snapshots on Slackware Linux. It provides functionality to create snapshots, manage existing snapshots, clean up old snapshots, and adopt snapshots as the new root subvolume. The tool also integrates with the Elilo bootloader, updating the configuration automatically to include snapshots.
elilo.conf.snap-slack.SlackBuild script and associated files.Run the SlackBuild script:
./snap-slack.SlackBuild
Install the package:
sudo installpkg /tmp/snap-slack-1.0-x86_64-1_SBo.txz
This will install the script to /usr/bin/snap-slack and place the configuration file at /etc/snap-slack/config.toml.
The script reads its configuration from /etc/snap-slack/config.toml. You may need to edit this file to match your system's settings.
Here is an example configuration (/etc/snap-slack/config.toml):
[snapshot]
snapshot_dir = "/snapshots"
snapshot_prefix = "snapshot-"
btrfs_mount_point = "/mnt"
root_subvolume = "@"
retention_days = 7
[elilo]
elilo_conf = "/boot/efi/EFI/Slackware/elilo.conf"
root_partition = "/dev/sdaX"
snapshot_dir: Directory where Btrfs snapshots are stored.snapshot_prefix: Prefix for snapshot names.btrfs_mount_point: Mount point for the Btrfs volume.root_subvolume: Name of the current root subvolume (usually @).retention_days: Number of days to retain snapshots before automatic deletion.elilo_conf: Path to elilo.conf.root_partition: Device name for the root partition (e.g., /dev/sdaX).Once installed, you can use the snap-slack command to manage Btrfs snapshots and integrate them with Elilo.
To create a new Btrfs snapshot of the root subvolume, run:
snap-slack create
The script will:
elilo.conf bootloader configuration.To manage existing snapshots (e.g., clean up old snapshots and update elilo.conf), run:
snap-slack manage
This will:
elilo.conf has entries for all valid snapshots.If you want to adopt a specific snapshot as the new root subvolume (rollback to a previous state), run:
snap-slack adopt --snapshot <snapshot_name>
For example:
snap-slack adopt --snapshot snapshot-20231015-123456
This will:
@) to something like @_old.@, making it the active root subvolume.elilo.conf to use the new root subvolume.snap-slack create
slackpkg upgrade-all
This ensures that a snapshot is taken before performing a system upgrade.
If your system has issues after a recent change, you can roll back to a previous snapshot:
snap-slack adopt --snapshot snapshot-20231015-123456
This will set snapshot-20231015-123456 as the new root subvolume.
elilo.conf is correctly updated after adopting a snapshot.If you'd like to contribute to Snap-Slack, feel free to open an issue or submit a pull request on the project's repository.
This project is licensed under the MIT License. See the LICENSE file for more details.
For help or support, feel free to open an issue on the repository.