Start fresh on Mojave

New to OpenZFS on OS X (Or ZFS in general)? Ask your questions here!

Start fresh on Mojave

Postby decuser » Thu Sep 24, 2020 8:07 pm

Long time FreeBSD ZFS user, brand new MacOS ZFS user.

1. Is it possible to (re)install MacOS Mojave on ZFS? How?
2. If not, Is there a recommended approach to moving /Users onto a ZFS partition (the vast majority of my files are in my primary user account)? I could live with this as an alternative to pure ZFS...

I'm thinking, if the answer to 1 is yes and here's how, I'll just be set and happy. If it's no, then I'd still appreciate advice. Then, I'm thinking I should free up some space and create some kind of partition using a partition manager (is Diskutil advisable or something else), then zpool the new partition and zfs create to my heart's content. What say y'all?

Thanks for bringing ZFS, the best fs ever, to Mac. If I can get this working, it'll make backing up and the like, oh so much simpler.
decuser
 
Posts: 2
Joined: Thu Sep 24, 2020 7:57 pm

Re: Start fresh on Mojave

Postby Sharko » Wed Nov 25, 2020 12:50 pm

Apologies for not replying sooner, your questions may be moot at this point... but here are some pointers and suggestions.

The site here has a wiki page dedicated to booting from a ZFS filesystem: https://openzfsonosx.org/wiki/ZFS_on_Boot

As for the lesser goal of simply having a user home directory on ZFS, this is relatively simple. There are some tradeoffs for security and convenience, as usual. Assuming for the moment that you have an APFS partition for booting, I would recommend that you always maintain a separate admin user with a home directory on the APFS boot volume. Then you are always guaranteed to be able to boot up and log into that user to fix things, if necessary.

I maintain two different logins on my machine; one is the admin user with home directory on APFS, and one is the everyday user with home directory on ZFS. The way that I set that up is to initially create the everyday user with a home directory on APFS disk; I don't migrate any data to that user yet, but I do log into it and sign into my iCloud account. Then I log out of the account and switch back to the admin user. With the admin user I set up ZFS, and create dataset on the pool for my new everyday account. To allow for expansion, I create a directory structure of TANK/HOME/Users/everyday and set up permissions to match /Users/everyday. Then I use the terminal command "ditto" to copy the entire folder /Users/everyday to /Volumes/TANK/HOME/Users/everyday (meaning I copy the directory structure and files that exist under APFS over to the new directory structure under ZFS). Finally, I go into System Preferences > Accounts, authenticate, right click on the everyday user, and select "Advanced options." This will take one to the screen that allows you to specify an alternate location for the everyday user's home folder: /Volumes/TANK/HOME/Users/everyday . Reboot for the changes to take effect.

Can you boot and log into your everyday account on the ZFS filesystem? Theoretically, yes... but I always log into my admin account first after a booting up the machine, just to be sure. That way I can issue a "sudo zpool import -a" if necessary. What I've noticed is that if I have FileVault turned on for the boot disk (MacBook Air) the auto-import script (which is set up by the installation of ZFS) seems to always import my ZFS volume just fine. On my Mac Pro 5,1 running Mojave there is no support for FileVault on the boot volume (since there is no graphics card support during boot), and the ZFS pools never mount. So on the Mac Pro I always log into the admin user, unlock disks if necessary, and manually zpool import.

Hope this helps.

Kurt
Last edited by Sharko on Sun Nov 29, 2020 7:39 am, edited 1 time in total.
Sharko
 
Posts: 135
Joined: Thu May 12, 2016 12:19 pm

Re: Start fresh on Mojave

Postby nodarkthings » Sun Nov 29, 2020 3:46 am

I'd also be interested in having testimonies of people booting to ZFS... ;)

As I like to boot directly in my "Home", I've soon let down the idea of putting it on a ZFS pool: instead, I've extensively used mountpoints for ~/Applications, ~/Videos and many others — based on their sizes.
This has the great advantage that you can move your Microsoft user data to somewhere else — which is/was nearly impossible otherwise since 2016.

I also use some sparsebundles in ZFS pools, such as Time Machine.
It might not be the fastest solution, but it appeared to me as the best trade off for my use case.
nodarkthings
 
Posts: 115
Joined: Mon Jan 26, 2015 10:32 am


Return to Absolute Beginners Section

Who is online

Users browsing this forum: No registered users and 4 guests