What makes OpenSolaris interesting? Reason #1: ZFS
By Roman Strobl on Jul 14, 2008
One of my friends recently asked me why should he consider using OpenSolaris? He is a happy Ubuntu user and he knows that Solaris is a great server operating system, however he as a developer sees little value in using Solaris/OpenSolaris on his workstation.
The answer to this question may differ for each developer (C developers have different needs than Java developers, etc.), but I will point out some of the interesting technologies and features of OpenSolaris in a series of posts. I will start with reason #1...
1. ZFS (Zettabyte file system) - probably the coolest filesystem of today. ZFS is the default filesystem in OpenSolaris. Unlike other filesystems it has been designed with the idea in mind that all disks will eventually fail. It has excellent data-loss detection mechanisms and can even detect silent data corruption (see the ZFS end-to-end data integrity post).
The thing that I like about ZFS the most is the freedom when assigning resources to different mount points. With other file systems I was always limited about how I structured my partition table (e.g. space for /usr, space for /home etc.). With ZFS there are so called pools and all the mount points share the same pool, so it is much harder to get out of space. This is the layout on my laptop:
$ df -h Filesystem Size Used Avail Use% Mounted on rpool/ROOT/opensolaris-3 55G 9.4G 46G 17% / rpool/ROOT/opensolaris-3/opt 50G 3.9G 46G 8% /opt rpool/export 46G 19K 46G 1% /export rpool/export/home 55G 8.9G 46G 17% /export/home rpool/ROOT/opensolaris-1/opt/centos5 47G 1.3G 46G 3% /opt/centos5 rpool 46G 61K 46G 1% /rpool rpool/ROOT 46G 18K 46G 1% /rpool/ROOT
As you can see there is 46GB of free disk space and these 46GB are shared between all different mount points, so /, /opt/, /export/home and others all have lots of available disk space. With other filesystems I would need to decide how much space is allocated for each partition, but with ZFS I have the freedom to use disk space as I need without specifying it.
If I need more space, I can just add a new disk drive and add the new disk space into the pool. Suddenly I have more space and I don't have to reshuffle data on my disk. If you ever ran out of space, you probably know how tedious task it can be to move the data on the disk or change the layout of the partitions.
The other cool thing about ZFS is that there are very few limitations. The largest possible filesystem size is 16 exbibytes = 264 bytes. The same limit is for a size of an individual file. According to Jeff Bonwick (leader of ZFS development), populating 128-bit file systems would exceed the quantum limits of earth-based storage. You couldn't fill a 128-bit storage pool without boiling the oceans. In other words, these limits are good enough for any needs of the 21st century :)
Another great thing about ZFS is that snapshots are almost free. You can view it as using your file system as a version control system :) You can make a snapshot anytime and it is almost instant and consumes very little space. So for example you can install all the applications you need and in the future if anything goes wrong you can simply boot into the old snapshot and move back in time. This has already saved me once when I messed up my packages upgrades but I simply booted into a previous snapshot and my laptop was again operational. Btw you can also create "clones" easily.
There's more: dynamic stripping across all devices to maximize throughput means that as additional devices are added to the zpool, the stripe width automatically expands to include them; thus all disks in a pool are used, which balances the write load across them.
Creating a new file system is very fast. Which means that you can create hundreds of new filesystems in seconds or minutes. Resizing the file system is also a very fast operation.
If you are interested in creating RAIDs, there are many options non-redundantly (similar to RAID 0), as a mirror (RAID 1) of two or more devices, as a RAID-Z group of three or more devices, or as a RAID-Z2 group of four or more devices
There are many other cool features of ZFS, see the ZFS community for more details.
Are there any disadvantages? I guess one disadvantage is that ZFS is rather new, thus it's harder to find people who have "ZFS skills" and there is a learning curve connected to ZFS because it's quite different than other filesystems (e.g. the concept of logical volume management becomes obsolete in ZFS). I also heard that working with many small files is rather slow, but I didn't notice much difference on my laptop. Also memory usage of ZFS can be higher than with other file systems (e.g. UFS).
On large files ZFS can be very fast, for example copying a 160 MB file averages in 25 MB/s transfer rate on my laptop.
What are your experiences with ZFS? Do you know any other important advantages or disadvantages? Share your thoughts with us using the comments.
P.S. I just discovered a great interview with inventors of ZFS, it is 45 minutes long but it is worth watching.