Cannot mount /.snapshots to @snapshots

I am trying to get my Snapper Snapshot layout as per Arch Wiki.
I have now deleted the original /.snapshots folder, created a new one, created a subvolume @snapshots but cannot mount /.snapshots.
The folder /.snapshots is there OK:

ls -la /
drwxr-xr-x   1 root root     0 Jan 22 16:14 .snapshots

btrfs subvolume list -p /
ID 256 gen 5827 parent 5 top level 5 path @
ID 257 gen 5828 parent 5 top level 5 path @home
ID 350 gen 5791 parent 256 top level 256 path @snapshots

Here is the relevant part of my /etc/fstab file:

UUID=e1bcbbad-77fb-495d-8a6b-1f496268f080 /              btrfs   subvol=@,defaults,noatime,space_cache,discard=async 0 0
UUID=e1bcbbad-77fb-495d-8a6b-1f496268f080 /home          btrfs   subvol=@home,defaults,noatime,space_cache,discard=async 0 0
UUID=e1bcbbad-77fb-495d-8a6b-1f496268f080 /.snapshots    btrfs   subvol=@snapshots,defaults,noatime,space_cache,discard=async 0 0

But when I do a mount -a command I get this:

mount: /.snapshots: mount(2) system call failed: No such file or directory.

Same with this:

mount -o subvol=@snapshots /dev/nvme0n1p4 /.snapshots

Help much appreciated.

Ok a setup of Snapper is sometimes tricky, even when you managed to delete his configuration.

  1. deinstall Snapper with pamac
  2. now delete all snapshots → sudo btrfs subvolume delete …
  3. delete subvolumes for .snapshots
  4. reinstall snapper
  5. create configurations for snapper
  6. snapper creates his own subvolumes for snapshots (and need to create is self) , but this configuration we dont want like snapper it does, thus
  7. delete subvol created by snapper for root
  8. create own subvol for root snapshots
  9. create .snapshots folder for mount points
  10. edit fstab to update these mountpoint
  11. edit snapper configurations

Attention! never…never delete Snapper’s configurations. Snapper holds on some places a hidden copy of these configurations and when you delete his /etc/snapper/configs he raises errors next time and you can’t backup these files anymore. I even had these problems, only reinstall had worked.

Now I show you my way (little bit different as in archlinux). I use snapshots for root → / and snapshots for /home. /root use only number cleanup, /home use timeline and number cleanup. I installed snap-pac and grub-btrfs to make snapshots of root and home before and after installing new packages (repository and AUR). With grub-btrfs these snapshots for root are automatically converted to GRUB2 menuentry’s to boot into these ro-Snapshots. Then i installed snap-sync to make daily backups of root and home to another BTRFS formatted backup SSD. This backup SSD contains a bootable small Manjaro Installation with GUI and all tools to recover my other Manjaro-Machines.
For booting a ro-Snapshot into GUI you have to do some more things, especially your BTRFS-Subvolume Layout.

  1. my BTRFS layout, all subvols named with @ at beginning
# sudo btrfs subvolume list /btrfs
ID 256 gen 34959 top level 5 path @
ID 669 gen 34965 top level 5 path @home
ID 259 gen 34964 top level 5 path @var
ID 327 gen 34411 top level 5 path @snapshots
ID 504 gen 34450 top level 327 path @snapshots/root
ID 505 gen 34943 top level 327 path @snapshots/home

I use subvol for root → / → @, home → /home → @home, /var → @var for the system. “root” and “home” are even the configuration names in snapper,snap-sync and so on.
Subvol @snapshots is a parent subvolume to hold all snapshots of root and home. Subvols @snapshots/root and @snapshots/home are subvolumes with parent @snapshots and take all snapper snapshots of root and home. That’s the difference to ArchLinux, i wanted a more cleaner layout of my subvols.
Subvolume @var mounted into /var is a special case. I mounted it with nodatacow option AND setup his folder attribute to +C. That means any folder or/and file stored in /var thus @var, are not compressed and have no copy-on-write feature set. Thus all cahces,log files an so on have no CoW and are fast accessed,writable. I take never snapshots of @var thus we can’t never boot into a ro-Snapshot of @var, and finaly any booted ro-Snapshot have rw-access of /var and can fully boot into DE (GUI).
But there is a small trap with /var. At /var/lib we have some library files that we want to include into root-Snapshots because there contains files associated to our other programs/libraries in /etc and so on. To get this managed I create a folder /usr/var/lib, copied all files from /var/lib into it, and use in FSTAB a bind-mount from /usr/var/lib to /var/lib. Thus all library configurations belongs now to @ and are snapshoted into snapshots of root.

Uff, seems realy complicated now, but it’s not realy :wink:
Before i go deeper with step by step instructions, i want to ask you what you want for information. A fast easier way to repair your snapper or my way of setup my systems.

Here my actual FSTAB.

