Snapper Exclusions in `/home` (btrfs)What do “snapper mount” and “snapper umount” do?BTRFS: Adding...

Designing a prison for a telekinetic race

Default camera device to show screen instead of physical camera

"Silverware", "Tableware", and "Dishes"

What is "super" in superphosphate?

How could China have extradited people for political reason under the extradition law it wanted to pass in Hong Kong?

Starships without computers?

Can my Boyfriend, who lives in the UK and has a Polish passport, visit me in the USA?

Levenshtein Neighbours

What are the ramifications of this change to upcasting spells?

How could Tony Stark wield the Infinity Nano Gauntlet - at all?

Stuffing in the middle

Do living authors still get paid royalties for their old work?

How to think about joining a company whose business I do not understand?

Land Registry Clause

What animal has fat with the highest energy density?

How to dismiss intrusive questions from a colleague with whom I don't work?

Is this kind of description not recommended?

Why is su world executable?

How can I get rid of this Lazy Spool, or otherwise improve this query's performance?

How can I train a replacement without letting my bosses and the replacement know?

Could sidesticks be linked?

E: Sub-process /usr/bin/dpkg returned an error code (1) - but how do I find the meaningful error messages in APT's output?

How do slats reduce stall speed?

Why doesn't the Falcon-9 first stage use three legs to land?



Snapper Exclusions in `/home` (btrfs)


What do “snapper mount” and “snapper umount” do?BTRFS: Adding new hard drive as /home after installationBTRFS Mount Trapped in Snapper RollbackSnapper has recently started performing duplicate snapshots each hourHow to add a btrfs raid 1 to an encrypted lvm2 volume group under Solus OS (Linux)?How to make snapper-boot.service create snapshots for all configs?How to sync after a 'snapper delete'Change where Snapper creates snapshots






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















Is there a standard approach, when using snapper on btrfs, to exclude directories under users' home folders? Say... ~/.cache/yay on Arch. Or possibly even ~/.cache as a whole.



Of course, I know the SOP is to create a subvolume any time you want a folder's contents excluded from a snapshot of a subvolume higher in the mounted folder hierarchy. But that means making a subvolume for each excluded folder under ~/ each time a user is added. Which is, in addition to getting messy to maintain, quite a few extra steps on top of normal user creation.



I suppose I could create wrapper scripts for useradd and userdel and toss them in /usr/local/sbin so they take priority. But I thought I'd see if there isn't a more elegant approach.



Context



It's not critical. The only system I currently have snapper deployed on is a home gateway and it's unlikely to ever have more than one non-root user. But it would be nice to know for the future.



subvolumes (excluding existing snapshots):



$ sudo btrfs subvolume list /
ID 258 gen 33625 top level 5 path home
ID 262 gen 33553 top level 5 path opt
ID 264 gen 33555 top level 5 path var-www
ID 266 gen 33630 top level 5 path arch
ID 267 gen 33631 top level 5 path var-log
ID 268 gen 33566 top level 5 path pacman-cache
ID 270 gen 45 top level 266 path var/lib/portables
ID 271 gen 46 top level 266 path var/lib/machines
ID 274 gen 33566 top level 266 path .snapshots
ID 276 gen 33556 top level 258 path home/.snapshots
ID 278 gen 33556 top level 262 path opt/.snapshots
ID 279 gen 33556 top level 264 path var-www/.snapshots


/etc/fstab:



# /dev/sda6 LABEL=system
UUID=18f47506-31c6-4d22-939d-684ace61301f / btrfs rw,noatime,compress=zstd:3,ssd,space_cache,subvolid=266,subvol=/arch,subvol=arch 0 0

# /dev/sda6 LABEL=system
UUID=18f47506-31c6-4d22-939d-684ace61301f /.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=274,subvol=/arch/.snapshots,subvol=arch/.snapshots 0 0

# /dev/sda1
UUID=27d5943f-e74d-480f-be46-a370c5b1f37f /boot ext4 rw,noatime,nodev,nosuid,noexec 0 2

# /dev/sda6 LABEL=system
UUID=18f47506-31c6-4d22-939d-684ace61301f /home btrfs rw,noatime,nodev,compress=zstd:3,ssd,space_cache,subvolid=258,subvol=/home,subvol=home 0 0

# /dev/sda6 LABEL=system
UUID=18f47506-31c6-4d22-939d-684ace61301f /home/.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=276,subvol=/home/.snapshots,subvol=home/.snapshots 0 0

