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

Allow mounting of a rootfs dataset with mountpoint=legacy (or anything else besides none) #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mlow
Copy link

@mlow mlow commented Feb 2, 2019

This is my first effort to do anything in C, so please bear with me... I tried to understand the logic behind the construction of the mountpoint that gets passed to the zfs mount command, and I believe it to be as follows:

Since sd-zfs handles mounting of descendent filesystems as well, the zfs mountpoint option of the dataset (and its descendents) given to mount.initrd_zfs is appended to the mountpoint given to mount.initrd_zfs. This however breaks mounting the root dataset when its zfs mountpoint is set to anything other than "/", since that path doesn't exist in /new_root inside the initramfs.

This makes it so the dataset given to mount.initrd_zfs is mounted directly to the mountpoint given to mount.initrd_zfs, and treats descendant datasets the same way as they were before.

This helps my dual-boot scenario allowing me to mount the root dataset of Archlinux inside of another distribution (whose rootfs is another dataset in the same pool) without needing to change the zfs mountpoint of the Archlinux dataset from '/' to avoid conflicts with the currently booted dataset. Instead, I just set the Archlinux dataset mountpoint to legacy.

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

Successfully merging this pull request may close these issues.

None yet

1 participant