You are not logged in.

#1 2024-11-24 01:05:17

AidanFisher
Member
Registered: 2024-11-24
Posts: 3

[SOLVED] BTRFS Sub-volume mounting

I've been using Arch intermittently for the past 5 years. Recently, I decided to return to Arch and performed a fresh installation using the btrfs file system, whereas I previously used ext4. Everything was working great until I decided to delve into the btrfs snapshot system, which, correct me if I'm wrong, would allow me to revert my system to a previous state if an update caused a malfunction or if I made a system breaking change.

I installed snapper and followed some guidance from the Snapper page on the wiki. Under "Create a new configuration" section I followed this

Note: If you are using the suggested Btrfs partition layout from archinstall then the @.snapshots subvolume will already be mounted to /.snapshots, and the snapper create-config command will fail [1]. To use the @.snapshots subvolume for Snapper backups, do the following:
- Unmount the @.snapshots subvolume and delete the existing mountpoint.
- Create the Snapper config.
- Delete the subvolume created by Snapper.
- Re-create the /.snapshots mount point and re-mount the @.snapshots subvolume.

Upon reaching the step to "re-mount the @.snapshots subvolume," I checked my fstab to make sure everything looked okay and found it completely empty. This led me down a rabbit hole of trying to understand how mounting btrfs subvolumes works with btrfs.

I guess I'm having a hard time understanding where my mountpoints are defined and how to define the /.snapshot to @.snapshot subvolume mount.

I apologize for any formatting issues in this post this is my first time in the years that I've used arch that I have posted on the forums.

Last edited by AidanFisher (2024-11-24 18:22:24)

Offline

#2 2024-11-24 01:28:03

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,327
Website

Re: [SOLVED] BTRFS Sub-volume mounting

AidanFisher wrote:

I checked my fstab to make sure everything looked okay and found it completely empty

That sounds unlikely, btrfs uses that file. Some configuration can be performed from the bootloader though.

Did you use archinstall? If so then please share the full log.

Please also share the full output of

findmnt
cat /proc/cmdline

Thanks.


Para todos todo, para nosotros nada

Offline

#3 2024-11-24 02:02:05

AidanFisher
Member
Registered: 2024-11-24
Posts: 3

Re: [SOLVED] BTRFS Sub-volume mounting

I did use archinstall but it seems that the logs arent there anymore.


Output of findmnt

