Skip to content

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

Open
mlow wants to merge 1 commit into
dasJ:masterfrom
mlow:master
Open

Allow mounting of a rootfs dataset with mountpoint=legacy (or anything else besides none)#29
mlow wants to merge 1 commit into
dasJ:masterfrom
mlow:master

Conversation

@mlow
Copy link
Copy Markdown

@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.

1 participant