Announcement

Collapse
No announcement yet.

snapper says ".snapshots is not a btrfs subvolume" when it is

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] snapper says ".snapshots is not a btrfs subvolume" when it is

    Snapper, for a subvolume it works with, puts snapshots in another subvolume called ".snapshots" in the parent subvolume. If one then operates with the snapshots, like copying them about, or reverting to an older snapshot, snapper stops, because .snapshots gets left behind.

    After this causing trouble I adopted the method given in the arch wiki for snapper, in which one mounts a snapshot volume that is elsewhere, typically in the btrfs root, on .snapshots. For example, one might have @ and @snapshots at the top level, and in /etc/fstab @snapshots is mounted on @/.snapshots. This has worked well for me on the linux root subvolume on occasion.

    But, I couldn't get it to work for @home or other subvolumes. Any operation, such as snapper -c home list failed with
    Code:
    IO Error (.snapshots is not a btrfs subvolume).
    When I first tried that, I gave up and just let snapper have its .snapshots in @home. But, today after checking things after major subvolume manipulations (a long story), I found snapper not working because .snapshots had wandered off, so I tried again, and got the ".snapshots is not a btrfs subvolume" error again.

    But it is you *&%^*&%!.

    For example, @homesnapshots would be mounted on @home/.snapshots, so @home/.snapshots is indeed a subvolume. /var/log/snapper is uninformative.

    In preparing a rant for this post, I read again the arch wiki, and found a detail that I'd forgotten: "Give the folder 750 permissions."

    With that, it works; the error is misleading.
    Regards, John Little

    #2
    I find that snapper is very confusing if your use it with the CLI. From setup to daily use it confuses me. I think this is because Opensuse where it was developed uses a different philosophy on how the subvolumes are setup than Ubuntu or Arch. The only way it works for me is to do all my configuration and setup of snapper by running "btrfs-assistant". https://gitlab.com/btrfs-assistant/btrfs-assistant

    I'm currently testing a system with Endeavour OS (arch) with btrfs and have installed snapper, btrfs-assistant, snap-pac, grub-btrfs and btrfsmaintenance. I don't run any snapper config stuff. I use btrfs-assistant for that. In fact on anything but Opensuse, snapper rollback doesn't work correctly but sort of works which leaves your subvolumes in a mess. My setup has support for booting read-only snapshots using an overlayfs. You can boot a non-working system to an earlier snapshot and then from there run btrfs-assistant to do the permanent restore of that snapshot if you like it. When I do this I restore @ and @home to whatever snapshot I want and reboot. I was told by the developer that btrfs-assistant uses mv and not rollback and works on nested subvolumes. EndeavourOS recently solved the booting read-only snapshots in dracut that they use now instead of mkinitcpio.

    I have done some testing of btrfs-assistant on Kubuntu 23.04, but find the ubuntu version of snapper includes the functionality of triggering pre/post snapshots with each APT run. However they don't put in descriptions so you have to with snapper-gui or CLI commands. I usually forget to do that. Plus Ubuntu is not easy to setup booting read-only snapshots.
    Last edited by jfabernathy; May 25, 2023, 03:29 PM.

    Comment


      #3
      Thank you for your comments, you've given me several things to think about.
      Originally posted by jfabernathy View Post
      ... use it with the CLI...
      I hardly ever use the snapper CLI, but it's handy in a forum post. I just let it do its thing, the automatic snapshotting and integration with booting and APT. Occasionally I'll look at the snapper gui. My main use of the snapper snapshots is with ordinary tools, dolphin and find particularly.
      btrfs-assistant, snap-pac, grub-btrfs and btrfsmaintenance.
      I must check them out.
      ... snapper rollback doesn't work correctly but sort of works which leaves your subvolumes in a mess.
      The idea of doing rollbacks and the like on a system I care about without knowing exactly what's happening makes me shudder; I want to do that stuff myself, in the rare occasions I need to.
      My setup has support for booting read-only snapshots using an overlayfs.
      Fantastic. I recently had an important use for that, to find which version of something broke something.
      When I do this I restore @ and @home to whatever snapshot I want...
      I keep @ and @home free for new *buntu installs. Symlinks work for the subvolume names in grub and booting, so I've got grub entries booting to symlinks, and the first thing I do, even before booting the new install, is adjust the fstab to use symlinks. It's good to have more descriptive names for the installs, f.ex. "@lunar_root", "@230404_home". It can be system-destroying to get the subvolume name wrong, especially with btrfs sub delete.
      ... the ubuntu version of snapper includes the functionality of triggering pre/post snapshots with each APT run...
      That's been happening since my first use of snapper six or seven years ago. I seem to remember there were separate packages for this at first.

      I tend to get some new software and wrench it till it does what I need, then leave it for years working away, often till I've forgotten all about it. Ideally, I made notes at the time.
      Regards, John Little

      Comment


        #4
        btrfs-assistant seemed like it was worth a try so I built and installed it this morning. I was rather surprised to see this message:

        Click image for larger version

Name:	Screenshot_20230530_110913.jpg
Views:	527
Size:	12.8 KB
ID:	671137

        LOL, they pegged me...

        Please Read Me

        Comment


          #5
          Originally posted by jlittle View Post
          My main use of the snapper snapshots is with ordinary tool.
          Yesterday I did an 8-version gvimdiff, the last 8 versions of a file found in snapper snapshots, side-by-side with differences highlighted. An ordinary tool?

          Regards, John Little

          Comment

          Working...
          X