# Swap
UUID=06686a06-c069-49f7-86e4-7a962740b364       none                    swap            rw,defaults                                                                     0 0
UUID=447C-E2BC                                  /boot/efi               vfat            rw,noatime,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8                0 2
# System
UUID=26c8751d-2747-4a4d-b857-32c82d67b20a       /btrfs                  btrfs           rw,noatime,compress-force=zstd:5,ssd,space_cache,subvolid=5                     0 0
UUID=26c8751d-2747-4a4d-b857-32c82d67b20a       /                       btrfs           rw,noatime,compress-force=zstd:5,ssd,space_cache,subvol=@                       0 0
UUID=26c8751d-2747-4a4d-b857-32c82d67b20a       /home                   btrfs           rw,noatime,compress-force=zstd:5,ssd,space_cache,subvol=@home                   0 0
UUID=26c8751d-2747-4a4d-b857-32c82d67b20a       /var                    btrfs           rw,noatime,nodatacow,ssd,space_cache,subvol=@var                                0 0
UUID=26c8751d-2747-4a4d-b857-32c82d67b20a       /.snapshots             btrfs           rw,noatime,compress-force=zstd:5,ssd,space_cache,subvol=@snapshots/root         0 0
UUID=26c8751d-2747-4a4d-b857-32c82d67b20a       /home/.snapshots        btrfs           rw,noatime,compress-force=zstd:5,ssd,space_cache,subvol=@snapshots/home         0 0
# var/lib mount into subvol=@
/usr/var/lib                                    /var/lib                none            defaults,bind                                                                   0 0
# Backup
UUID=becce8fa-cc96-466c-8e59-f2fcff75cc77       /media/Backups          btrfs           rw,nofail,noatime,compress-force=zstd:5,ssd,space_cache,subvol=@backups         0 0

My configuration of subvolumes @snapshots@snapshots/root + @snapshots/home mounted in /.snapshots and /home/.snapshots provide me follow possibilities.

  1. i have a more cleaner layout
  2. i dont mount @snapshots, only over mounted subvolid=5 → /btrfs i have access to all BTRFS subvolumes, thus @snapshots.
  3. now i can delete subvolumes @snapshots/home, @snapshots/root and @snapshots with btrfs su de … and thus have cleaned/deleted up all snapshots taken.
  4. on my backup SSD i use a @backup subvolume with subfolders named as every of my machines that use snap-sync and as subfolder the name of the snapper configurations, eg. root and home.
  5. all is consistent named, snapshots with snapper and backups with snap-sync

Ah, i forgot, when using snap-sync you take as example daily differential backups with BTRFS over ssh-tunnels. A daily snap-sync backup of root and home take about 5 seconds!

have you created a folder /.snapshots ?

sudo mkdir /.snapshots

ok i got you error. Look at your subvolume list above, created with btrfs su li /. You see @snapshots ID=350 with Parent=256. That means @snapshots is a embedded subvolume into your @ subvolume. Exactly that is what Snapper create at his own when you create with Snapper a new configuration for root.
I created a /btrfs forlder into / and mount it with

UUID=26c8751d-2747-4a4d-b857-32c82d67b20a       /btrfs                  btrfs           rw,noatime,compress-force=zstd:5,ssd,space_cache,subvolid=5                     0 0

Now i create a @test subvolume and a /.test folder like your @snapshots and /.snapshots created by Snapper. Now

// btrfs su li -p /
ID 256 gen 35184 parent 5 top level 5 path @
ID 259 gen 35184 parent 5 top level 5 path @var
ID 327 gen 34411 parent 5 top level 5 path @snapshots
ID 504 gen 34450 parent 327 top level 327 path @snapshots/root
ID 505 gen 35146 parent 327 top level 327 path @snapshots/home
ID 669 gen 35192 parent 5 top level 5 path @home
ID 1166 gen 35179 parent 256 top level 256 path @test

You see @test with parent 256 means @. And now

// btrfs su li -p /btrfs
ID 256 gen 35194 parent 5 top level 5 path @
ID 259 gen 35193 parent 5 top level 5 path @var
ID 327 gen 34411 parent 5 top level 5 path @snapshots
ID 504 gen 34450 parent 327 top level 327 path @snapshots/root
ID 505 gen 35146 parent 327 top level 327 path @snapshots/home
ID 669 gen 35194 parent 5 top level 5 path @home
ID 1166 gen 35179 parent 256 top level 256 path @/@test

and now look at the difference. Path of @test is now @/@test. Thus your mount should be

mount -o subvol=@/@snapshots  /dev/nvme0n1p4  /.snapshots

Thats why i create a folder /btrfs and mount SubVolID=5 into it. All my BTRFS command use now /btrfs instead of / or /home etc.pp.
Then i moved Snappers snapshots to a SubVol=@snapshots with childrens @snapshots/root and @snapshots/home to clean things up.

But these steps you must be make AFTER you have installed Snapper and created configurations for root and home. (you should even delete all .snapshots folder and subviolumes because Snapper will raise a error if not deleted). After Snapper creates his config you change his SubVolumes.

sudo su
mkdir /btrfs
mount -o subvolid=5  /dev/nvme0n1p4  /btrfs
btrfs su de @/@snapshots
btrfs su cr /btrfs/@snapshots  // create a subvol with parent=5, eg. Child of BTRFS filesystem root
mkdir /.snapshots
mount -o subvol=@snapshots  /dev/nvme0n1p4  /.snapshots
btrfs su li /btrfs
btrfs su li /

But if you want you can use @/@snapshots mounts, the difference are only “cosmetic” in real. My way, and ArchLinux try to cleanup things up to provide a better way for later BTRFS usage. As you see above the displayed results are confusing. With my eg. ArchLinux setup this can’t happend anymore.

That fixes it!
Thank you, @Hagen, for taking so much time to send the details of your setup, and explain my error. I am really very grateful.
I will have a serious look at your method next week when I can apply my brain to it!

@Hagen if you did have enough time to show me exactly how you do your setup, the idea of having other Manjaro backups on the one SSD would suit me very well I think.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.