Hello,
I’ve read through a bunch of threads here and on other forums + the BTRFS manual but I still need assistance.
I want to create new subvolumes and mount existing folders to them (such as /run, /tmp & my own /scripts), but I can’t quite grasp how to do that.
Here is the current subvolume setup from installing Manjaro:
ID 256 gen 1718 top level 5 path @
ID 257 gen 1768 top level 5 path @home
ID 258 gen 1408 top level 5 path @cache
ID 259 gen 1768 top level 5 path @log
Here is my fstab:
UUID=0094-6C92 /boot/efi vfat umask=0077 0 2
UUID=a651d5d2-ac20-40ae-a8ba-1b25be4e117d / btrfs subvol=/@,defaults,space_cache=v2,compress=zstd:3,discard=async,ssd 0 0
UUID=a651d5d2-ac20-40ae-a8ba-1b25be4e117d /home btrfs subvol=/@home,defaults,space_cache=v2,compress=zstd:3,discard=async,ssd 0 0
UUID=a651d5d2-ac20-40ae-a8ba-1b25be4e117d /var/cache btrfs subvol=/@cache,defaults,space_cache=v2,compress=zstd:3,discard=async,ssd 0 0
UUID=a651d5d2-ac20-40ae-a8ba-1b25be4e117d /var/log btrfs subvol=/@log,defaults,space_cache=v2,compress=zstd:3,discard=async,ssd 0 0
UUID=9579c81f-26f1-4874-b611-675b878f2633 swap swap defaults,noatime 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
If I go to / and create a new sub-volume via “btrfs subvolume create scripts”(for example), it creates a new sub-volume and also adds a directory with the same name (scripts). If I create a sub-volume with the name [at]scripts…it’ll also add a directory with the name [at]scripts. Yet, I can’t find a folder called [at]home, [at]cache, or [at]log and I’m not able to figure out why that is (I get that they’re mounted at real directories per fstab layout though). I think they’re sub-volumes under the [at] sub-volume, so how do I create a new sub-volume that falls under [at]?
Additionally, if I want to mount a directory to a subvolume, do I need to copy the contents over from the original folder to the sub-volume created directory (via cp --ref-link=always) and then rename it to the same?