Forums

Skip to content

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

systemd mount race condition between tmpfs and zfs

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
2 posts • Page 1 of 1
Author
Message
bloodyTribology
n00b
n00b
Posts: 4
Joined: Thu Jun 28, 2018 12:00 pm
Location: UK

systemd mount race condition between tmpfs and zfs

  • Quote

Post by bloodyTribology » Tue Nov 28, 2023 11:37 am

Hi,

I recently migrated form OpenRC to systemd, and everything went smoothly except my computer has developed a race condition during boot where /var/tmp/portage is not mounted properly as tmpfs.

I use ZFS with two pools: / is on an NVME SSD and both /home and /var are on spinning disks. The mounts are managed though ZFS, but in my fstab I also specify /var/tmp/portage should be mounted as tmpfs (see below).

I found the option of `x-systemd.after=<service>` and tried using zfs-mount to get systemd to mount it afterwards. But this doesn't seem to work. I can mount /var/tmp/portage manually without any issues.

Anyone have any ideas to force systemd to mount in a specific order?

/etc/fstab

Code: Select all

# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't 
# needed); notail increases performance of ReiserFS (at the expense of storage 
# efficiency).  It's safe to drop the noatime options if you want and to 
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>			<mountpoint>	<type>		<opts>		<dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
#
# NOTE: Even though we list ext4 as the type here, it will work with ext2/ext3
#       filesystems.  This just tells the kernel to use the ext4 driver.
#
# NOTE: You can use full paths to devices like /dev/sda3, but it is often
#       more reliable to use filesystem labels or UUIDs. See your filesystem
#       documentation for details on setting a label. To obtain the UUID, use
#       the blkid(8) command.

UUID=F357-EDC4  /boot/efi	        vfat	defaults,noatime,noauto                                                 1 2
shm	            /dev/shm	        tmpfs	nodev,nosuid,noexec	                                                    0 0
tmpfs	        /var/tmp/portage	tmpfs	size=20G,uid=portage,gid=portage,mode=775,nosuid,noatime,nodev,x-systemd.after=zfs-mount  0 0
Top
alamahant
Advocate
Advocate
Posts: 4033
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Tue Nov 28, 2023 2:27 pm

Hi
Try replacing

Code: Select all

x-systemd.after=zfs-mount

Code: Select all

x-systemd.after=zfs.target

Which sould look like

Code: Select all

[Unit]
Description=ZFS startup target
Requires=zfs-mount.service
Requires=zfs-share.service
Wants=zed.service

[Install]
WantedBy=multi-user.target

:)
Top
Post Reply

2 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