What makes OpenSolaris interesting? Reason #1: ZFS

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. 

Comments:

Great post! I look forward to the next in the series...

Posted by Che Kristo on July 14, 2008 at 06:04 AM GMT #

Thanks for the excellent post, but the readers must be forewarned that there is one MAJOR problem with ZFS--it is very addictive. Once you get a kick out of it, there is no return.

Posted by W. Wayne Liauh on July 14, 2008 at 09:57 AM GMT #

One important limitation to be aware of is that you can't just add disks to a root pool and form a concatenation to expand space, as root pools must be either a single disk or a mirror at present.

Posted by Dave Miner on July 15, 2008 at 05:22 PM GMT #

Yes, I figured that one out the hard way :-). It prompted me to write this post
on increasing storage capacity:
http://blogs.sun.com/observatory/entry/increasing_storage_capacity

Posted by Brian Leonard on July 16, 2008 at 03:43 AM GMT #

Hmm, it's really a pity you can't add disks into the root pool :(

Posted by Roman Strobl on July 16, 2008 at 06:30 AM GMT #

Roman have you considered that ZFS has root support built in, hence is present in your mount points?

$ zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
rpool 29G 3.62G 25.4G 12% ONLINE -

Now suppose you would like to setup a root system from scratch and manually create the ZFS pool, turning off mounting file systems by default, check out the following articles.

Doug Scott;
http://www.blogger.com/profile/01147471010902962909

His excellent article located at - http://solaristhings.blogspot.com/2006/06/zfs-root-on-solaris-part-2.html

And Tabriz Leman; http://blogs.sun.com/tabriz

For his great article located at - http://blogs.sun.com/tabriz/entry/are_you_ready_to_rumble

There is also a nice article on opensolaris.org describing the manual process, which appears an ideal method to suit your requirements;

http://opensolaris.org/os/community/zfs/boot/zfsboot-manual/

And for posterity, Will Green provides a good reference on the ZFS file system -
http://flux.org.uk/howto/solaris/zfs_tutorial_01

Posted by Glen Hassell on September 20, 2008 at 08:27 PM GMT #

Thanks a lot for the links!

Posted by Roman Strobl on September 21, 2008 at 04:56 AM GMT #

Thanks for NetBeans :)

Posted by Glen Hassell on September 22, 2008 at 06:08 AM GMT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today