Page 1 of 1

ZFS during boot?

PostPosted: Fri Feb 12, 2016 3:10 am
by forquare
Good morning all,

I have an old 2009 Mac Pro that I use for a home server. It boots El Capitan from a USB stick and the four internal drives are configured into a RAIDz.

On the RAIDz I have some VirtualBox virtual machines, and everything works great when the Mac is up and running. One of the VMs I run I use as a server providing various other services, and this should start during boot (via launchd as described in the VirtualBox manual). However, because the ZFS volumes don’t seem to be discovered until a user logs in the VM does not start when the Mac Pro is rebooted.

Auto-login is already being used for a separate user (for iTunes Home Sharing), and I’m pretty sure I can’t have multiple users auto-login…?

Is there a way, perhaps as part of the launchd service that starts my VM, to discover and mount ZFS volumes during boot?

Many thanks,
Ben

Re: ZFS during boot?

PostPosted: Tue Mar 08, 2016 4:22 am
by forquare
Would anyone be able to supply/point me to an overview of how ZFS is loaded/started on OS X? I've had a look around the Wiki but can't find anything about the process...

Re: ZFS during boot?

PostPosted: Tue Mar 08, 2016 12:11 pm
by Brendon
The ZFS kexts are loaded at boot by the OS. There is an auto-import script run by launchd which imports/mounts the filesystems. The ZFS filesystems can take a while to be imported, which may lead to the incorrect assumption that they are not available until a user logs in.

Brendon

Re: ZFS during boot?

PostPosted: Tue Mar 08, 2016 12:23 pm
by forquare
Interesting, thank you Brendon.

I was looking for a way to perhaps make the VirtualBox boot job depend on ZFS, but it seems that Launchd isn't designed for that….

Back to the drawing board!

Re: ZFS during boot?

PostPosted: Tue Mar 08, 2016 4:26 pm
by Brendon
You could add content to our script after the import?

Re: ZFS during boot?

PostPosted: Wed Mar 09, 2016 2:00 pm
by forquare
Oh that's very true! I'll take a look into it when I have time :D

Many thanks for your help!