If you want to plan how to restore root-snapshot without using Live USB in the future:
- Edit
/etc/mkinitcpio.conf
to addgrub-btrfs-overlayfs
inHOOKS
. - Run
sudo mkinitcpio -P
- Create a new root snapshot with the ability
grub-btrfs-overlayfs
, but all old snapshots do not have this ability. - You can boot into some read-only snapshot with the ability Overlayfs from Grub menu.
- Then restore any snapshot in Btrfs Assistant, then reboot.
If you need the Desktop notification to detect if you are using Overlayfs after booting into read-only snapshot:
- Create a new script
/usr/local/bin/btrfs-assisant-detects-snapshot
:
#!/bin/bash
if stat -f -c '%T' / | grep -q 'btrfs'; then
exit 0
fi
notify-send -u critical -i btrfs-assistant 'Detected!' 'Booted into snapshot, please restore the snapshot.'
-
sudo chmod +x /usr/local/bin/btrfs-assisant-detects-snapshot
-
Create a new script
/etc/xdg/autostart/btrfs-assistant-detects-snapshot.desktop
for startup
[Desktop Entry]
Name=Snapshot Detect
Icon=btrfs-assistant
Exec=/usr/local/bin/btrfs-assisant-detects-snapshot
Terminal=false
Type=Application
See the example: