From 265497273e98566a7cc84bc8b55206374be0490f Mon Sep 17 00:00:00 2001 From: "kts of kettek (Tyger)" Date: Wed, 8 Aug 2018 21:41:29 -0700 Subject: [PATCH] More final updates to ZFS article --- .../zfs-macos-arch-linux-dual-boot.qwk | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/wiki/articles/zfs-macos-arch-linux-dual-boot.qwk b/wiki/articles/zfs-macos-arch-linux-dual-boot.qwk index 4f0f96b..16a8bbc 100644 --- a/wiki/articles/zfs-macos-arch-linux-dual-boot.qwk +++ b/wiki/articles/zfs-macos-arch-linux-dual-boot.qwk @@ -37,14 +37,40 @@ I began first by installing and setting it up on Arch Linux, following the guide With this, the zpool *Lyon* was created, allowing me to copy over my home directory and begin using it by setting my entry in `/etc/passwd` to point to the appropriate Lyon zfs volume. I rebooted into Mac OS and issued the standard `sudo zpool import` and discovered that the Linux-made ZFS pool had setup an extended Linux-centric option that rendered it only able to mounted as read-only in Mac OS. This would not do, so I issued `sudo zpool destroy Lyon` and recreated it on Mac OS. With this in place, I switched back to Linux and confirmed that it had R/W access to the same pool. -Now it was merely a matter of synchronizing the UIDs and GUIDs for my user and group between the systems and setting them both up to use the appropriate user/home locations. +With the zpool working and visible between both, I decided to set up a generic *Users* volume within the *Lyon* zpool in the event of adding additional volumes or otherwise. This was merely a matter of issuing `zfs create Lyon/Users`, moving the Mac OS partition's *Users* contents to it, and setting up the appropriate mount paths. I additionally enabled the *com.apple.mimic_hfs* setting in the event that I might run into problems otherwise: `sudo zfs set com.apple.mimic_hfs=on Lyon/Users`. -However, before I did this, I decided to set up a generic *Users* volume within the *Lyon* zpool in the event that I wish to add additional volumes or otherwise. This was merely a matter of issuing `zfs create Lyon/Users`, moving the Mac OS partition's *Users* contents to it, and setting up the appropriate mount paths. I additionally enabled the *com.apple.mimic_hfs* setting in the event that I might run into problems otherwise: `sudo zfs set com.apple.mimic_hfs=on Lyon/Users`. +On Mac OS, I backed up the root */Users* directory, deleted the original, issued `zfs set mountpoint=/Users Lyon/Users`, then moved the original */Users/* contents into the mounted share. -On Mac OS, I backed up the root */Users* directory, deleted it, issued `zfs set mountpoint=/Users Lyon/Users`, then moved the original */Users/* contents into the mounted share. +On Linux, I logged in as root, simply used the same */Users/* mount point and set my */etc/passwd* user entry to use */Users/kts*, as I do not know if it is possible to have a ZFS volume have different mount locations based upon the current host. Additionally, I modified my user entry in */etc/passwd* to use the same UID as used in Mac OS so there wouldn't be mismatched ownership. I additionally added a new group that matched Mac OS's *staff* GUID and made it my primary. -On Linux, I simply used the same */Users/* mount point and set my */etc/passwd* user entry to use */Users/kts*, as I do not know if it is possible to have a zfs volume have different mount locations based upon the current host. Additionally, I modified my user entry in */etc/passwd* to use the same UID as used in Mac OS so there wouldn't be mismatched ownership. I additionally added a new group that matched Mac OS's *staff* GUID and made it my primary. +With all this in place -- and omitting some some minor mistakes along the way -- I safely rebooted back to Mac OS. However, upon attempting to login, it seemed the ZFS filesystem *Lyon/Users* was not automatically mounting on boot. To solve this -- and perhaps this is the wrong way to go about automounting ZFS -- I created two files responsible for mounting *Lyon/Users* on boot: -With all this in place -- and omitting some some minor mistakes along the way -- I safely rebooted between the two operating systems seamlessly, keeping my user changes and files shared and intact. +**/usr/sbin/mount-Lyon** + #!/bin/bash + zfs mount Lyon/Users -**Shared ZFS on Mac OS & Linux was a success!** +**/System/Library/LaunchDaemons/net.kettek.Lyon.plist** + + + + Label + net.kettek.Lyon + ProgramArguments + + /usr/sbin/mount-Lyon + + RunAtLoad + + KeepAlive + + UserName + root + + + +With these files in place, and with the appropriate root:wheel ownership set to both and the executable flag set on */usr/sbin/mount-Lyon*, I rebooted back to Linux, mounted the HFS+ boot as R/W, moved the old /Users to /Users2 (non-destructive move due to HFS+ driver spottiness), and rebooted back to Mac OS. + +Lo and behold, I logged in as my user and saw that the ZFS filesystem *Lyon/Users* was mounted as */Users* and that my own user directory was appropriately loaded! + +**Finally, shared ZFS on Mac OS & Linux was a success!**