You are not logged in.

#1 2024-08-28 11:57:40

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 179
Website

[SOLVED] Fail to add a new BTRFS subvolume

Here is part of my setup. I have one SSD with BTRFS on it

$ cat /etc/fstab
-------
/dev/nvme0n1p2 LABEL=Magnolia
UUID=6ca0f63e-7327-444e-af89-ac82d08fda59	/         	btrfs     	rw,noatime,ssd,discard,space_cache=v2,subvol=/@	0 0
....
/dev/nvme0n1p2 LABEL=Magnolia
UUID=6ca0f63e-7327-444e-af89-ac82d08fda59	/var/cache/pacman/pkg	btrfs     	rw,noatime,ssd,discard,space_cache=v2,subvol=/@pkg	0 0
......

# btrfs subvolume list -p /
ID 256 gen 45720 parent 5 top level 5 path @
ID 257 gen 45721 parent 5 top level 5 path @home
ID 258 gen 45720 parent 5 top level 5 path @tmp
ID 259 gen 45721 parent 5 top level 5 path @log
ID 260 gen 39565 parent 5 top level 5 path @pkg
ID 261 gen 45706 parent 5 top level 5 path @docker
ID 263 gen 15 parent 5 top level 5 path .@snapshots
ID 264 gen 20 parent 256 top level 256 path var/lib/portables
ID 265 gen 20 parent 256 top level 256 path var/lib/machines
ID 269 gen 45716 parent 256 top level 256 path @development

Now I want to add a new subvolume, mounted on /development. Below is what I did:

# btrfs subvolume create /@development 
# mkdir /development
# mount -t btrfs -o subvol=/@development,defaults,user /dev/nvme0n1p2 /development
mount: /development: fsconfig system call failed: No such file or directory.
       dmesg(1) may have more information after failed mount system call.

What do I do wrong?

Last edited by gabx (2024-08-28 17:40:23)

Offline

#2 2024-08-28 16:01:26

cloverskull
Member
Registered: 2018-09-30
Posts: 206

Re: [SOLVED] Fail to add a new BTRFS subvolume

I'm no expert but need to do this myself at some point in the near future. It's not 100% clear to me how to create new subvols in an existing, running system (i.e., not in a chroot). I look forward to folks chiming in here with some solutions.

Offline

#3 2024-08-28 16:19:46

ua4000
Member
Registered: 2015-10-14
Posts: 486

Re: [SOLVED] Fail to add a new BTRFS subvolume

In your running system subvol=/@    is mounted to /,
so you are ***not*** in the top level when running
btrfs subvolume create /@development 

Result: /@development  is a sub under  /@

Solution:
mount / to /mnt wihout a subvol, then create /mnt/@development in there,
and unmount /mnt

Last edited by ua4000 (2024-08-28 16:20:35)

Offline

#4 2024-08-28 17:40:04

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 179
Website

Re: [SOLVED] Fail to add a new BTRFS subvolume

ua4000 wrote:

In your running system subvol=/@    is mounted to /,
so you are ***not*** in the top level when running
btrfs subvolume create /@development 

Result: /@development  is a sub under  /@

Solution:
mount / to /mnt wihout a subvol, then create /mnt/@development in there,
and unmount /mnt

That's exactly what I did: mounting the partition without any specific subvolume, then create the subvolume.

Offline

#5 2024-08-28 18:39:34

ua4000
Member
Registered: 2015-10-14
Posts: 486

Re: [SOLVED] Fail to add a new BTRFS subvolume

This you didn't tell :-(

Then this is what happened:
# mkdir /development

has created the folder on BTRFS ***top*** level - not in reach of your running system when you mount your / from /@

You have to create the folder like this:
# mkdir /mnt/@/development
or relative from within your running system in /@.
# mkdir /development

Offline

Board footer

Powered by FluxBB