-
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
Issue booting from snapshot - @log subvolume is read-only #331
Comments
Cannot confirm whether this worked in kernel 6.6, but my symptoms do seem to somewhat resemble those in #328 . Possibly related? |
Yes, i have the same issue, cannot boot in snapshot from grub by default if snapshot are taken with snapper. It's working if you are using timeshift, because snapshots are not r/o by default. But, i have lot of issues with timeshift for restoring, i do not use it anymore.. What i do each time i create a new snapshot, i set it to be writable:
|
Yep, I get it works fine with rw snapshots. The issue is that's quite a flaw, and something I'd like to avoid. A snapshot should be just that, frozen in time. If I boot into a snapshot, accidentally change some files or some sort of application does, if the snapshot is rw then that snapshot is now tainted with no way of reversing it. Unless there's some mkinitcpio hook for taking a rw snapshot of the ro snapshot at boot time, booting into that, then discarding the rw on shutdown? I was hoping overlayfs would accomplish this, but it doesn't seem to play nice with those other subvolumes... :/ |
I have tried to put @Antynea Could you please help us to find out a workaround ? Thank you |
What are the mount options in fstab for the @log subvolume? If I add rw to the options I have no issues. |
fstab options are listed in the OP |
I don't have this issue on Arch SDDM-Plasma. I did have the problem with @home being ro until I changed fstab options to rw. Have you rebooted and re-snapshotted after adding rw to @log? Try booting a new snapshot maybe. |
Yep. Tried that. Added |
what is your subvolume layout ? I also read that putting |
I have @cache mounted to /var/cache and @log mounted to /var/log. Same as you it seems. What is your DM-DE? I can boot a snapshot without overlayfs with SDDM-Plasma |
You do not have the I will try without the overlayfs and put |
I have a systemd based init with an sd-overlayfs right now, but without it a snapshot always booted without issues. |
I see, but, maybe we are confusing. I mean, i am using snapper to take snapshots. Snapper takes r/o snapshots. That's why when booting from a snapshot i have to put it r/w, with or without If i was using TimeShift, for instance, i wouldn't have those issue. i do not know your overlay, where did you get it ? 👍 |
My overlay is from a post in one of the issues here. I am using snapper and do not have to set snapshots to rw regardless of using overlayfs or not. I can use a udev init with grub-btrfs-overlayfs without issues also, so overlayfs is not the problem. What do you get when booted into a snapshot with this command? |
I am progressing. I put rw in /etc/default/grub command line. rw in fstab does not change anything more (or less).
And i do not know really where i am once booted because So until now, the key point was to put rw in /etc/default/grub, at least i can boot |
The rw kernel parameter is not needed as / should get remounted rw during init. You error seems to be pointing to the remount not being sucessful. What is your /etc/default/grub |
Indeed, i have this in my
This is like that in my distro by default Manjaro. |
I am trying to wrap my head around / being ID 5 and not subvol /endeavour/@. This is not what I am used to. Maybe you need it for dual boot. Also tmpfs in fstab on Endeavour just seems wrong to me. Tmp is not your issue, but I am not sure about the default subvol. I always see that you should set it to the proper root subvol even after a restore. Again I am not sure if this is needed or even correct for dual boot scenarios. The following from Timeshift readme to set default subvol. Make sure, that you have selected subvolume @ or /@ for root. You can check that executing script below, and if output is OK, then everything is alright.
Default BTRFS subvolume must be /. You can make it using script below.
|
I get it, but, look my fstab : /dev/mapper/luks-d916a464-4abf-46bd-b36a-e81a6381e0fc / btrfs subvol=/@,defaults,compress=zstd:1 0 0 Arch wiki says :
I do not have rootflags in kernel parameter but my fstab seems to be correct. That is my, i think, the right subvolume is mouted at boot eventhough But that's right, when using the overlayfs, it seems that it's not mounted correctly, in this case i tend to think that this is subvolid 5 which is mounted. Your first script gives me OK. |
I have subvol=@ in my rootflags, rw also. Get default returns |
This is interesting because, look, in my current subvolume But, if i look inside I will try setting de default subvolume. If i do
So, i should set it to 312, right ? |
I think you're getting confused a little. It's me that's running |
Oh, yes, that is right, my fstab
|
Ahhhhh, I got lost. Sorry to hijack CPU-Blanc. We can take this private if you want. |
For me, the issue is present in both EndeavourOS and Arch as I'm multibooting from the same btrfs partition.
Both in |
Nono it's fine. I have a hunch this is connected somehow so pooling ideas here is a good idea |
In fact, i would say this is normal because, after all, snapper take r/o snapshot. |
|
What's your kernel parameters ? I think as you when i read the Arch wiki: The default sub-volume is mounted if no subvol= mount option is provided. So, in theory, when you have |
I have default set to @. This is also what the https://aur.archlinux.org/packages/snapper-rollback/ package does after a rollback. |
I see, in fact, i did not change the default subvolume, i let it to be 5, because that is how my Manjaro installation is. |
You have to mount / to subvolid=5 in order to be in the btrfs root to change the default. |
There must be a reason behind snapper-rollback and Timeshift wanting the default set to the / subvolume. |
Do you mean The thing is snapper is fine with my setup. I can take snapshots, and restore them without any kind of issue what-so-ever. The only issue is when trying to boot into |
Yes the BTRFS root, the top of the btrfs ID 5. Snapper should be fine. Arch is not setup like Opensuse. Snapper rollback (the snapper command) should not be used because it does not mv/snapshot the subvolume, but sets it as default. |
I'm currently using btrfs-assistant to handle rollbacks, it handles them no problems. The only issue is booting via the grub menu |
i do the same with btrfs assistant |
i see, i do not have a separate boot partition. I only have a /boot folder in my / partition, encrypted. So when i do a snapshot, /boot folder is snapshotted, and restored if i restore a snapshot. |
I also use btrfs-assistant, but restore is not working with overlayfs, and running from a live iso. I have an issue on the Gitlab. Snapper-rollback on the otherhand will work everywhere, and is patched for a boot restore to keep /boot the same as the restored snapshot. I have a separate /boot partition because I cannot use grub to unlock my Luks2 Argon2 encrypted partition. I use systemd-boot which requires separate boot, and grub just to boot snapshots. The boot restore can be toggled on/off in the .config. |
This also has default set to @ If you are interested in my snapper-rollback-root package that includes the bootbackup.hook: |
I changed my default-subvolume to /@ Now, my issue is kind of solved because i can boot my r/o snapshots with overlayfs. I still have the remount errors at boot.
But then, once it had finished and i am within kde, it seems to be ok, even-though i do not do much tests.
--> If i do a snapshot restoration with Therefore, each time i do a restoration, i have to set the new default subvolume to |
I'd be inclined to agree, although a sort of stop-gap, it doesn't help myself or anyone else in my position; where I cannot set to default subvolume to the OS root as I multiboot on the same partition. Sounds like something in the chain is not respecting the kernel parameters and instead is using the default btrfs subvolume, which imo feels quite limiting. |
Using snapper-rollback will set the default for you. I am not a fan of btrfs-assistant for restores. I just don't trust it. |
What do you mean by that ? So in your setup, you have. /boot encrypted partition you have systemd-boot and grub, how to you manage both ? How does your machine start, i do not get it :) |
I boot using systemd-boot, but I can change the boot order in bios to boot from Grub when I need to boot a snapshot. My /boot is mounted to the fat32 unencrypted partition. Only way for systemd-boot to work. |
This is what I was saying earlier when I was talking about multi-boot. You will need a different default subvol every time you boot a different OS. The only reason I mentiond a default subvol is that was the only difference I have in my setup, and no /var/log issues. I know this doesn't make sense |
I have a hunch on where the issue might be occurring. Is it possible this is happening within the initramfs hook? |
I will look at the script to see if I can make heads or tails of it. |
I switched from Timeshift to Snapper/btrfs assitant because Timeshit was sometimes messy with restoration. You solution with systemd-boot and grub in UEFI sounds interesting, but i really do not trust my UEFI as sometimes it does not keep all entries in NVRAM, i do not why. For instance, if i boot on a usb key (like ventoy), and then i want to boot again the normal way it cannot find anymore my nvme boot entry and had to boot on live iso and set it with |
There is definitely an issue with the overlay |
That works for me. |
lol |
Vanilla Arch, SDDM/Plasma6 |
Yes, but by the way, is it the latest overlayfs version ? Or you said it was sd-overlay, maybe it's different. I know there was several overlay versions here. |
Works with both my sd-overlay and I tested it with grub-btrfs-overlayfs to be sure. Looking at the current overlay it makes sure there is a ro root ([[ |
The other thing is that I do not need overlayfs for a snapshot to boot without errors on SDDM/Plasma. |
My Arch install is running SDDM/Hyprland, and it cannot run from ro snapshots. |
This is the overlayfs hook if anyone wants to look into it. |
If you need OR One solution is Dracut with pure Systemd support and has no issue with overlayfs hook, but its setup must be done by hand. The overlayfs bug has been fixed in Kernel 6.10. If you need some Kernel versions with the overlayfs bug, look at a solution: https://gitlab.com/garuda-linux/pkgbuilds/-/commit/26d7f8496c242265b6902ee9188f134194cd0c0b |
Thanks for chipping in! Sadly I am already using a busybox based init and the does not work unless I manually set the snapshot as read-write. |
Hello!
I know this seems to be a semi-common problem, and I've followed the usual advice to fix it, but I'm still left scratching my head.
I've followed the readme and added the required hooks. The system does mount root as read-write, so the hooks are working. The issue is
/var/log
, which is a seperate subvolume on my system, is still being mounted read-only and is causing Xorg/Light Display Manager to freak.Any ideas on how to get overlyfs to work correctly with this subvolume, if that is indeed the problem?
I'm running EndeavourOS
My subvolume layout is:
Relevant fstab entries:
It would appear as though any subvolume that's on the same disk as
/
when booting into the snapshot are mountedro
, but root itself isrw
. Partitions/subvolumes from other drives are rw.ie
Booting into a read-write snapshot does not present this issue, it's only when attempting to boot into a read-only one. Any help troubleshooting would be greatly appreciated.
The text was updated successfully, but these errors were encountered: