Silverblue+btrfs /home: btrfs subvolume vs link

Shalom,
I’ve installed silverblue on top of an older workstation installation by converting the workstation install’s /home to a btrfs subvolume, then in the silverblue installer, assigning that subvolume to /var/home without overwriting. This generally works well, but I have noticed occasional bugs, particularly with flatpak apps an nautilus:

  • drag and drop to home may not work unless i type /var/home/bennyp into the nautilus address bar
  • save dialog may not work unless I do the same.
# btrfs subvolume list /
ID 001 gen 1040431 top level 5 path home
ID 002 gen 1040431 top level 5 path root
# btrfs subvolume show /home
home
        Name:                   home
        UUID:                   xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2022-11-20 02:56:57 +0200
        Subvolume ID:           001
        Generation:             1040431
        Gen at creation:        9
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Send transid:           0
        Send time:              2022-11-20 02:56:57 +0200
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
        Quota group:            n/a
root@i /v/h/bennyp# btrfs subvolume show /var/home
home
        Name:                   home
        UUID:                   xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2022-11-20 02:56:57 +0200
        Subvolume ID:           001
        Generation:             1040431
        Gen at creation:        9
        Parent ID:              5
        Top level ID:           5
        Flags:                  -
        Send transid:           0
        Send time:              2022-11-20 02:56:57 +0200
        Receive transid:        0
        Receive time:           -
        Snapshot(s):
        Quota group:            n/a
# ls -lad /home
lrwxrwxrwx. 3 root root 8 Nov 25 08:18 /home -> var/home/

Is this arrangement correct? are the bugs I noticed caused by my filesystem setup, or unrelated?

1 Like

The issues described seems rather specific, yet possibly related to your setup. As opposed to a standard Silverblue installation, you’re missing the separate var subvolume.

So are you trying to drag a file to the left pane’s Home bookmark? What happens when you drop the file?

Does this issue happen only with home’s root directory (/var/home/bennyp) or when selecting subdirectories as well?

Ca you share the output of the following commands:

  • echo $HOME
  • echo $XDG_DATA_DIRS
  • cat /etc/fstab/
  • lsblk -f.

If you need redacting the UUIDs, please leave a part of it unredacted, if possible, to be able to connect the last two commands above.

2 Likes
~ 
❯ echo $HOME
/var/home/bennyp

~ 
❯ echo $XDG_DATA_DIRS
/var/home/bennyp/.local/share/flatpak/exports/share /var/lib/flatpak/exports/share /usr/local/share/ /usr/share/

~ 
❯ cat /etc/fstab

UUID=AAAAxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /                       btrfs   subvol=root,compress=zstd:1 0 0
UUID=BBBBxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /boot                   ext4    defaults        1 2
UUID=CCCC-xxxx                            /boot/efi               vfat    umask=0077,shortname=winnt 0 2
UUID=AAAAxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /var/home               btrfs   subvol=home     0 0

~ 
❯ lsblk -f
NAME   FSTYPE      FSVER LABEL  UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                 
├─sda1 vfat        FAT16 EFI    CCCC-CCCC                             162.7M    19% /boot/efi
├─sda2 ext4        1.0          BBBBxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  587.5M    33% /boot
└─sda3 btrfs             Fedora AAAAxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  525.9G    72% /var/home
                                                                                    /var
                                                                                    /sysroot/ostree/deploy/fedora/var
                                                                                    /usr
                                                                                    /etc
                                                                                    /
                                                                                    /sysroot
sdb                                                                                 
└─sdb1 crypto_LUKS 2            DDDDxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx                
zram0                                                                               [SWAP]

Looking at /etc/fstab, except for the missing /var mount point (in your case) obviously, my home subvolume is mounted like this:

UUID=54a4f206-27b4-4a1c-9dfd    /home   btrfs   subvol=home,compress=zstd:1 0 0

So basically the home subvolume is mounted under /home, and not /var/home. I suppose this shouldn’t be an issue, given that /home is a symlink to /var/home, but you could try experimenting with that.

In case you decide to alter /etc/fstab, I suggest pinning the current deployment first, then force deploying a new image (with an rpm-ostree upgrade or similar command), in order to preserve the current state of contents of /etc folder, and make the changes in the new deployment.

1 Like

I don’t know how ~/ works - is this being resolved by bash?

A symlink merely points to a path, like it’s not doing anything file system specific. I think this is resolved by VFS? And same for the bind mounts… All Btrfs mounts are bind mounts behind the scenes. That’s different from other file systems, but I’m pretty sure it’s identical behavior to using mount -B.

And Btrfs subvolumes have the same inode number, 256; but they have unique st_dev. While subvolumes aren’t literally fully separate file systems, each has its own file btree, and therefore its own inode pool.

But the part of the comment “may not work” makes me wonder if the problem is transient? That’ll make it fun to track down.