VirtualBox and the ZFS Demonstration Tutorial
By Brian Leonard on Jul 08, 2008
The ZFS Demonstration Tutorial is an excellent resource, however, many are probably put off by the requirements necessary to complete it:
"You need a minimum of four disks, preferably five or more and if possible, all the same size."
As my teammate Gregg would say - Yowza!
Once you have OpenSolaris successfully installed in VirtualBox, we can begin to add the additional disks (you'll need to shut down OpenSolaris if it is running). From the VirtualBox File menu, select Virtual Disk Manager. Here you'll see the virtual disk image you created when you first installed OpenSolaris (your vdi name, of course, may be different):
Click New to add a new disk:
Select Dynamically expanding image as the image type:
Name the image ZFSTutorial1.vdi and set the size to 100 MB:
Repeat those steps to create disks 2 through 5. Once complete your disk manager should look as follows:
Click OK to close the Virtual Disk Manager. Open the Settings for your OpenSolaris virtual machine and select Hard Disks:
Select Enable SATA Controller.
Click the Add Attachment icon on the right 5 times to add the 5 disks we just created:
Then change the slot property so all of the disks use SATA ports. This will just make managing the disks easier from OpenSolaris as they'll all be assigned to the same controller:
Now start OpenSolaris and identify the disks by opening a terminal and running the format command:
bleonard@opensolaris:~$ pfexec format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c4d0
/pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0 1. c6t1d0 /pci@0,0/pci8086,2829@d/disk@1,0 2. c6t2d0 /pci@0,0/pci8086,2829@d/disk@2,0 3. c6t3d0 /pci@0,0/pci8086,2829@d/disk@3,0 4. c6t4d0 /pci@0,0/pci8086,2829@d/disk@4,0 5. c6t5d0 /pci@0,0/pci8086,2829@d/disk@5,0 Specify disk (enter its number):
You can see the disk IDs are nicely labeled c6t1d0 through c6t5d0 (for this tutorial, I'm not going to mess with my existing hard disk - c4d0). The tutorial uses disk IDs c1t0d0 through c5t0d0, which cleanly map as follows:
|Tutorial Device ID||Your Device ID|
With that you should be ready to complete the ZFS Demonstration Tutorial. Enjoy!