OpenSolaris ZFS iSCSI
Time Machine in 20 Minutes
OpenSolaris ZFS iSCSI
Time Machine in 20 Minutes
OpenSolaris ZFS iSCSI Time Machine in 20 Minutes
The Truth Is Out There...
I’ve seen many write-ups about using OS X Time Machine with NAS, and originally I was using my OpenSolaris machine for doing rsnapshot backups of our laptops, but this is just not a good long-term solution and can’t be managed very well. It relies on NFS or CIFS to mount the snapshot directory, and in general is sort of a Rube Goldberg contraption. Something had to be done, and I was wondering how to put iSCSI to use with ZFS. I wanted to have my own home-brew Time Capsule in effect.
While walking to the post office I was thinking about the alternatives for serving up the filesystem OS X Time Machine and whether to use NFS or CIFS. I’ve never had a problem with NFS in a Unix environment, mixing it with Macs has always been fairly easy and getting easier. However, most people use CIFS, and using either protocol is somewhat slow. The I started thinking, this might be just right for iSCSI.
A brief search on the Internet turned up this link: ZFS iSCSI pool integration which was close to what I wanted, but not quite complete. It did point me to this handy, free iSCSI initiator for OS X.
By the way, this is not at all supported by Apple and could just stop working with any OS X upgrade. So you are at your own risk here. If it does break at some point in time due to the overriding of preferences, with an undocumented preference, I’m sure there will be a work-around. But, as unlikely as it may be, you should use this with caution. Standard disclaimers apply.
What You Need
Here’s a list of everything I used:
‣Mac OSX 10.5.7 and a Mac
‣Studio Network Solutions globalSAN iSCSI initiator for OS X
‣Sun iSCSI Target - SUNWiscsitgt
‣Of course some hardware to run OpenSolaris on with a good bit of disk.
‣About 20 minutes
Of course the hardware is extra. I am using the same NAS machine I’ve been setting up in the last posts for hosting the iSCSI volume.
‣Download the iSCSI initiator and install. This will require a reboot.
‣Log into the OpenSolaris server and do the following:
•Install the Sun iSCSI Target package
-pkg install SUNWiscsitgt
-svcadm enable /system/iscsitgt
•Create a ZFS zvol. I’m going to put multiple zvols for time machine so I created a ZFS file system for them and set the “sharescsi” attribute so any zvol created under that location will inherit this property. I created a sparse volume of 250GB. The host name is “acrylic.” Since it’s backups, it’s probably OK to set compression on.
-zfs create xpool/export/tm
-zfs set shareiscsi=on xpool/export/tm
-zfs set compression=on xpool/export/tm
-zfs create -s -V 250g xpool/export/tm/acrylic
‣Back on the Mac...
•In a Terminal window type the following (this is the real magic):
-defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
•Go to System Preferences
-Select globalSAN iSCSI
-Select the “Portals” tab and add a new portal for the iSCSI host
-Select the “Targets” tab
-Select the iSCSI target you created. This can be identified on the OpenSolaris host using:
iscsitadm list target
•Go into Disk Utility and you will see the iSCSI disk
-Select the disk and the “Partition” tab
-Create a single Mac OS Extended (Journaled) partition
‣At this point Time Machine will see the volume and ask if you want to use it as a backup disk, tell it yes.
You’re done. It was that simple.
I wanted to get this up as soon as possible. I’ll have some screen but they are really big and boring.
Monday, 25 May 2009