Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Runs
zfs mount -R <dataset>
at boot, afterzfs mount -a
. Intended to replacemountpoint=legacy
in certain mount setups.Motivation and Context
If a pool has multiple ZFS root filesystems (
canmount=noauto mountpoint=/
) (or some other dual-booting setup that utilizes ZFS across multiple systems), and those in turn each have child datasets (e.g.,canmount=on mountpoint=/var/lib/mysql
), then problems arise aszfs-mount.service
will executezfs mount -a
, attempting to mount multiple datasets to the same location.The typical solution is to set
mountpoint=legacy
and set a mount entry in/etc/fstab
. This is cumbersome and easy to mess up.Instead, introduce a
[email protected]
which runszfs mount -R <dataset>
, to be used in conjunction withcanmount=noauto mountpoint=/path/...
Description
[email protected]
is essentially identical tozfs-mount.service
, with the following two changes:After=zfs-mount.service
, yielding an intuitive precedence order.zfs mount -R <dataset>
instead ofzfs mount -a
.The build/install files have been adjusted to install
[email protected]
where appropriate.As far as I can tell, the documentation does not directly mention
zfs-mount.service
, so I have not added or modified any documentation.How Has This Been Tested?
I have tested it on a personal machine. Being essentially identical to
zfs-mount.service
, I would not expect there to be any issues with the implementation. Being a template unit, it will never be enabled by default, so50-zfs.preset
was left unmodified (I did verify that template units without aDefaultInstance=
setting do not need to be disabled explicitly)The
dracut
andinitramfs-tools
modules both do not usezfs-mount.service
, so they are left unmodified.zfs-mount-generator
adds aBefore=zfs-mount.service
ordering, and with[email protected]
beingAfter=zfs-mount.service
, a consistent ordering is preserved here too.Beyond this, I did not see any test files that directly deal with systemd services, so nothing was modified there. No core ZFS code was modified.
Types of changes
Checklist:
Signed-off-by
.