Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving side shouldn't mount datasets #48

Open
zviratko opened this issue Dec 17, 2024 · 2 comments
Open

Receiving side shouldn't mount datasets #48

zviratko opened this issue Dec 17, 2024 · 2 comments

Comments

@zviratko
Copy link

By default, if a dataset has canmount=on and mountpoint set, it will get mounted, this is highly undesirable in a backup pool.
I usually worked around thet when making backups by setting canmount=noauto/off on the parent dataset I receive the backup into, but this doesn't work when the source dataset has this set explicitely (not inherited), like FreeBSD zroot datasets. Ouch.

At the very least, zfs-replicate should by default use "zfs recv -u" so that the datasets are not mounted and one can change their properties, even better it should support "zfs receive -o canmount=noauto" (or maybe -x?) from a config file so that it can be safely received by absent minded admin who will forget to change those after the receive is done the first time (which can take some time).

Not sure if there's a better way to do this.

Thanks.

@tschettervictor
Copy link
Collaborator

tschettervictor commented Dec 17, 2024

This could probably be solved by adding "ZFS_OPTIONS" as a variable.

Then simply include that after the "zfs recieve"

A default value of -u maybe?

Have you tried simply adding -u to these two variables in the config file?

## Set the pipe to the destination pool. But DO NOT INCLUDE the pipe (|)
## character in this setting. Filesystem  names from the source will be
## sent to the destination. For increased transfer speed to remote hosts you
## may want to customize ssh ciphers or include mbuffer.
## The macro %HOST% string will be substituted with the value of the "@host"
## target in the replication set.
## The default WITH a "@host" option is "ssh %HOST% zfs receive -vFd"
## The default WITHOUT a "@host" option is "zfs receive -vFd".
##
#DEST_PIPE_WITH_HOST="$SSH %HOST% $ZFS receive -vFd"
#DEST_PIPE_WITHOUT_HOST="$ZFS receive -vFd"

@aaronhurt
Copy link
Owner

I don't think it needs a new variable, modifying the existing pipes should be sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants