#### Script:
* Snapper:
- Now, the information is retrieved from the info.xml file.
* Timeshift:
* Now, the information is retrieved from the info.json file.
* Probe informations from device:
* Add the UUID of the root and boot subvolumes
* Show full path snapshot or only name:
* Remove, this feature never worked correctly
* Grub-menu:
* Now displays the following information in separate columns:
- Date of snapshot
- Path of snapshot
- Type/Tags of snapshot if available (snapper/timeshift)
- Description/Comments of snapshot if available (snapper/timeshift)
* Possibility to display only the desired information(s) (see config file)
* Adds a header for the column title
* GRUB_BTRFS_PREFIXENTRY is remove
* Boot partition detection:
* grub-btrfs is now able to detect if the boot folder/partition is a subvolume
* GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION should no longer be needed for this case
* Variables:
* Rename some variables
* Header:
* Update the header to reflect the changes.
#### Config:
* GRUB_BTRFS_PREFIXENTRY:
* Remove, no longer use
* GRUB_BTRFS_DISPLAY_PATH_SNAPSHOT:
* Remove, no longer use
* GRUB_BTRFS_TITLE_FORMAT:
* Shows/Hides "date" "snapshot" "type" "description" in the Grub menu, custom order available.
Default: ("date" "snapshot" "type" "description")
* GRUB_BTRFS_IGNORE_SNAPPER_TYPE:
* Rename to GRUB_BTRFS_IGNORE_SNAPSHOT_TYPE
- Supports both timeshift and snapper tags/type
* GRUB_BTRFS_IGNORE_SNAPPER_DESCRIPTION:
* Rename to GRUB_BTRFS_IGNORE_SNAPSHOT_DESCRIPTION
- Supports both snapper and timeshift description/comments
* GRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION:
* grub-btrfs is now able to detect if the boot folder/partition is a subvolume.
Activating this parameter should no longer be necessary for this case.
* GRUB_BTRFS_SNAPPER_CONFIG:
* Remove, no longer use
#### Readme:
* Update "What does grub-btrfs v4.xx do" section
* Adds support for timeshift
grub-btrfs
This is a version 4.xx of grub-btrfs
BTC donation address: 1Lbvz244WA8xbpHek9W2Y12cakM6rDe5Rt
Description :
Improves Grub by adding "btrfs snapshots" to the Grub menu.
You can boot your system on a "snapshot" from the Grub menu.
Supports manual snapshots, snapper, timeshift ...
Warning: booting on read-only snapshots can be tricky
If you choose to do it, /var/log or even /var must be on a separate subvolume.
Otherwise, make sure your snapshots are writeable.
See this ticket for more info.
This project includes its own solution.
Refer to the documentation.
What does grub-btrfs v4.xx do :
- Automatically List snapshots existing on root partition (btrfs).
- Automatically Detect if "/boot" is in separate partition.
- Automatically Detect kernel, initramfs and intel/amd microcode in "/boot" directory on snapshots.
- Automatically Create corresponding "menuentry" in
grub.cfg - Automatically detect the type/tags and descriptions/comments of snapper/timeshift snapshots.
- Automatically generate
grub.cfgif you use the provided systemd service.
Installation :
Arch Linux
The package is available in the community repository grub-btrfs
pacman -S grub-btrfs
Gentoo
grub-btrfs is only available in the Gentoo User Repository (GURU) and not in the official Gentoo repository.
If you have not activated the GURU yet, do so by running:
emerge -av app-eselect/eselect-repository
eselect repository enable guru
emerge --sync
Now merge grub-btrfs via
emerge app-backup/grub-btrfs
Manual
- Run
make installor look into Makefile for instructions on where to put each file. - Dependencies:
NOTE: All distros
Generate your Grub menu after installation for the changes to take effect.
For example:
On Arch Linux or Gentoo use grub-mkconfig -o /boot/grub/grub.cfg.
On Fedora use grub2-mkconfig -o /boot/grub2/grub.cfg
On Debian-like distribution update-grub is an alias to grub-mkconfig ...
Customization :
You have the possibility to modify many parameters in /etc/default/grub-btrfs/config.
See config file for more information.
Automatically update grub :
Systemd
- If you would like grub-btrfs menu to automatically update when a snapshot is created or deleted:
- Use
systemctl enable grub-btrfs.path.grub-btrfs.pathautomatically (re)generatesgrub-btrfs.cfgwhen a modification appears in/.snapshotsmount point (by default).- If the
/.snapshotsmount point is already mounted, then usesystemctl start grub-btrfs.pathto start monitoring.
Otherwise, the unit will automatically start monitoring when the mount point will be available.
- If your snapshots location aren't mounted in
/.snapshots, you must modifygrub-btrfs.pathunit using
systemctl edit --full grub-btrfs.pathand runsystemctl reenable grub-btrfs.pathfor changes take effect.
To find out the name of the.mountunit
usesystemctl list-units -t mount.-
For example: Timeshift mounts its snapshot folder in
/run/timeshift/backup/timeshift-btrfs/snapshots.Use
systemctl edit --full grub-btrfs.path. Then replace the whole block by:[Unit] Description=Monitors for new snapshots DefaultDependencies=no Requires=run-timeshift-backup.mount After=run-timeshift-backup.mount BindsTo=run-timeshift-backup.mount [Path] PathModified=/run/timeshift/backup/timeshift-btrfs/snapshots [Install] WantedBy=run-timeshift-backup.mountThen save and finally run
systemctl reenable grub-btrfs.pathfor changes take effect.
Optional:
If the/run/timeshift/backup/timeshift-btrfs/snapshotsmount point is already mounted,
then usesystemctl start grub-btrfs.pathto start monitoring.
Otherwise, the unit will automatically start monitoring when the mount point will be available. -
You can view your change to
systemctl cat grub-btrfs.path. -
To revert change use
systemctl revert grub-btrfs.path.
-
- If you would like grub-btrfs menu to automatically update on system restart/shutdown:
Look at this comment
Currently not implemented
OpenRC
-
There is sadly no similar solution to the systemd service yet.
As a workaround it is possible to add a script to/etc/local.dto execute the snapshot menu update every time you shut down your system.
To do so just add the following script as/etc/local.d/grub-btrfs-update.stop#!/bin/bash description="Update the grub btrfs snapshots menu" name="grub-btrfs-update" depend() { use localmount } bash -c 'if [ -s "${GRUB_BTRFS_GRUB_DIRNAME:-/boot/grub}/grub-btrfs.cfg" ]; then /etc/grub.d/41_snapshots-btrfs; else {GRUB_BTRFS_MKCONFIG:-grub-mkconfig} -o {GRUB_BTRFS_GRUB_DIRNAME:-/boot/grub}/grub.cfg; fi'If you want to run the menu update on startup instead, rename the file to
grub-btrfs-update.start
Warning :
by default, grub-mkconfig command is used.
Might be grub2-mkconfig on some systems (Fedora ...).
Edit GRUB_BTRFS_MKCONFIG variable in /etc/default/grub-btrfs/config file to reflect this.