-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grub-btrfs.path is started but does not generate grub-btrfs.cfg #138
Comments
Hello,
|
Okay,
|
Thanks for your reply, i was out today, i could not reply to you before. By the way, could you please tell me how (and where) you discovered there is no /run/timeshift/backup/timeshift-btrfs/snapshots at boot time ? Because when i do systemctl show grub-btrfs.path, i get : Unit=grub-btrfs.service So, it seems to be ok :( Thanks again |
I installed "manjaro" in a virtual machine with a btrfs filesystem.
Run the timeshift application, and now, So I deduce that the mounting point doesn't exist at startup. |
Oh, i got it. I have a Manjaro with @ subvol, my home is in another partition in xfs, it's a minimal Manjaro with xfce. At boot time, i get :
And yes, after creating a snapshot within Timeshift, i get
If it can help, below is my fstab entry corresponding to this partition, i did not modify it, it's like that by default:
m2c |
While waiting to find an elegant solution,
Edit: no, sorry don't do that, this doesn't work properly |
Yeah :) |
Sorry about that, I realized that some steps were missing in my message. |
No worries, it was funny....i was like: WTF@!??? Anyway, i made the correction now in emergency mode in fstab |
So,
by
don't run service at this stage. Create a /.snapshots folder. (if you have delete it previously) Now, let's try to make it work.
if no error has occurred at this stage, then take a snapshot with timeshift |
This is working But also, as i said in my first message, a simple restart of grub-btrfs.path service at boot time, before to run Timeshift application, makes it work too (with PathModified=/run/timeshift/backup/timeshift-btrfs/snapshots) |
it's time to cook dinner, I'll be back later.
it's very strange |
i performed the same test. i don't have the same result. |
I made some additional tests.
I precise that i do not have timeshift-autosnap installed |
That's what I get. Systemd.path uses inotify, and therefore the limitations that go with it... If you absolutely want the monitoring to work, you have to mount the timeshift folder that includes the snapshots yourself at boot time. if you aren't interested in this feature, I can offer you an alternative solution, which consists in executing the grub update during a shutdown or a reboot of your system.
|
Thanks a lot for both solutions, i will pick one of them. But, do you think, this happens with every distro or only with Manjaro ? Thanks |
This is part of the design of the timeshift application, so it should be reproducible on another distribution.
I don't use any of these applications. Understand that using snapshots, requires you to explicitly mount your either root filesystem ( I use a manual method to create snapshots (without third-party tools), i like that my device containing snapshots is mounted on system startup in a permanent folder. |
Thanks for your help. |
okay |
How do you mount your snapshots at startup ? In addition, in /run/timeshift/backup, i have a '@' folder, i guess it's related to timeshift, but i really do not know what is it. What we need to know is, once snapshot are properly mounted at startup, if grub-btrfs.path is working. Because if i start my computer, then i run timeshift (only to mount the snapshots), i still have to restart grub-btrfs.path with systemctl to make it working. |
Short answer : Long answer : ( hope this will be understandable )
At the root of my filesystem, Your setup is somewhat different.
Remember this message You can replace The following was written using the information you provided here
Yes, you have to restart the service, because timeshift creates the mount point, only when launching its applicationn not at boot time. |
I deduced that the grub-btrfs.path service was disabled. |
I think i get it working. Just to be sure of what we are doing here: By modifying the fstab with: --> We are mounting the root filesystem What is confusing for me is the subvolid=5. I mean, when i installed Manjaro, in my vanilla fstab i have this line I thought this subvolume was the root one, but it does not have ID=5, it has ID=274:
Do you know what's happening here exactly ? I did not find any accurate information on the internet. Anyway, grub-btrfs.path is working now, it's enabled, activated and the grub file is regenerated when i create a snapshot |
actually from the official BTRFS wiki, it's written that the toplevel subvolid is 5. The quote :
Read the documentation quietly, a lot of answers can be found there. |
Now that you have the root of your filesystem mounted at boot time, it is very easy to get As I mentioned in a previous post, the snapshots created with So for this to work, you need to tell
|
Yes, you are right now what to do with Timeshift. Thanks again for all ! |
I think you are confusing the Btrfs root and the "root subvolume" ( The actual Btrfs root has It's not easy to wrap the head around that, but in a nutshell there are
|
That's exactly what i had difficulties with. That is not logical at first, for me at least :) |
Okay, I think I have found an acceptable solution.
I used the timeshift mount point in my example. Some explanations:
To be able to modify the default unit provided by
Now enable and start I will create a pull request later. Edit: to know |
@Antynea, do we need both
|
@keyb0ardninja
It seems that the |
I'm hoping @Antynea hasn't abandonned this very useful program and that they're otherwise OK? After reading this thread and a few others, it seems that grub-btrfs.path is no longer a viable option and so the only workable option is to have GRUB be updated on every reboot. The README needs to be updated to reflect this state of affairs. I tried @Antynea's one-shot service and it didn't work for me. I had to simplify it down to this to get a working grub update on reboot:
I'd be interested to hear from anyone who has got grub-btrfs.path working with a recent version of timeshift, if it is still possible to use that kind of on demand method still. |
Well it’s not the only viable option, you can still do this https://www.lorenzobettini.it/2022/07/timeshift-and-grub-btrfs-in-linux-arch/ |
Mr Bettini manually runs grub update in that guide, which is what I'm going to do after creating any snapshots because I don't like updating grub on every reboot. Feels wrong to me. |
Maybe I don’t understand his blog post that well, I’m tired, but he doesn’t change the grub-btrfs.service file, only the grub-btrfs.path, does he? the .path is the one that watches the mount point, the .service is the one that actually does fire up the update of the snapshots.
So as Long as that’s still there it shouldn’t update the whole grub every time |
I have followed his instructions exactly as written except for installing timshift-autosnap but they do not work for me, I still have to manually run a grub update for my snapshots to get listed. Debian doesn't package timeshift-autosnap so maybe his guide depends on that being installed too? I am running Debian testing with subvols for / (@) and /home (@home). As for:
Why are the three variables in that command suffixed with |
That is just a fallback in case the variable does not exist. |
Thanks for your help. I don't suppose you have write access to the grub-btrfs repo do you? Is this a dead project now, at least is this repo effectively dead now? It would be good to see the README get updated to give some better guidance around auto updating GRUB on modern distros. |
I have got it working now - systemd now auto updates GRUB when I create or delete timeshift snapshots so I have created a guide to getting this configured correctly. Configuring systemd to update grub after modifying timeshift snapshotsNeither timeshift nor grub-btrfs will update your grub menu after you create or delete any snapshots so we have to manually configure systemd to do this for us, if we want the ability to boot directly into snapshots from GRUB. First, we must check the base path used to store your timeshift snapshots. Create at least one snapshot with timeshift and then run
We can see here that the path of the snapshot is systemd has a function called PathModified that we'll use to monitor
You must replace
To check systemd has registered the new mount point. Create
Create
Now by enabling / starting
|
Hello,
I have a strange behavior with grub-btrfs.path service.
Right after starting my computer, i do :
systemctl status grub-btrfs.path ....it tells me that the service is enabled and active, everything is ok.
But when i create a snapshot within Timeshift, grub-btrfs.cfg is not regenerated.
Then, i do : systemctl start grub-btrfs.path, just to make sure.....nothing happens either when i create a snapshot in Timeshit.
To make it works i have to do "restart (or stop/start) on grub-btrfs.path service, and then, everything is ok, once i create a snapshot, grub-btrfs.cfg is regenerated.
I really don't know what happens, i uninstalled and reinstalled grub-btrfs several times.
I see absolutely nothing wrong in journalctl (journalctl -u grub-btrfs.path or grub-btrfs.
I have the latest Manjaro, with everything up to date.
My snapshots path has been modified as you advised us, with systemctl edit .....
I did no modification within /etc/default/grub/grub-btrfs/config.
Could you help me please?
Thanks a lot
The text was updated successfully, but these errors were encountered: