You are not logged in.

#1 2022-02-19 15:44:22

jfabernathy
Member
From: North Carolina
Registered: 2019-01-03
Posts: 123

new installation created unwanted subvolumes

I just did a new install using the Feb 2022 ISO.  I used BTRFS and created just 3 subvolumes: @, @home, and @snapshots.

I've installed snapper, snapper-gui, and grub-btrfs, but have not configured them.  I went to checkout the created subvolumes and found this:

 [jim@den-pc ~]$ sudo btrfs su list /
ID 256 gen 89 top level 5 path @
ID 257 gen 89 top level 5 path @home
ID 258 gen 10 top level 5 path @snapshots
ID 259 gen 16 top level 256 path var/lib/portables
ID 260 gen 17 top level 256 path var/lib/machines

Who created the var/lib/portables and var/lib/machines subvolumes. How can I get rid of them without messing up something??

Offline

#2 2022-02-19 15:50:19

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,445

Re: new installation created unwanted subvolumes

systemd does, via systemd-tmpfiles.

Online

#3 2022-02-19 15:54:20

jfabernathy
Member
From: North Carolina
Registered: 2019-01-03
Posts: 123

Re: new installation created unwanted subvolumes

Scimmia wrote:

systemd does, via systemd-tmpfiles.

Do you know the reason for their creation?  When I start doing snapshots with snapper I want all of root as a snapshot of @. I don't want do have to create a bunch of other snapper configurations to get all of the root directory.

Arch used to not do crap you don't want or need. I don't see anything in the wiki about the need for these subvolumes.

Offline

#4 2022-02-19 15:57:10

Alataw
Member
Registered: 2021-01-27
Posts: 20

Re: new installation created unwanted subvolumes

Offline

#5 2022-02-19 16:28:16

jfabernathy
Member
From: North Carolina
Registered: 2019-01-03
Posts: 123

Re: new installation created unwanted subvolumes

That article talks about someone using a copy.  My system is a brand new install of Arch with BTRFS on root. I can delete those directories but cannot delete those subvolumes.

It would be nice to know why they are there and if they are important.  In December and January the ISO didn't create those subvolumes.  So something has changes and not for the better. 

I hope this isn't a change in Archlinux philosophy. It use to be Ubuntu who did things they didn't explain and forced on you.

Offline

#6 2022-02-19 16:40:15

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: new installation created unwanted subvolumes

The last post in that thread says you can delete the subvolumes and create normal directories instead. You could also have figured that out by looking into the tmpfiles mechanism that Scimmia mentioned.

It has apparently been in systemd for years: https://github.com/systemd/systemd/blob … NEWS#L9169

Did you actually have a btrfs-based install before without these subvolumes (and without any manual intervention related to these paths)?

Last edited by Raynman (2022-02-19 16:40:59)

Offline

#7 2022-02-19 16:44:09

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

Re: new installation created unwanted subvolumes

/var/lib/machines is for systemd-nspawn & machinectl and /var/lib/portables is for systemd-portabled & portablectl.

See https://systemd.io/CONTAINER_INTERFACE/ & https://systemd.io/PORTABLE_SERVICES/ for more on this.

jbfabernathy wrote:

cannot delete those subvolumes

Yes you can:

# btrfs subvolume delete /var/lib/{machines,portables}

To prevent them being re-created at boot use

# touch /etc/tmpfiles.d/{portables,systemd-nspawn}.conf

Jin, Jîyan, Azadî

Offline

#8 2022-02-19 17:03:17

jfabernathy
Member
From: North Carolina
Registered: 2019-01-03
Posts: 123

Re: new installation created unwanted subvolumes

Head_on_a_Stick wrote:

/var/lib/machines is for systemd-nspawn & machinectl and /var/lib/portables is for systemd-portabled & portablectl.

See https://systemd.io/CONTAINER_INTERFACE/ & https://systemd.io/PORTABLE_SERVICES/ for more on this.

jbfabernathy wrote:

cannot delete those subvolumes

Yes you can:

# btrfs subvolume delete /var/lib/{machines,portables}

To prevent them being re-created at boot use

# touch /etc/tmpfiles.d/{portables,systemd-nspawn}.conf

Thanks, I now have the subvolumes deleted and they didn't get recreated on reboot:

ID 256 gen 267 top level 5 path @
ID 257 gen 267 top level 5 path @home
ID 258 gen 10 top level 5 path @snapshots

I'm not smart enough to understand the links you referenced.  Is there a more direct way to know if my removing those subvolumes will mess anything up? This is something completely new to using BTRFS for me. Wasn't an issue in January.

Offline

#9 2022-02-19 17:04:45

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

Re: new installation created unwanted subvolumes

Do you use systemd-nspawn or portablectl? If not then you won't miss those directories. It is actually possible to use system-nspawn without /var/lib/machines anyway.


Jin, Jîyan, Azadî

Offline

#10 2022-02-19 17:12:39

jfabernathy
Member
From: North Carolina
Registered: 2019-01-03
Posts: 123

Re: new installation created unwanted subvolumes

Head_on_a_Stick wrote:

Do you use systemd-nspawn or portablectl? If not then you won't miss those directories. It is actually possible to use system-nspawn without /var/lib/machines anyway.

I do not think I use systemd-nspawn since I do not know what it is.  The links you provided talk about containers and virtual machines. I do use Virtualbox and KVM/libvirtd, but I don't think that is what we are talking about here. Generally the only thing I think about with virtual machines is to make user that COW is turned off for the directory that holds the image of the virtual machines root drive.

Offline

#11 2022-02-20 14:12:23

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,392

Re: new installation created unwanted subvolumes

systemd-nspawn is often used to build packages in a clean chroot., https://wiki.archlinux.org/title/Develo … ean_chroot

I also think netctl uses it. so you may have been using nspawn without realising it.

Last edited by Lone_Wolf (2022-02-20 14:15:16)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#12 2022-02-20 14:42:42

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

Re: new installation created unwanted subvolumes

/var/lib/machines is only used by machinectl and even then it will look elsewhere if the directory does not exist.


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB