Unable to get OS X to accept HFS+ formatted ZVOL as home dir

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

Unable to get OS X to accept HFS+ formatted ZVOL as home dir

Postby Sharko » Tue Jul 05, 2016 9:24 pm

So, one of the goals I had for using ZFS was to get my home directory onto a ZFS dataset, so that it would have all the benefits of ZFS. Chief among the benefits being protection against corruption (because of COW), and protection against bit rot (because the data is mirrored and checksummed six ways to Sunday). I thought that the best way to absolutely guarantee no compatibility problems would be to go the ZVOL route: create a 480GB ZFS volume, and then use Disk Utility to format it as HFS+. This seemed to work fine: the data is there, it shows up as an HFS external drive volume both on the desktop and in Disk Utility, I can run First Aid on it to check the filesystem integrity, etc.

However... I can't seem to get OS X to accept the home directory I've set up on this ZFS external volume as a valid home folder. The account I'm trying to put on the ZFS volume is a non-admin account called userkurt; the way that I'm setting this up is as follows:

1. Use Carbon Copy Cloner to copy just the /Users folder on the boot drive to a the ZFS volume. Actually, I've run in to a trap with CCC; it wouldn't just do a volume to volume copy of the /Users data; when I tried to do that CCC complained that the destination wasn't mounted and to mount it and try again. In fact, the HSF+ volume on top of the ZVOL was still and always there. By playing around I discovered that as long as directed CCC to copy to a folder on the destination volume it would work. So I had to create a folder called "Junk" on the HFS+/ZVOL destination, copy the /Users folder to that, then manually move the contents of Junk up a directory level to the root level of the HFS+/ZVOL and delete Junk.

I put a marker file in Documents of the new userkurt home to tell me later if I'm really in the right place.

2. Then go into System Preferences -> Users and groups, right click on the non-admin user account, select Advanced Options. In the field for home folder, click on Choose, navigate appropriately, and then the field reads: "/Volumes/ZTEST/Users/userkurt". ZTEST is the HFS+ formatted ZVOL.

3. Save, reboot into admin user, do sudo zpool import -a to get all the ZFS datasets to show up.

4. Switch users to userkurt. Net result: home folder is still missing the marker file under Documents.

Just to confirm that I'm not crazy I did a test where I replicated the /Users data onto a non-ZFS native HFS+ partition on the SSD, and then pointed the userkurt home folder field at that. That actually worked as expected.

So, I'm left wondering... do you think it is the fact that the intended home folder (the one based on the ZVOL) is not present during the boot process that is messing this up? The reason it is not present is that each of the VDEV component disks is encrypted according to the instructions in the wiki. It appears that they don't get unlocked until the admin user logs in, and then I follow that up with the zpool import command. I was willing to live with the limitation of always booting into the admin user account (which is still based on the native HFS+ boot drive SSD), and then letting the four disks get unlocked automatically with the password form the keychain, and then issuing the import command. But maybe OS X needs to see the home directory is present during bootup?

Thanks for your kind advice and assistance in advance.
Sharko
 
Posts: 228
Joined: Thu May 12, 2016 12:19 pm

Re: Unable to get OS X to accept HFS+ formatted ZVOL as home

Postby Brendon » Tue Jul 05, 2016 11:59 pm

Try again. Show us the output of "pwd" when you log in as user Kurt. Also make sure that directory is owned by Ubercurt.

I see nothing wrong with what you are trying in principle.

You need to be aware that in any homedir on zfs scenario, you must not attempt to log in as that user until the zfs filesystem is fully imported/mounted. Osx will present the login prompt on its own timeline often before the filesystem is ready. There is not a lot we can do to prevent this.

Brendon
Brendon
 
Posts: 286
Joined: Thu Mar 06, 2014 12:51 pm

Re: Unable to get OS X to accept HFS+ formatted ZVOL as home

Postby Sharko » Thu Jul 07, 2016 8:03 am

Well, Brendon, you were right... without changing any settings I just booted up the machine, logged into adminkurt (although I like your suggestion of uberkurt), imported the pool, waited 30 to 60 seconds, then switched users to userkurt. Darned if it didn't work! I don't normally think of myself as being a fast typist, but apparently I can beat OSX/ZFS. Thanks for your help.
Sharko
 
Posts: 228
Joined: Thu May 12, 2016 12:19 pm


Return to Absolute Beginners Section

Who is online

Users browsing this forum: No registered users and 3 guests