Open Xe-no1 opened 1 month ago
Try remaking grub, the automation might not be working.
sudo grub-mkconfig -o /boot/grub/grub.cfg
Yep I did that exact command, still doesn't recognise any snapshots
Maybe you have forgotten to start the daemon?
Try 'systemctl status grub-btrfsd' to find out, and 'systemctl start grub-btrfsd' to start it if it isn't
Maybe you have forgotten to start the daemon?
Try 'systemctl status grub-btrfsd' to find out, and 'systemctl start grub-btrfsd' to start it if it isn't
I have used the 'systemctl enable grub-btrfsd' so it should start on system startup anyway, and after editing the config to support Timeshift I did 'systemctl restart grub-btrfsd'. I double checked anyway with 'systemctl status grub-btrfsd' and the grub-btrfsd is active
Yes that's sounds good to me.
Can you watch the syslog (I think with systemd the command for that should be 'journalctl -f') then open timeshift, do a snapshot in timeshift and close it again? Then post the output of the syslog here.
Yes that's sounds good to me.
Can you watch the syslog (I think with systemd the command for that should be 'journalctl -f') then open timeshift, do a snapshot in timeshift and close it again? Then post the output of the syslog here.
Here is the exact full output as a txt file:
[mazentech@Archie ~]$ journalctl -f
Aug 02 13:56:18 Archie systemd[701]: Starting flatpak session helper...
Aug 02 13:56:18 Archie systemd[701]: Started flatpak session helper.
Aug 02 13:56:18 Archie systemd[701]: Started app-flatpak-org.kde.konsole-1681.scope.
Aug 02 13:56:19 Archie xdg-desktop-portal-kde[942]: xdp-kde-settings: Key "menuFont" doesn't exist
Aug 02 13:56:19 Archie xdg-desktop-portal-kde[942]: xdp-kde-settings: Key "font" doesn't exist
Aug 02 13:56:19 Archie xdg-desktop-portal-kde[942]: xdp-kde-settings: Key "activeFont" doesn't exist
Aug 02 13:56:19 Archie xdg-desktop-portal-kde[942]: xdp-kde-settings: Key "toolBarFont" doesn't exist
Aug 02 13:56:19 Archie xdg-desktop-portal-kde[942]: xdp-kde-settings: Key "smallestReadableFont" doesn't exist
Aug 02 13:56:19 Archie xdg-desktop-portal-kde[942]: xdp-kde-settings: Key "fixed" doesn't exist
Aug 02 13:56:22 Archie flatpak[1701]: "applications.menu" not found in QList()
Aug 02 13:56:59 Archie systemd[701]: Started Timeshift - System Restore Utility.
Aug 02 13:56:59 Archie timeshift-launcher[1776]: /usr/bin/timeshift-launcher: line 16: xhost: command not found
Aug 02 13:56:59 Archie polkit-kde-authentication-agent-1[940]: Listener adapter polkit_qt_listener_initiate_authentication
Aug 02 13:56:59 Archie polkit-kde-authentication-agent-1[940]: GSimpleAsyncResult: 0xaaaaec1bbe00
Aug 02 13:56:59 Archie polkit-kde-authentication-agent-1[940]: polkit_qt_listener_initiate_authentication callback for 0xaaaaec18ee80
Aug 02 13:56:59 Archie polkit-kde-authentication-agent-1[940]: Initiating authentication
Aug 02 13:56:59 Archie polkit-kde-authentication-agent-1[940]: Action description has been found
Aug 02 13:56:59 Archie plasmashell[902]: The cached device pixel ratio value was stale on window update. Please file a QTBUG which explains how to reproduce.
Aug 02 13:56:59 Archie polkit-kde-authentication-agent-1[940]: User: "unix-user:mazentech"
Aug 02 13:56:59 Archie polkit-kde-authentication-agent-1[940]: Trying again
Aug 02 13:56:59 Archie polkit-agent-helper-1[1786]: pam_systemd_home(polkit-1:auth): New sd-bus connection (system-bus-pam-systemd-home-1786) opened.
Aug 02 13:56:59 Archie polkit-kde-authentication-agent-1[940]: REQUEST
Aug 02 13:56:59 Archie polkit-kde-authentication-agent-1[940]: Request: "Password: "
Aug 02 13:57:03 Archie polkit-kde-authentication-agent-1[940]: Dialog accepted
Aug 02 13:57:03 Archie polkit-kde-authentication-agent-1[940]: COMPLETED
Aug 02 13:57:03 Archie polkit-kde-authentication-agent-1[940]: Completed: true
Aug 02 13:57:03 Archie polkit-kde-authentication-agent-1[940]: Finishing obtaining privileges
Aug 02 13:57:03 Archie polkit-kde-authentication-agent-1[940]: Listener adapter polkit_qt_listener_initiate_authentication_finish
Aug 02 13:57:03 Archie polkit-kde-authentication-agent-1[940]: polkit_qt_listener_initiate_authentication_finish callback for 0xaaaaec18ee80
Aug 02 13:57:03 Archie polkit-kde-authentication-agent-1[940]: Finish obtain authorization: true
Aug 02 13:57:03 Archie polkit-kde-authentication-agent-1[940]: Dialog cancelled
Aug 02 13:57:03 Archie polkit-kde-authentication-agent-1[940]: Finishing obtaining privileges
Aug 02 13:57:03 Archie polkit-kde-authentication-agent-1[940]: Finish obtain authorization: true
Aug 02 13:57:03 Archie polkitd[781]: Operator of unix-session:2 successfully authenticated as unix-user:mazentech to gain ONE-SHOT authorization for action in.teejeetech.pkexec.timeshift-gtk for unix-process:1772:10180 [bash /usr/bin/timeshift-launcher] (owned by unix-user:mazentech)
Aug 02 13:57:03 Archie pkexec[1777]: pam_unix(polkit-1:session): session opened for user root(uid=0) by mazentech(uid=1000)
Aug 02 13:57:03 Archie pkexec[1777]: mazentech: Executing command [USER=root] [TTY=unknown] [CWD=/home/mazentech] [COMMAND=/usr/bin/timeshift-gtk]
Aug 02 13:57:03 Archie timeshift-launcher[1777]: App config loaded: /etc/timeshift/timeshift.json
Aug 02 13:57:03 Archie timeshift-launcher[1777]: Mounted '/dev/sda3' at '/run/timeshift/1777/backup'
Aug 02 13:57:03 Archie timeshift-launcher[1777]: btrfs: Quotas are not enabled
Aug 02 13:57:03 Archie kwin_wayland[744]: kf.windowsystem: static bool KX11Extras::mapViewport() may only be used on X11
Aug 02 13:57:04 Archie grub-btrfsd[1839]: 434: detected Timeshift startup, PID is: 1777
Aug 02 13:57:04 Archie systemd[1]: tmp-grub\x2dbtrfs.9MMEPF8CSx.mount: Deactivated successfully.
Aug 02 13:57:04 Archie grub-btrfsd[2109]: Grub menu recreated
Aug 02 13:57:04 Archie grub-btrfsd[2110]: 434: Watching /run/timeshift/1777/backup/timeshift-btrfs/snapshots for new snapshots...
Aug 02 13:57:17 Archie timeshift-launcher[1777]: Creating new backup...(BTRFS)
Aug 02 13:57:17 Archie timeshift-launcher[1777]: Saving to device: /dev/sda3, mounted at path: /run/timeshift/1777/backup
Aug 02 13:57:17 Archie timeshift-launcher[1777]: Created directory: /run/timeshift/1777/backup/timeshift-btrfs/snapshots/2024-08-02_13-57-17
Aug 02 13:57:17 Archie grub-btrfsd[2116]: 434: Detected snapshot creation/ deletion, recreating Grub menu
Aug 02 13:57:17 Archie timeshift-launcher[1777]: Created subvolume snapshot: /run/timeshift/1777/backup/timeshift-btrfs/snapshots/2024-08-02_13-57-17/@
Aug 02 13:57:17 Archie timeshift-launcher[1777]: Created subvolume snapshot: /run/timeshift/1777/backup/timeshift-btrfs/snapshots/2024-08-02_13-57-17/@home
Aug 02 13:57:17 Archie timeshift-launcher[1777]: Created control file: /run/timeshift/1777/backup/timeshift-btrfs/snapshots/2024-08-02_13-57-17/info.json
Aug 02 13:57:17 Archie timeshift-launcher[1777]: BTRFS Snapshot saved successfully (0s)
Aug 02 13:57:17 Archie timeshift-launcher[1777]: Tagged snapshot '2024-08-02_13-57-17': ondemand
Aug 02 13:57:17 Archie timeshift-launcher[1777]: ------------------------------------------------------------------------------
Aug 02 13:57:22 Archie systemd[1]: tmp-grub\x2dbtrfs.kU7JNRRuaP.mount: Deactivated successfully.
Aug 02 13:57:22 Archie grub-btrfsd[2425]: Grub menu recreated
Aug 02 13:57:26 Archie timeshift-launcher[1777]: App config saved: /etc/timeshift/timeshift.json
Aug 02 13:57:26 Archie crontab[2429]: (root) LIST (root)
Aug 02 13:57:26 Archie crontab[2430]: (root) LIST (root)
Aug 02 13:57:26 Archie systemd[1]: run-timeshift-1777-backup.mount: Deactivated successfully.
Aug 02 13:57:26 Archie timeshift-launcher[2437]: /usr/bin/timeshift-launcher: line 18: xhost: command not found
Aug 02 13:57:26 Archie timeshift-launcher[2438]: /usr/bin/timeshift-launcher: line 19: xhost: command not found
Aug 02 13:57:26 Archie systemd[701]: app-timeshift\x2dgtk@e14d38527db245569dadeb6a74a9c056.service: Main process exited, code=exited, status=127/n/a
Aug 02 13:57:26 Archie systemd[701]: app-timeshift\x2dgtk@e14d38527db245569dadeb6a74a9c056.service: Failed with result 'exit-code'.
Aug 02 13:57:35 Archie flatpak[1701]: qt.qpa.wayland: Creating a popup with a parent, QWidgetWindow(0xaaaaf94d6830, name="MainWindow#1Window") which does not match the current topmost grabbing popup, QWidgetWindow(0xaaaaf9b53430, name="QMenuClassWindow") With some shell surface protocols, this is not allowed. The wayland QPA plugin is currently handling it by setting the parent to the topmost grabbing popup. Note, however, that this may cause positioning errors and popups closing unxpectedly. Please fix the transient parent of the popup.
Aug 02 13:57:35 Archie flatpak[1701]: The cached device pixel ratio value was stale on window update. Please file a QTBUG which explains how to reproduce.
Aug 02 13:57:40 Archie grub-btrfsd[2451]: 434: detected timeshift shutdown
Aug 02 13:57:40 Archie grub-btrfsd[2455]: Watching /run/timeshift for timeshift to start
Aug 02 13:58:06 Archie flatpak[1701]: kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected"
Aug 02 13:58:06 Archie flatpak[1701]: "Not connected to D-Bus server"
Aug 02 13:58:06 Archie flatpak[1701]: kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected"
Aug 02 13:58:06 Archie flatpak[1701]: "Not connected to D-Bus server"
Aug 02 13:58:06 Archie flatpak[1701]: kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected"
Aug 02 13:58:06 Archie flatpak[1701]: "Not connected to D-Bus server"
Aug 02 13:58:06 Archie flatpak[1701]: kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected"
Aug 02 13:58:06 Archie flatpak[1701]: "Not connected to D-Bus server"
Aug 02 13:58:06 Archie flatpak[1701]: kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected"
Aug 02 13:58:06 Archie flatpak[1701]: "Not connected to D-Bus server"
Aug 02 13:58:06 Archie flatpak[1701]: kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected"
Aug 02 13:58:06 Archie flatpak[1701]: "Not connected to D-Bus server"
Aug 02 13:58:06 Archie flatpak[1701]: kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected"
Aug 02 13:58:06 Archie flatpak[1701]: "Not connected to D-Bus server"
Aug 02 13:58:06 Archie flatpak[1701]: kf.solid.backends.udisks2: Failed enumerating UDisks2 objects: "org.freedesktop.DBus.Error.Disconnected"
Aug 02 13:58:06 Archie flatpak[1701]: "Not connected to D-Bus server"
So it seems like grub-btrfsd is working correctly. It detects snapshots being created and trigger the grub submenu creation (it says "grub menu recreated" in the logs after timeshift creates the snapshot)
What this does is running '/etc/grub.d/41_snapshots-btrfs' So let's continue there. Maybe you can run this command and see if that gives us any errors. Also, if you create a snapshot in timeshift and after that run this command, does the snapshot show up in the next boot?
Also if you give it the command 'btrfs subvolume list -sa /' what does it say?
Okay to address your points, running the first command just says "Detecting snapshots..." on all occasions (Both before and after Timeshift snapshot creation), not an error but not a success either, Here is the output:
[mazentech@Archie ~]$ /etc/grub.d/41_snapshots-btrfs
Detecting snapshots ...
[mazentech@Archie ~]$ /etc/grub.d/41_snapshots-btrfs
Detecting snapshots ...
[mazentech@Archie ~]$ /etc/grub.d/41_snapshots-btrfs
Detecting snapshots ...
[mazentech@Archie ~]$
The first two were before making a snapshot and the third output is after the Timeshift snapshot, all of them are the exact same. No, no snapshot boot entries showed up in the next boot after making a snapshot and running the former command. As for the second command, the "btrfs subvolume list -sa /", here is the output of that command, I had to use 'sudo' for elevated privileges:
[mazentech@Archie ~]$ btrfs subvolume list -sa /
ERROR: can't perform the search: Operation not permitted
[mazentech@Archie ~]$ sudo btrfs subvolume list -sa /
[sudo] password for mazentech:
ID 265 gen 346 cgen 162 top level 5 otime 2024-07-31 22:11:26 path <FS_TREE>/timeshift-btrfs/snapshots/2024-07-31_19-11-26/@
ID 266 gen 164 cgen 163 top level 5 otime 2024-07-31 22:11:26 path <FS_TREE>/timeshift-btrfs/snapshots/2024-07-31_19-11-26/@home
ID 267 gen 346 cgen 183 top level 5 otime 2024-07-31 22:26:31 path <FS_TREE>/timeshift-btrfs/snapshots/2024-07-31_19-26-31/@
ID 268 gen 185 cgen 184 top level 5 otime 2024-07-31 22:26:31 path <FS_TREE>/timeshift-btrfs/snapshots/2024-07-31_19-26-31/@home
ID 269 gen 346 cgen 230 top level 5 otime 2024-07-31 23:05:39 path <FS_TREE>/timeshift-btrfs/snapshots/2024-07-31_20-05-39/@
ID 270 gen 232 cgen 231 top level 5 otime 2024-07-31 23:05:39 path <FS_TREE>/timeshift-btrfs/snapshots/2024-07-31_20-05-39/@home
ID 271 gen 346 cgen 346 top level 5 otime 2024-08-02 13:57:17 path <FS_TREE>/timeshift-btrfs/snapshots/2024-08-02_13-57-17/@
ID 272 gen 347 cgen 347 top level 5 otime 2024-08-02 13:57:17 path <FS_TREE>/timeshift-btrfs/snapshots/2024-08-02_13-57-17/@home
ID 273 gen 366 cgen 366 top level 5 otime 2024-08-03 01:52:01 path <FS_TREE>/timeshift-btrfs/snapshots/2024-08-03_01-52-01/@
ID 274 gen 367 cgen 367 top level 5 otime 2024-08-03 01:52:01 path <FS_TREE>/timeshift-btrfs/snapshots/2024-08-03_01-52-01/@home
[mazentech@Archie ~]$
Sorry I forgot to mention, the first command also needs sudo
Sorry I forgot to mention, the first command also needs sudo
In that case, after running it with sudo I do get lots of text, and in the end it just ends up saying "No snapshots found". Here is the output:
[mazentech@Archie ~]$ sudo /etc/grub.d/41_snapshots-btrfs
[sudo] password for mazentech:
Detecting snapshots ...
if [ ! -e "${prefix}/grub-btrfs.cfg" ]; then
echo ""
else
submenu 'Arch Linux ARM snapshots' {
configfile "${prefix}/grub-btrfs.cfg"
}
fi
No snapshots found.
If you think an error has occurred, please file a bug report at "https://github.com/Antynea/grub-btrfs"
Unmount /tmp/grub-btrfs.whr3wpL0dT .. Success
[mazentech@Archie ~]$ sudo /etc/grub.d/41_snapshots-btrfs
Detecting snapshots ...
if [ ! -e "${prefix}/grub-btrfs.cfg" ]; then
echo ""
else
submenu 'Arch Linux ARM snapshots' {
configfile "${prefix}/grub-btrfs.cfg"
}
fi
No snapshots found.
If you think an error has occurred, please file a bug report at "https://github.com/Antynea/grub-btrfs"
Unmount /tmp/grub-btrfs.uFMxYDLx1Y .. Success
[mazentech@Archie ~]$
Ok, so executing this script is what grub does as well. And it gets back this snippet you postet and integrates that into the grub.cfg file in /boot/grub. For some reason the script can't find any snapshots but btrfs-progs can. Hm.
You say you're running grub-btrfs version 4.12. is there any particular reason for that? I know there have been some problems with changes in btrfs-progs in the past which led to grub-btrfs not working anymore. Could you try upgrading to 4.13?
Ok, so executing this script is what grub does as well. And it gets back this snippet you postet and integrates that into the grub.cfg file in /boot/grub. For some reason the script can't find any snapshots but btrfs-progs can. Hm.
You say you're running grub-btrfs version 4.12. is there any particular reason for that? I know there have been some problems with changes in btrfs-progs in the past which led to grub-btrfs not working anymore. Could you try upgrading to 4.13?
Yes about that, I'm having the same issue as this guy here: #341. I just used 'pacman' to install grub-btrfs, not even the AUR and it is supposed to be on 4.13, but as in the grub-btrfs config file it actually says that I have version 4.12.
To add on, if necessary I could compile from source and get the package that way, but idk if the grub-btrfs config is just wrong and that I am using 4.13, or if the 'pacman' package is actually not up to date with the source on GitHub.
No you're fine. I think that was just a mistake I made in the 4.13 commit.
There is one issue where the user had the same problem and with migration from timeshift to snapper it got solved. Instead of migrating directly, maybe make a manual snapshot first and see if it is detected. To do this run 'sudo mkdir /snapshots' 'btrfs subvolume snapshot / /snapshots/mysnapshot' Then run grub-config again as usual.
To get rid of the snapshot just delete the /snapshots directory again.
Okay, so I am on the latest version. What you're saying so far is that btrfs-progs detects the snapshot but the script doesn't, yes?
Yes. The script is using btrfs-progs as well, then parses the output of btrfs-progs using awk and such. If something in the output of btrfs-progs changes, the script will fail. But then again, if that is the case you wouldn't be the only one opening an issue here I guess.
Another thing I must add, why is the output so crowded and 'unclean', I thought it would just say "Detecting snapshots" and directly after mention it finding any snapshots or not, but in the output I get, it looks very confusing and crowded.
You mean this part?
if [ ! -e "${prefix}/grub-btrfs.cfg" ]; then echo "" else submenu 'Arch Linux ARM snapshots' { configfile "${prefix}/grub-btrfs.cfg" } fi
This is the part grub integrates into its scripts. Those scripts work by generating output conditionally. Grub-mkconfig just calls the scripts in /etc/grub.d one by one and fetches whatever they output to stdout and puts it into /boot/grub/grub.cfg. Usually you don't see this because grub-mkconfig redirects stdout of those scripts. But you can see the "detecting snapshots" and "no snapshots found" part because is printed to stderr. Grub-mkconfig doesn't redirect that. Since we ran the script manually without grub-mkconfig we can see it's whole output.
You said that you are new to Linux, you maybe want to read about stdin, stderr and stdout. It's a very powerful and old concept of Unix and the way it can chain programs together.
You mean this part?
if [ ! -e "${prefix}/grub-btrfs.cfg" ]; then echo "" else submenu 'Arch Linux ARM snapshots' { configfile "${prefix}/grub-btrfs.cfg" } fi
This is the part grub integrates into its scripts. Those scripts work by generating output conditionally. Grub-mkconfig just calls the scripts in /etc/grub.d one by one and fetches whatever they output to stdout and puts it into /boot/grub/grub.cfg. Usually you don't see this because grub-mkconfig redirects stdout of those scripts. But you can see the "detecting snapshots" and "no snapshots found" part because is printed to stderr. Grub-mkconfig doesn't redirect that. Since we ran the script manually without grub-mkconfig we can see it's whole output.
You said that you are new to Linux, you maybe want to read about stdin, stderr and stdout. It's a very powerful and old concept of Unix and the way it can chain programs together.
Okay good to know, will read about those, as I'm finding Linux and Unix very interesting so far and I would love to get even deeper. Thanks!
As the title suggests, Grub-btrfs is not detecting my btrfs snapshots (using Timeshift), I configured the Grub-btrfs daemon to monitor the Timeshift snapshots using "--timeshift-auto" but without any results or detecting my snapshots, even though I'm sure I have snapshots. My version of Timeshift is 24.06.3 and Grub-btrfs is version 4.12. Im using vanilla Arch linux with KDE Plasma Wayland on a VM and my host computer is a MacBook Pro 14 inch 2021, meaning everything is aarch64 and my Arch linux is the ARM flavor This is the exact output I get from running "grub-mkconfig":
These are my grub configs:
These are my grub-btrfs configs:
These are my grub-btrfs daemon configs:
Feel free to ask me to add any needed info that I missed, I am really really new to Linux (literally started 2 weeks ago) and I try to add any relevant info that I know of.