Kevin McAleer, September 2007
I want to share my experience of setting up the Solaris 10 Operating System and a four-disk, ZFS RAID-Z drive configuration to solve my long-standing "I've run out of hard-disk space" problem.
I'm an amateur photographer, filmmaker, and iTunes downloader, and as such, I have 60+ Gbytes of photographs, 300+ Gbytes of DV footage, and about 45 Gbytes of music files. My MacBook Pro has only 160 Gbytes of storage, and my Mac Mini has only 120 Gbytes of storage.
So the problem was that if I wanted all my files to be available to all my devices from one place, I could either buy a network attached storage (NAS) device or get a file server.
I have several USB hard disks, but two of my drives recently failed, which meant I was without a recent backup. This illustrated how dangerous it can be to use only one physical disk. I have a NAS box (basically an Apple Airport Extreme with a USB disk attached), but this has only one internal hard disk, which is a single point of failure.
I had been reading up on ZFS and decided it was the only real solution I wanted to implement. I considered running Microsoft Windows Server 2003 and a RAID configuration, but 1) Microsoft Windows Server 2003 is expensive and 2) NTFS RAID is not a patch on ZFS RAID-Z.
I also considered Linux, but there are so many distributions, I didn't know which to choose. (Plus Sun invented ZFS and I preferred to use Sun code rather than some experimental "port" on another platform.)
After reading an excellent article on the Web about a guy who built a multi-terabyte file server based on the Solaris OS and ZFS, I decided to do the same.
My solution would go something like this:
home/kev(network home folders for my family and me)
First of all, I purchased four cheap 500-Gbyte hard disks from my local computer shop.
Next, I purchased an 8-port SATA controller card. (I have plans to increase the storage pool in the near future.)
I then purchased a Cooler Master 810 Stacker case. (Rather pricey, but plenty of room for all those disks!)
Finally, I purchased a processor, memory, and a motherboard. I went for an AMD Athlon 64 FX x2, 1.5 Gbytes of RAM, and a cheap motherboard from PC World.
Incidentally, I checked the BigAdmin Solaris OS Hardware Compatibility Lists (HCL) before I purchased the SATA controller card. I didn't bother checking the HCL list for the motherboard, because I had no intention of requiring sound or fancy graphics.
I already had a 360-watt power supply, although I realized I might need a more powerful one if I ever added more drives. I also had a couple of other hard disks: two 300-Gbyte IDE drives, two 100-Gbyte IDE drives, and one 120-Gbyte SATA drive. I decided that I would only use the SATA disk, because the motherboard had only one IDE port on it, and the DVD drive used one of the two heads on the cable.
I then constructed the PC.
I downloaded the latest version of the Solaris 10 OS, burnt it onto a DVD, and booted from the DVD. (I decided that reliability and stability were more important than new features, so I didn't choose the Solaris Express Developer Edition.)
I had not installed the Solaris OS since I had been a student about 10 years ago and had gotten an evaluation version of the Solaris 7 OS. I had a thing for operating systems...
The installation was quite slow, but I realized I was using an IDE drive instead of one of the SATA drives. I stopped the installation, took out the IDE drive and started the installation again on the 120-Gbyte SATA drive. This time, the installation was much, much quicker.
When the installer reached the XOrg or XSun choice, I wasn't sure which to choose, and I wasted quite a bit of time trying to get the installer to see my built-in graphics card. However, in the end I chose the XOrg installer, and it detected my graphics card and monitor without any problems.
After the system rebooted, I almost had my solution, but the Solaris OS wasn't able to detect my motherboard's built-in network card, which I think is a Realtek 81105C. I looked on the Internet, and there are drivers for the Solaris OS, but I was unable to get this to work after several hours of trying.
So, I looked in my box of spare components and found an Intel 1-Gbyte network card. I installed this and ran the
touch /reconfigure and
init 6 commands. The Solaris OS detected this card, and I was then able to connect to the Internet and download updates after registering with Sun.
This was the moment I was waiting for ... to be able to type this command:
zpool create storagepool raidz c1t0d0 c1t1d0 c1t2d0 c1t3d0
Rather impressively, the command took less than a second to execute and the
zfs list command showed my storage pool with 1.8 terabytes of available storage.
I then created folders to match my design:
zfs create storagepool/pictures zfs create storagepool/music zfs create storagepool/movies zfs create storagepool/backup zfs create storagepool/home/kev
Next, I needed to make the newly created folders available to the Mac computers, so I typed the following commands:
share storagepool/pictures share storagepool/music share storagepool/movies share storagepool/backup share storagepool/home/kev
To connect from the MacBook Pro to the Solaris NFS share, I found that I had to create a user account on the file server that used the same user name and password that my Mac computers use. Doing this was straightforward:
useradd kev passwd kev !@Som3password
To connect from the MacBook Pro, I first created an empty folder on my Mac desktop named
I then opened up a terminal window on the MacBook Pro and typed the following:
sudo mount 192.168.1.25:/export/storagepool/pictures /users/kev/desktop/pictures
I was asked for my password and then the drive was connected. It was very satisfying to see the network icon on the desktop with 1.8 terabytes available.
Now that I had a RAID-Z, fully checksummed, ultra-fast, centralized file server, I could begin moving across all my music files. I copied the music folder from my MacBook Pro to the file server, and after a few minutes I was able to point iTunes to the new path. iTunes had no problem running from the network path, so it was a seamless transition.
I then began to move the movies across.
However, Mac OS X decided to restart Finder during the copy operation, and I was unsure whether moving the folder again would over-write the files already present in the folder it had created previously. So I decided to try a nice trick with ZFS.
From the Mac, I launched a terminal window and used telnet to connect to the file server.
Then I ran
su root to become the root user.
I then typed
zfs snapshot storagepool/pictures@beforecopy. Doing this meant that I could attempt to move the folder again and if doing so over-wrote the files from the first attempt, I could at least recover the files from the snapshot.
I wanted to be sure that the newly created ZFS storage pool was working as well as it seemed to be working, so I ran the
zfs scrub storagepool command to start the disk scrubbing process. After a while (about 20 minutes), the scrubbing was complete and no errors were found, which wasn't a surprise.
The command to check the status of the ZFS setup is
zfs status. This command shows any problems found and also the configuration of the drives.
I've been using the file server for a few days now, and I've got to say I love the fact it "just works." Considering that the Solaris OS didn't cost me a penny (well, a small amount for the recordable DVD) and the fact that it has such a cool technology as ZFS, I'm really pleased with the results.
I've been telling everyone I know (well, anyone who will listen to my techno-speak) about how cool this is. I've already converted my friend--he's ditching his Windows Media Center and installing the Solaris OS over the top of it.
I'm also a Solaris convert now. I've installed the latest build of the Solaris Express Developer Edition onto my Dell laptop, and I'm going to play with NetBeans and do some Java programming.
Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License.
More Systems Downloads