Reading a ZFS USB drive with Mac OS X Mountain Lion

Posted by Karim Berrah on Oracle Blogs See other posts from Oracle Blogs or by Karim Berrah
Published on Thu, 27 Sep 2012 12:14:04 +0000 Indexed on 2012/09/27 15:44 UTC
Read the original article Hit count: 265

Filed under:

The problem:

I'm using a MacBook, mainly with Solaris 11, but something with Mac OS X (ML). The only missing thing is that Mac OS X can't read my external ZFS based USB drive, where I store all my data. So, I decided to look for a solution.

Possible solution:

I decided to use VirtualBox with a Solaris 11 VM as a passthrough to my data. Here are the required steps:

  • Installing a Solaris 11 VM

    • Install VirtualBox on your Mac OS X, add the extension pack (needed for USB)
    • Plug your ZFS based USB drive on your Mac, ignore it when asked to initialize it.
    • Create a VM for Solaris (bridged network), and before installing it, create a USB filter (in the settings of your Vbox VM, go to Ports, then USB, then add a new USB filter from the attached device "grey usb-connector logo with green plus sign") 
    • Install a Solaris 11 VM, boot it, and install the Guest addition
    • check with "ifconfg -a" the IP address of your Solaris VM
  • Creating a path to your ZFS USB drive

    • In MacOS X, use the "Disk Utility" to unmount the USB attached drive, and unplug the USB device.
    • Switch back to VirtualBox, select the top of the window where your Solaris 11 is running
    • plug your ZFS USB drive, select "ignore" if Mac OS invite you to initialize the disk
    • In the VirtualBox VM menu, go to "Devices" then "USB Devices" and select from the dropping menu your "USB device"

  • Connection your Solaris VM to the USB drive

  • Inside Solaris, you might now check that your device is accessible by using the "format" cli command
  • If not, repeat previous steps
  • Now, with root privilege, force a zpool import -f myusbdevicepoolname because this pool was created on another system
  • check that you see your new pool with "zpool status"
  • share your pool with NFS: share -F NFS /myusbdevicepoolname

  • Accessing the USB ZFS drive from Mac OS X

  • This is the easiest step: access an NFS share from mac OS
  • Create a "ZFSdrive" folder on your MacOS desktop
  • from a terminal under mac OS: mount -t nfs IPadressofMySoalrisVM:/myusbdevicepoolname  /Users/yourusername/Desktop/ZFSdrive
  • et voila ! you might access your data, on a ZFS USB drive, directly from your Mountain Lion Desktop. You might play with the share rights in order to alter any read/write rights as needed. You might activate compression, encryption inside the Solaris 11 VM ...

© Oracle Blogs or respective owner

Related posts about /ZFS