You are not logged in.

#1 2022-05-10 08:35:49

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

[SOLED]/var mounted from another device and as a btrfs subvolume

My system is on a 100G SSD. To keep as much space as possible, I mount my /var/ partition on another device, a HDD.
I am doing a new install and will use the btrfs filesystem for the snapshot/backup facility. One of the subvolume I want is @var. I have been searching for a while how to deal with the fact it is mounted from another device and after many tests the best solution I found is the following one.

  1. I create a /@ subvolume on my SSD partition

  2. I create a /var subvolume on my HDD partition

  3. In /etc/fstab I mount the /@ subvolume on my root partition, / the classic way

  4. I mount the /var subvolume on my var partition, /var, and use the x-systemd.requires-mounts-for argument to make sure the var partition will be mounted after the root

Is it the correct way to have my var partition as a btrfs subvolume and on another device than the one with my root filesystem? Or will this method be quickly borken?
Thank you for help.

Last edited by gabx (2022-05-17 15:12:42)

Offline

#2 2022-05-11 11:29:33

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

Re: [SOLED]/var mounted from another device and as a btrfs subvolume

I made the install with the simplest way (usually it is the best road). Here is the line from /etc/fstab:

LABEL=var           	/var      	btrfs     	rw,noatime,compress=lzo,ssd,space_cache=v2,subvolid=256,subvol=/@var	0 0

The system works nice and filesystem looks OK. I just have a doubt when listing my BTRFS subvolumes:

[root@magnolia/]# btrfs sub list -p /
ID 297 gen 65496 parent 5 top level 5 path @home
ID 298 gen 65497 parent 5 top level 5 path @snapshots
ID 300 gen 65542 parent 5 top level 5 path @
[root@magnolia /]# btrfs sub list -p /var
ID 256 gen 85 parent 5 top level 5 path @var
ID 257 gen 55 parent 256 top level 256 path lib/portables
ID 258 gen 56 parent 256 top level 256 path lib/machines

As you can see, the /@var subvolume is not listed at the root of my filesystem but under /var.
Can this cause a problem when snapshoting/backing up?

Last edited by gabx (2022-05-11 11:29:51)

Offline

#3 2022-05-17 15:12:11

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

Re: [SOLED]/var mounted from another device and as a btrfs subvolume

I do think I have the answer.

[root@magnolia gabx]# btrfs sub snapshot /var /btrbk_pool/
Create a snapshot of '/var' in '/btrbk_pool//var'
ERROR: cannot snapshot '/var': Invalid cross-device link

This setup with another device as subvolume does not work

Last edited by gabx (2022-05-17 15:12:22)

Offline

Board footer

Powered by FluxBB