# /dev/sda6 LABEL=system
UUID=18f47506-31c6-4d22-939d-684ace61301f /opt btrfs rw,noatime,nodev,nosuid,compress=zstd:3,ssd,space_cache,subvolid=262,subvol=/opt,subvol=opt 0 0

# /dev/sda6 LABEL=system
UUID=18f47506-31c6-4d22-939d-684ace61301f /opt/.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=278,subvol=/opt/.snapshots,subvol=opt/.snapshots 0 0

# /dev/sda6 LABEL=system
UUID=18f47506-31c6-4d22-939d-684ace61301f /var/log btrfs rw,noatime,nodev,nosuid,noexec,compress=zstd:3,ssd,space_cache,subvolid=267,subvol=/var-log,subvol=var-log 0 0

# /dev/sda6 LABEL=system
UUID=18f47506-31c6-4d22-939d-684ace61301f /var/www btrfs rw,noatime,nodev,nosuid,noexec,compress=zstd:3,ssd,space_cache,subvolid=264,subvol=/var-www,subvol=var-www 0 0

# /dev/sda6 LABEL=system
UUID=18f47506-31c6-4d22-939d-684ace61301f /var/www/.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=279,subvol=/var-www/.snapshots,subvol=var-www/.snapshots 0 0

# /dev/sda6 LABEL=system
UUID=18f47506-31c6-4d22-939d-684ace61301f /var/cache/pacman/pkg btrfs rw,noatime,nodev,nosuid,noexec,compress=zstd:3,ssd,space_cache,subvolid=268,subvol=/pacman-cache,subvol=pacman-cache 0 0

# /dev/sda5
UUID=5415bf33-0a89-4a36-a224-27dbb4c43977 none swap defaults 0 0









