Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

[SOLVED] btrfs subvolume created at each boot (tmpfiles.d)

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
sdauth
l33t
l33t
User avatar
Posts: 770
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

[SOLVED] btrfs subvolume created at each boot (tmpfiles.d)

  • Quote

Post by sdauth » Fri Mar 20, 2026 10:28 pm

Hello,
This is my btrfs root with a bunch of subvolume.

Code: Select all

ID 260 gen 194070 top level 5 path root
ID 261 gen 194070 top level 5 path home
ID 262 gen 194035 top level 5 path data
ID 263 gen 194034 top level 5 path swap
ID 265 gen 194054 top level 5 path snapshots
ID 472 gen 189965 top level 265 path snapshots/root.20260222T0631
ID 473 gen 189964 top level 265 path snapshots/home.20260222T0631

ID 480 gen 194058 top level 260 path root/srv
I never created root/srv subvolume (ID 480) but it is auto created (!) at every boot of my machine,
I removed it and it is created again automatically, what is going on ?
It started right after the upgrade of sys-apps/systemd-utils-259.3
I don't know if it is related or not but in /usr/lib/tmpfiles.d/home.conf ; I read :

Code: Select all

q /srv 0755 - - -
This is a new conf file too,

Code: Select all

sys-apps/systemd-utils-255.18
  if use tmpfiles; then
    doins tmpfiles.d/{etc,static-nodes-permissions,var}.conf

Code: Select all

sys-apps/systemd-utils-259.3
  if use tmpfiles; then
    installx usr/lib/tmpfiles.d/{etc,home,static-nodes-permissions,var}.conf
Any help appreciated. Thanks.
Last edited by sdauth on Fri Mar 20, 2026 11:51 pm, edited 3 times in total.
Top
sdauth
l33t
l33t
User avatar
Posts: 770
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

  • Quote

Post by sdauth » Fri Mar 20, 2026 10:39 pm

if I comment it :

Code: Select all

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# See tmpfiles.d(5) for details.

#Q /home 0755 - - -
#q /srv 0755 - - -
Then no more subvolume is created after a reboot so it seems there is something wrong with systemd-utils. I don't even have a /srv mountpoint anymore in / or any /srv active mountpoint (all commented) in fstab or /etc/exports (nfs) for example so why would a subvolume be created automatically ?

Is there a way to prevent this ? Or should I add another line in INSTALL_MASK to prevent /usr/lib/tmpfiles.d/home.conf from being installed to begin with ?
Top
sdauth
l33t
l33t
User avatar
Posts: 770
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

  • Quote

Post by sdauth » Fri Mar 20, 2026 11:51 pm

Reading the doc:

Code: Select all

Files in /etc/tmpfiles.d override files with the same name in /usr/lib/tmpfiles.d
so:

Code: Select all

touch /etc/tmpfiles.d/home.conf
Works fine too. 8) (and will survive to an update of systemd-utils)

I have no need for this feature so I'm marking this thread as solved.
Top
floppymaster
Developer
Developer
User avatar
Posts: 234
Joined: Wed Jul 07, 2010 1:05 am
Location: Detroit, MI, USA

  • Quote

Post by floppymaster » Sat Mar 21, 2026 10:16 pm

tmpfiles.d(5) suggests using a symlink to /dev/null.
If the administrator wants to disable a configuration file supplied by the vendor, the recommended way is to place a symlink to /dev/null in /etc/tmpfiles.d/ bearing the same filename.
Top
sdauth
l33t
l33t
User avatar
Posts: 770
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

  • Quote

Post by sdauth » Sat Mar 21, 2026 11:40 pm

Thanks, I had only read the part at the top of the manual :wink:
Top
sdauth
l33t
l33t
User avatar
Posts: 770
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

  • Quote

Post by sdauth » Sun Mar 22, 2026 4:53 pm

Otherwise, I downloaded and extracted the following stage3 and none of them have "/srv"

Code: Select all

stage3-amd64-openrc:
bin, boot, dev, etc, home, lib, lib64, media, mnt, opt, proc, root, run, sbin, sys, tmp, usr, var

stage3-amd64-openrc-splitusr:
bin, boot, dev, etc, home, lib, lib64, media, mnt, opt, proc, root, run, sbin, sys, tmp, usr, var

stage3-amd64-systemd:
bin, boot, dev, etc, home, lib, lib64, media, mnt, opt, proc, root, run, sbin, sys, tmp, usr, var
and all have /srv in home.conf:

Code: Select all

grep srv stage3-amd64-*/usr/lib/tmpfiles.d/home.conf
stage3-amd64-openrc-splitusr/usr/lib/tmpfiles.d/home.conf:q /srv 0755 - - -
stage3-amd64-openrc/usr/lib/tmpfiles.d/home.conf:q /srv 0755 - - -
stage3-amd64-systemd/usr/lib/tmpfiles.d/home.conf:q /srv 0755 - - -
Since it is not present on gentoo, this triggers the creation of a /srv subvolume as tmpfiles.d manual explains :

Code: Select all

#Type Path                                     Mode User Group Age         Argument
q     /subvolume-or-directory/to/create        mode user group cleanup-age -
Just to compare with a debian install (trixie)

Code: Select all

bin, boot, dev, etc, home, initrd.img, initrd.img.old, lib, lib64, media, mnt, opt, proc, root, run, sbin, srv, sys, tmp, usr, var,
vmlinuz, vmlinuz.old
As you can see, /srv exists and it is not a subvolume.

Code: Select all

grep -i srv debian-debootstrap/usr/lib/tmpfiles.d/home.conf 
q /srv 0755 - - -
Same file but since /srv exists, no subvolume creation is triggered.
Anyway, I'm not a big fan of subvolume appearing in my root like that so I'll keep using the symlink of home.conf to /dev/null.
Otherwise, I guess I could also just "mkdir /srv" too in order to not trigger subvolume creation :o
Anyway... Just in case it helps someone else using btrfs.
Cheers.
Top
Post Reply

6 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic