Add to ZFS MacOS&Arch article

master
kts of kettek (Tyger) 2018-08-08 21:00:35 -07:00
parent e50fb78f1f
commit c6f98a2a70
1 changed files with 12 additions and 12 deletions

View File

@ -9,20 +9,20 @@ The original idea was to have three major partitions: Mac OS High Sierra, Arch L
The total partitions, with the important self-made ones noted, were:
| # | Name | FS | Size |
|-----|------------|-------|----------|
| 1 | EFI | FAT | 209.7 MB |
| 2 | **Tyger** | HFS+ | 39.3 GB |
| 3 | Recovery HD| ? | 650.0 MB |
| 4 | **Lyon** | ZFS | 60.0 GB |
| 5 | **Lyger** | EXT4 | 19.6 GB |
| # | Name | Description | FS | Size |
|-----|------------|-----------------------------------|------------|----------|
| 1 | EFI | EFI boot partition | FAT | 200 MB |
| 2 | **Tyger** | High Sierra system partition | HFS+ | 36.6 GB |
| 3 | Recovery HD| High Sierra recovery partition | Apple boot | 619.9 MB |
| 4 | **Lyon** | Shared partition | ? | 55.9 GB |
| 5 | **Lyger** | Arch Linux system partition | EXT4 | 18.3 GB |
Before and after each of the Tyger, Lyon, and Lyger partitions I also placed 128MB of free space as per Apple's recommendations.
## The Problem
After the initial install of both Arch Linux and Mac OS -- along with rEFInd -- I was met with a potential problem. HFS+ write access under Linux is experimental and must be enabled with the force option during mount. Although I was uncertain as to what potential issues could arise from forcing R/W HFS+ access, as it seemed to work during initial tests, I did not feel comfortable with keeping HFS+ as the shared partition in the event of file loss or corruption.
After an initial review of HFS+ R/W or using EXT4 via FUSE on Mac OS, I came to the conclusion that neither of these were very good options. In the case of HFS+, it was uncertain what extended use would lead to, and in the case of EXT4, the only reliable EXT3/EXT4 R/W "driver" came at a bit of a cost (not much, by any means).
After an initial review of the potentially shared options of NTFS, HFS+ R/W or using EXT4 via FUSE on Mac OS, I came to the conclusion that none of these were very good options. In the case of HFS+, it was uncertain what extended use would lead to, and in the case of EXT4, the only reliable EXT3/EXT4 R/W "driver" came at a bit of a cost (not much, by any means). NTFS was denied on the principle of it -- if I was triple booting, NTFS might have been the choice, although permission incompatibility would probably deny the shared user directory design.
With this, I then thought of another project I was working on...
@ -35,16 +35,16 @@ I began first by installing and setting it up on Arch Linux, following the guide
sudo zpool create Lyon /dev/sda5
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 file. 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.
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.
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 renamed the root */Users* directory, 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 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 zpool have different volume 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. 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 some minor omitted mistakes along the way --, I safely rebooted between the two operating systems seamlessly, keeping my changes and files shared and intact.
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.
**Shared ZFS on Mac OS & Linux was a success!**