share|improve this question































    0















    Is there a standard approach, when using snapper on btrfs, to exclude directories under users' home folders? Say... ~/.cache/yay on Arch. Or possibly even ~/.cache as a whole.



    Of course, I know the SOP is to create a subvolume any time you want a folder's contents excluded from a snapshot of a subvolume higher in the mounted folder hierarchy. But that means making a subvolume for each excluded folder under ~/ each time a user is added. Which is, in addition to getting messy to maintain, quite a few extra steps on top of normal user creation.



    I suppose I could create wrapper scripts for useradd and userdel and toss them in /usr/local/sbin so they take priority. But I thought I'd see if there isn't a more elegant approach.



    Context



    It's not critical. The only system I currently have snapper deployed on is a home gateway and it's unlikely to ever have more than one non-root user. But it would be nice to know for the future.



    subvolumes (excluding existing snapshots):



    $ sudo btrfs subvolume list /
    ID 258 gen 33625 top level 5 path home
    ID 262 gen 33553 top level 5 path opt
    ID 264 gen 33555 top level 5 path var-www
    ID 266 gen 33630 top level 5 path arch
    ID 267 gen 33631 top level 5 path var-log
    ID 268 gen 33566 top level 5 path pacman-cache
    ID 270 gen 45 top level 266 path var/lib/portables
    ID 271 gen 46 top level 266 path var/lib/machines
    ID 274 gen 33566 top level 266 path .snapshots
    ID 276 gen 33556 top level 258 path home/.snapshots
    ID 278 gen 33556 top level 262 path opt/.snapshots
    ID 279 gen 33556 top level 264 path var-www/.snapshots


    /etc/fstab:



    # /dev/sda6 LABEL=system
    UUID=18f47506-31c6-4d22-939d-684ace61301f / btrfs rw,noatime,compress=zstd:3,ssd,space_cache,subvolid=266,subvol=/arch,subvol=arch 0 0

    # /dev/sda6 LABEL=system
    UUID=18f47506-31c6-4d22-939d-684ace61301f /.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=274,subvol=/arch/.snapshots,subvol=arch/.snapshots 0 0

    # /dev/sda1
    UUID=27d5943f-e74d-480f-be46-a370c5b1f37f /boot ext4 rw,noatime,nodev,nosuid,noexec 0 2

    # /dev/sda6 LABEL=system
    UUID=18f47506-31c6-4d22-939d-684ace61301f /home btrfs rw,noatime,nodev,compress=zstd:3,ssd,space_cache,subvolid=258,subvol=/home,subvol=home 0 0

    # /dev/sda6 LABEL=system
    UUID=18f47506-31c6-4d22-939d-684ace61301f /home/.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=276,subvol=/home/.snapshots,subvol=home/.snapshots 0 0

    # /dev/sda6 LABEL=system
    UUID=18f47506-31c6-4d22-939d-684ace61301f /opt btrfs rw,noatime,nodev,nosuid,compress=zstd:3,ssd,space_cache,subvolid=262,subvol=/opt,subvol=opt 0 0

    # /dev/sda6 LABEL=system
    UUID=18f47506-31c6-4d22-939d-684ace61301f /opt/.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=278,subvol=/opt/.snapshots,subvol=opt/.snapshots 0 0

    # /dev/sda6 LABEL=system
    UUID=18f47506-31c6-4d22-939d-684ace61301f /var/log btrfs rw,noatime,nodev,nosuid,noexec,compress=zstd:3,ssd,space_cache,subvolid=267,subvol=/var-log,subvol=var-log 0 0

    # /dev/sda6 LABEL=system
    UUID=18f47506-31c6-4d22-939d-684ace61301f /var/www btrfs rw,noatime,nodev,nosuid,noexec,compress=zstd:3,ssd,space_cache,subvolid=264,subvol=/var-www,subvol=var-www 0 0

    # /dev/sda6 LABEL=system
    UUID=18f47506-31c6-4d22-939d-684ace61301f /var/www/.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=279,subvol=/var-www/.snapshots,subvol=var-www/.snapshots 0 0

    # /dev/sda6 LABEL=system
    UUID=18f47506-31c6-4d22-939d-684ace61301f /var/cache/pacman/pkg btrfs rw,noatime,nodev,nosuid,noexec,compress=zstd:3,ssd,space_cache,subvolid=268,subvol=/pacman-cache,subvol=pacman-cache 0 0

    # /dev/sda5
    UUID=5415bf33-0a89-4a36-a224-27dbb4c43977 none swap defaults 0 0









    share|improve this question



























      0












      0








      0








      Is there a standard approach, when using snapper on btrfs, to exclude directories under users' home folders? Say... ~/.cache/yay on Arch. Or possibly even ~/.cache as a whole.



      Of course, I know the SOP is to create a subvolume any time you want a folder's contents excluded from a snapshot of a subvolume higher in the mounted folder hierarchy. But that means making a subvolume for each excluded folder under ~/ each time a user is added. Which is, in addition to getting messy to maintain, quite a few extra steps on top of normal user creation.



      I suppose I could create wrapper scripts for useradd and userdel and toss them in /usr/local/sbin so they take priority. But I thought I'd see if there isn't a more elegant approach.



      Context



      It's not critical. The only system I currently have snapper deployed on is a home gateway and it's unlikely to ever have more than one non-root user. But it would be nice to know for the future.



      subvolumes (excluding existing snapshots):



      $ sudo btrfs subvolume list /
      ID 258 gen 33625 top level 5 path home
      ID 262 gen 33553 top level 5 path opt
      ID 264 gen 33555 top level 5 path var-www
      ID 266 gen 33630 top level 5 path arch
      ID 267 gen 33631 top level 5 path var-log
      ID 268 gen 33566 top level 5 path pacman-cache
      ID 270 gen 45 top level 266 path var/lib/portables
      ID 271 gen 46 top level 266 path var/lib/machines
      ID 274 gen 33566 top level 266 path .snapshots
      ID 276 gen 33556 top level 258 path home/.snapshots
      ID 278 gen 33556 top level 262 path opt/.snapshots
      ID 279 gen 33556 top level 264 path var-www/.snapshots


      /etc/fstab:



      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f / btrfs rw,noatime,compress=zstd:3,ssd,space_cache,subvolid=266,subvol=/arch,subvol=arch 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=274,subvol=/arch/.snapshots,subvol=arch/.snapshots 0 0

      # /dev/sda1
      UUID=27d5943f-e74d-480f-be46-a370c5b1f37f /boot ext4 rw,noatime,nodev,nosuid,noexec 0 2

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /home btrfs rw,noatime,nodev,compress=zstd:3,ssd,space_cache,subvolid=258,subvol=/home,subvol=home 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /home/.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=276,subvol=/home/.snapshots,subvol=home/.snapshots 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /opt btrfs rw,noatime,nodev,nosuid,compress=zstd:3,ssd,space_cache,subvolid=262,subvol=/opt,subvol=opt 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /opt/.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=278,subvol=/opt/.snapshots,subvol=opt/.snapshots 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /var/log btrfs rw,noatime,nodev,nosuid,noexec,compress=zstd:3,ssd,space_cache,subvolid=267,subvol=/var-log,subvol=var-log 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /var/www btrfs rw,noatime,nodev,nosuid,noexec,compress=zstd:3,ssd,space_cache,subvolid=264,subvol=/var-www,subvol=var-www 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /var/www/.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=279,subvol=/var-www/.snapshots,subvol=var-www/.snapshots 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /var/cache/pacman/pkg btrfs rw,noatime,nodev,nosuid,noexec,compress=zstd:3,ssd,space_cache,subvolid=268,subvol=/pacman-cache,subvol=pacman-cache 0 0

      # /dev/sda5
      UUID=5415bf33-0a89-4a36-a224-27dbb4c43977 none swap defaults 0 0









      share|improve this question














      Is there a standard approach, when using snapper on btrfs, to exclude directories under users' home folders? Say... ~/.cache/yay on Arch. Or possibly even ~/.cache as a whole.



      Of course, I know the SOP is to create a subvolume any time you want a folder's contents excluded from a snapshot of a subvolume higher in the mounted folder hierarchy. But that means making a subvolume for each excluded folder under ~/ each time a user is added. Which is, in addition to getting messy to maintain, quite a few extra steps on top of normal user creation.



      I suppose I could create wrapper scripts for useradd and userdel and toss them in /usr/local/sbin so they take priority. But I thought I'd see if there isn't a more elegant approach.



      Context



      It's not critical. The only system I currently have snapper deployed on is a home gateway and it's unlikely to ever have more than one non-root user. But it would be nice to know for the future.



      subvolumes (excluding existing snapshots):



      $ sudo btrfs subvolume list /
      ID 258 gen 33625 top level 5 path home
      ID 262 gen 33553 top level 5 path opt
      ID 264 gen 33555 top level 5 path var-www
      ID 266 gen 33630 top level 5 path arch
      ID 267 gen 33631 top level 5 path var-log
      ID 268 gen 33566 top level 5 path pacman-cache
      ID 270 gen 45 top level 266 path var/lib/portables
      ID 271 gen 46 top level 266 path var/lib/machines
      ID 274 gen 33566 top level 266 path .snapshots
      ID 276 gen 33556 top level 258 path home/.snapshots
      ID 278 gen 33556 top level 262 path opt/.snapshots
      ID 279 gen 33556 top level 264 path var-www/.snapshots


      /etc/fstab:



      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f / btrfs rw,noatime,compress=zstd:3,ssd,space_cache,subvolid=266,subvol=/arch,subvol=arch 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=274,subvol=/arch/.snapshots,subvol=arch/.snapshots 0 0

      # /dev/sda1
      UUID=27d5943f-e74d-480f-be46-a370c5b1f37f /boot ext4 rw,noatime,nodev,nosuid,noexec 0 2

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /home btrfs rw,noatime,nodev,compress=zstd:3,ssd,space_cache,subvolid=258,subvol=/home,subvol=home 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /home/.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=276,subvol=/home/.snapshots,subvol=home/.snapshots 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /opt btrfs rw,noatime,nodev,nosuid,compress=zstd:3,ssd,space_cache,subvolid=262,subvol=/opt,subvol=opt 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /opt/.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=278,subvol=/opt/.snapshots,subvol=opt/.snapshots 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /var/log btrfs rw,noatime,nodev,nosuid,noexec,compress=zstd:3,ssd,space_cache,subvolid=267,subvol=/var-log,subvol=var-log 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /var/www btrfs rw,noatime,nodev,nosuid,noexec,compress=zstd:3,ssd,space_cache,subvolid=264,subvol=/var-www,subvol=var-www 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /var/www/.snapshots btrfs rw,nodev,noexec,noatime,compress=zstd:3,ssd,space_cache,subvolid=279,subvol=/var-www/.snapshots,subvol=var-www/.snapshots 0 0

      # /dev/sda6 LABEL=system
      UUID=18f47506-31c6-4d22-939d-684ace61301f /var/cache/pacman/pkg btrfs rw,noatime,nodev,nosuid,noexec,compress=zstd:3,ssd,space_cache,subvolid=268,subvol=/pacman-cache,subvol=pacman-cache 0 0

      # /dev/sda5
      UUID=5415bf33-0a89-4a36-a224-27dbb4c43977 none swap defaults 0 0






      btrfs home snapper






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 16 at 21:23









      Cliff ArmstrongCliff Armstrong

      2661 gold badge3 silver badges13 bronze badges




      2661 gold badge3 silver badges13 bronze badges

























          0






          active

          oldest

          votes














          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535952%2fsnapper-exclusions-in-home-btrfs%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535952%2fsnapper-exclusions-in-home-btrfs%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...