➜  ~ findmnt
TARGET                                                        SOURCE             FSTYPE      OPTIONS
/                                                             /dev/nvme0n1p2[/@] btrfs       rw,relatime,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@
├─/proc                                                       proc               proc        rw,nosuid,nodev,noexec,relatime
│ └─/proc/sys/fs/binfmt_misc                                  systemd-1          autofs      rw,relatime,fd=38,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=5703
│   └─/proc/sys/fs/binfmt_misc                                binfmt_misc        binfmt_misc rw,nosuid,nodev,noexec,relatime
├─/sys                                                        sys                sysfs       rw,nosuid,nodev,noexec,relatime
│ ├─/sys/firmware/efi/efivars                                 efivarfs           efivarfs    rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/security                                      securityfs         securityfs  rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/cgroup                                            cgroup2            cgroup2     rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot
│ ├─/sys/fs/pstore                                            pstore             pstore      rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/bpf                                               bpf                bpf         rw,nosuid,nodev,noexec,relatime,mode=700
│ ├─/sys/kernel/debug                                         debugfs            debugfs     rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/tracing                                       tracefs            tracefs     rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/fuse/connections                                  fusectl            fusectl     rw,nosuid,nodev,noexec,relatime
│ └─/sys/kernel/config                                        configfs           configfs    rw,nosuid,nodev,noexec,relatime
├─/dev                                                        dev                devtmpfs    rw,nosuid,relatime,size=16203032k,nr_inodes=4050758,mode=755,inode64
│ ├─/dev/shm                                                  tmpfs              tmpfs       rw,nosuid,nodev,inode64
│ ├─/dev/pts                                                  devpts             devpts      rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/hugepages                                            hugetlbfs          hugetlbfs   rw,nosuid,nodev,relatime,pagesize=2M
│ └─/dev/mqueue                                               mqueue             mqueue      rw,nosuid,nodev,noexec,relatime
├─/run                                                        run                tmpfs       rw,nosuid,nodev,relatime,mode=755,inode64
│ ├─/run/credentials/systemd-udev-load-credentials.service    tmpfs              tmpfs       ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap
│ ├─/run/credentials/systemd-journald.service                 tmpfs              tmpfs       ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap
│ ├─/run/credentials/systemd-network-generator.service        tmpfs              tmpfs       ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap
│ ├─/run/credentials/systemd-tmpfiles-setup-dev-early.service tmpfs              tmpfs       ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap
│ ├─/run/credentials/systemd-sysusers.service                 tmpfs              tmpfs       ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap
│ ├─/run/credentials/systemd-tmpfiles-setup-dev.service       tmpfs              tmpfs       ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap
│ ├─/run/credentials/systemd-sysctl.service                   tmpfs              tmpfs       ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap
│ ├─/run/credentials/systemd-vconsole-setup.service           tmpfs              tmpfs       ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap
│ ├─/run/credentials/systemd-tmpfiles-setup.service           tmpfs              tmpfs       ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap
│ ├─/run/credentials/systemd-resolved.service                 tmpfs              tmpfs       ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap
│ ├─/run/credentials/systemd-networkd.service                 tmpfs              tmpfs       ro,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap
│ └─/run/user/1000                                            tmpfs              tmpfs       rw,nosuid,nodev,relatime,size=3243116k,nr_inodes=810779,mode=700,uid=1000,gid=1000,inode64
│   └─/run/user/1000/doc                                      portal             fuse.portal rw,nosuid,nodev,relatime,user_id=1000,group_id=1000
├─/boot                                                       systemd-1          autofs      rw,relatime,fd=52,pgrp=1,timeout=120,minproto=5,maxproto=5,direct,pipe_ino=14068
└─/tmp                                                        tmpfs              tmpfs       rw,nosuid,nodev,nr_inodes=1048576,inode64

output of cat /proc/cmdline

initrd=\initramfs-linux.img root=PARTUUID=534a705b-a892-4264-864e-09c37d2cd871 zswap.enabled=0 rootflags=subvol=@ rw rootfstype=btrfs

Offline

#4 2024-11-24 09:33:58

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,327
Website

Re: [SOLVED] BTRFS Sub-volume mounting

The only subvolume mounted is the main root subvolume (@), there are no snapshot subvolumes mounted.

Try mounting the main partition to find other subvolumes, like this:

mount /dev/nvme0n1p2 /mnt
btrfs subvolume list /mnt
umount /mnt

Share the output of the middle command here, thanks.


Para todos todo, para nosotros nada

Offline

#5 2024-11-24 14:55:11

AidanFisher
Member
Registered: 2024-11-24
Posts: 3

Re: [SOLVED] BTRFS Sub-volume mounting

Since it was a brand-new installation, I opted for a fresh install last night. It appears something went wrong during my initial installation because now all my subvolumes are defined in my fstab on this new setup. Interestingly, last night, when the Arch installation attempted to configure PipeWire, an error occurred, halting the archinstall script. After retrying the installation without a sound server, it completed successfully.

This may have had something to do with me not having the sof-firmware package installed.

I believe what happened is that last week, when I performed this installation, I didn't notice it had errored out, in the past I generally didn't use the archinstall script in the past, and simply rebooted the computer. I recall that when I logged into the tty, there was no home directory defined for my user account and a few other things werent set up. I manually fixed those issues and proceeded with installing my desktop environment and other components.

This new installation with the archinstall script worked well and I just installed and configured PipeWire after the fact.

Offline

Board footer

Powered by FluxBB