Oracle ZFS: Difference between revisions
Changed EB to EiB and, peta and zetta to proper base 2 pebi and zebi prefixes |
m →Linux |
||
Line 207: | Line 207: | ||
The solution to this problem was to port ZFS to Linux's [[FUSE (Linux)|FUSE]] system so the [[filesystem]] runs in [[userspace]] instead, where it is not considered a derived work of the kernel. A project to do this was sponsored by Google's [[Google Summer of Code|Summer of Code]] program in 2006<ref name=fuse>{{ cite web |url = http://zfs-on-fuse.blogspot.com/ | title = ZFS on FUSE/Linux | author = Ricardo Correia | accessdate = 2009-03-16 | date = March 16, 2009 }}</ref> The original [http://www.wizy.org/wiki/ZFS_on_FUSE ZFS on FUSE project is available here.] Sun Microsystems has stated that a Linux port is being investigated.<ref name=port>{{ cite web | url = http://www.sun.com/emrkt/campaign_docs/expertexchange/knowledge/solaris_zfs_gen.html#10 | title = Fast Track to Solaris 10 Adoption: ZFS Technology | work = Solaris 10 Technical Knowledge Base | publisher = Sun Microsystems | accessdate = 2006-04-24 }}</ref> Development for ZFS on FUSE/Linux now takes place at [http://zfs-fuse.net/ zfs-fuse.net]. |
The solution to this problem was to port ZFS to Linux's [[FUSE (Linux)|FUSE]] system so the [[filesystem]] runs in [[userspace]] instead, where it is not considered a derived work of the kernel. A project to do this was sponsored by Google's [[Google Summer of Code|Summer of Code]] program in 2006<ref name=fuse>{{ cite web |url = http://zfs-on-fuse.blogspot.com/ | title = ZFS on FUSE/Linux | author = Ricardo Correia | accessdate = 2009-03-16 | date = March 16, 2009 }}</ref> The original [http://www.wizy.org/wiki/ZFS_on_FUSE ZFS on FUSE project is available here.] Sun Microsystems has stated that a Linux port is being investigated.<ref name=port>{{ cite web | url = http://www.sun.com/emrkt/campaign_docs/expertexchange/knowledge/solaris_zfs_gen.html#10 | title = Fast Track to Solaris 10 Adoption: ZFS Technology | work = Solaris 10 Technical Knowledge Base | publisher = Sun Microsystems | accessdate = 2006-04-24 }}</ref> Development for ZFS on FUSE/Linux now takes place at [http://zfs-fuse.net/ zfs-fuse.net]. |
||
A native port of ZFS for Linux is now [http://github.com/behlendorf/zfs available]. This ZFS on Linux port was produced at the Lawrence Livermore National Laboratory (LLNL) under Contract No. DE-AC52-07NA27344 (Contract 44) between the U.S. Department of Energy (DOE) and Lawrence Livermore National Security, LLC (LLNS) for the operation of LLNL. It has been approved for release under LLNL-CODE-403049. |
|||
⚫ | |||
⚫ | |||
== See also == |
== See also == |
Revision as of 15:33, 6 June 2010
Developer(s) | Sun Microsystems |
---|---|
Full name | ZFS |
Introduced | November 2005 with OpenSolaris |
Structures | |
Directory contents | Extensible hash table |
Limits | |
Max volume size | 16 EiB |
Max file size | 16 EiB (264 bytes) |
Max no. of files | 248 |
Max filename length | 255 bytes |
Features | |
Forks | Yes (called Extended Attributes) |
Attributes | POSIX |
File system permissions | POSIX, NFSv4 ACLs |
Transparent compression | Yes |
Transparent encryption | Yes (currently beta)[1] |
Data deduplication | Yes |
Other | |
Supported operating systems | Solaris, Mac OS X Server 10.5, FreeBSD, Linux via FUSE |
In computing, ZFS is a combined file system and logical volume manager designed by Sun Microsystems. The features of ZFS include support for high storage capacities, integration of the concepts of filesystem and volume management, snapshots and copy-on-write clones, continuous integrity checking and automatic repair, RAID-Z and native NFSv4 ACLs. ZFS is implemented as open-source software, licensed under the Common Development and Distribution License (CDDL). The ZFS name is a trademark of Sun.[2]
History
ZFS was designed and implemented by a team at Sun led by Jeff Bonwick. It was announced on September 14, 2004.[3] Source code for ZFS was integrated into the main trunk of Solaris development on October 31, 2005[4] and released as part of build 27 of OpenSolaris on November 16, 2005. Sun announced that ZFS was included in the 6/06 update to Solaris 10 in June 2006, one year after the opening of the OpenSolaris community.[5]
The name originally stood for "Zettabyte File System". The original name selectors happened to like the name, and a ZFS file system has the ability to store 340 quadrillion zettabytes (256 pebi-zebibytes exactly, or 2128 bytes). Every ZiB is 270 bytes.[6]
Features
Storage pools
Unlike traditional file systems, which reside on single devices and thus require a volume manager to use more than one device, ZFS filesystems are built on top of virtual storage pools called zpools. A zpool is constructed of virtual devices (vdevs), which are themselves constructed of block devices: files, hard drive partitions, or entire drives, with the last being the recommended usage.[7] Thus, a vdev can be viewed as a group of hard drives. This means a zpool consists of one or more groups of drives. Block devices within a vdev may be configured in different ways, depending on needs and space available: 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.[8] In July 2009, triple-parity RAID-Z3 was added to OpenSolaris.[9][10]
In addition, pools can have hot spares to compensate for failing disks. ZFS also supports both read and write caching, for which special devices can be used. Solid State Devices can be used for the L2ARC, or Level 2 ARC, speeding up read operations, while NVRAM buffered SLC memory can be boosted with supercapacitors to implement a fast, non-volatile write cache, improving synchronous writes. Finally, when mirroring, block devices can be grouped according to physical chassis, so that the filesystem can continue in the case of the failure of an entire chassis.
Storage pool composition is not limited to similar devices but can consist of ad-hoc, heterogeneous collections of devices, which ZFS seamlessly pools together, subsequently doling out space to diverse filesystems as needed. Arbitrary storage device types can be added to existing pools to expand their size at any time. [11]
The storage capacity of all vdevs is available to all of the file system instances in the zpool. A quota can be set to limit the amount of space a file system instance can occupy, and a reservation can be set to guarantee that space will be available to a file system instance.
Capacity
ZFS is a 128-bit file system, so it can address 18 quintillion (1.84 × 1019) times more data than current 64-bit systems. The limitations of ZFS are designed to be so large that they would never be encountered, given the known limits of physics (and the number of atoms in the Earth's crust to build such a storage device). Some theoretical limits in ZFS are:
- 264 — Number of snapshots of any file system[12]
- 248 — Number of entries in any individual directory[13]
- 16 EB (264 bytes) — Maximum size of a file system
- 16 EB — Maximum size of a single file
- 16 EB — Maximum size of any attribute
- 256 ZB (278 bytes) — Maximum size of any zpool
- 256 — Number of attributes of a file (actually constrained to 248 for the number of files in a ZFS file system)
- 264 — Number of devices in any zpool
- 264 — Number of zpools in a system
- 264 — Number of file systems in a zpool
Copy-on-write transactional model
ZFS uses a copy-on-write transactional object model. All block pointers within the filesystem contain a 32-bit checksum or 256-bit hash (currently a choice between Fletcher-2, Fletcher-4, or SHA-256)[14] of the target block which is verified when the block is read. Blocks containing active data are never overwritten in place; instead, a new block is allocated, modified data is written to it, then any metadata blocks referencing it are similarly read, reallocated, and written. To reduce the overhead of this process, multiple updates are grouped into transaction groups, and an intent log is used when synchronous write semantics are required. The blocks are arranged in a tree, as are their checksums (see Merkle signature scheme).
Snapshots and clones
An advantage of copy-on-write is that when ZFS writes new data, the blocks containing the old data can be retained, allowing a snapshot version of the file system to be maintained. ZFS snapshots are created very quickly, since all the data composing the snapshot is already stored; they are also space efficient, since any unchanged data is shared among the file system and its snapshots.
Writeable snapshots ("clones") can also be created, resulting in two independent file systems that share a set of blocks. As changes are made to any of the clone file systems, new data blocks are created to reflect those changes, but any unchanged blocks continue to be shared, no matter how many clones exist.
Dynamic striping
Dynamic striping 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.
Variable block sizes
ZFS uses variable-sized blocks of up to 128 kilobytes. The currently available code allows the administrator to tune the maximum block size used as certain workloads do not perform well with large blocks. Automatic tuning to match workload characteristics is contemplated.[citation needed]
If data compression (LZJB) is enabled, variable block sizes are used. If a block can be compressed to fit into a smaller block size, the smaller size is used on the disk to use less storage and improve IO throughput (though at the cost of increased CPU use for the compression and decompression operations).
Lightweight filesystem creation
In ZFS, filesystem manipulation within a storage pool is easier than volume manipulation within a traditional filesystem; the time and effort required to create or resize a ZFS filesystem is closer to that of making a new directory than it is to volume manipulation in some other systems.
Cache management
ZFS also uses the ARC, a new method for cache management, instead of the traditional Solaris virtual memory page cache.
Adaptive endianness
Pools and their associated ZFS file systems can be moved between different platform architectures, including systems implementing different byte orders. The ZFS block pointer format stores filesystem metadata in an endian-adaptive way; individual metadata blocks are written with the native byte order of the system writing the block. When reading, if the stored endianness doesn't match the endianness of the system, the metadata is byte-swapped in memory.
This does not affect the stored data itself; as is usual in POSIX systems, files appear to applications as simple arrays of bytes, so applications creating and reading data remain responsible for doing so in a way independent of the underlying system's endianness.
Deduplication
Deduplication support has been added to the ZFS source repository at the end of October 2009.[15] The OpenSolaris ZFS development packages has been available since December 3 (build 128), and the OpenSolaris release packages will be rolled in the first quarter of 2010.
Additional capabilities
- Explicit I/O priority with deadline scheduling.
- Claimed globally optimal I/O sorting and aggregation.
- Multiple independent prefetch streams with automatic length and stride detection.
- Parallel, constant-time directory operations.
- End-to-end checksumming, using a kind of "Data Integrity Field", allowing data corruption detection (and recovery if you have redundancy in the pool).
- Transparent filesystem compression. Supports LZJB and gzip.[16]
- Intelligent scrubbing and resilvering.[17]
- Load and space usage sharing between disks in the pool.[18]
- Ditto blocks: Configurable data replication per filesystem, with zero, one or two extra copies requested per write for user data, and with that same base number of copies plus one or two for metadata (according to metadata importance).[19] If the pool has several devices, ZFS tries to replicate over different devices. Ditto blocks are primarily an additional protection against corrupted sectors, not against total disk failure.[20]
- ZFS design (copy-on-write + superblocks) is safe when using disks with write cache enabled, if they honor the write barriers. This feature provides safety and a performance boost compared with some other filesystems.
- When entire disks are added to a ZFS pool, ZFS automatically enables their write cache. This is not done when ZFS only manages discrete slices of the disk, since it doesn't know if other slices are managed by non-write-cache safe filesystems, like UFS.
- Per-user and per-group quotas support.[21]
- Planned features:
- Filesystem encryption is due for integration in Q1 2010[1] and is currently not available in production environments under Solaris or OpenSolaris.
- The so-called Block Pointer rewrite functionality is due to be added in the same time frame, paving the way for resizing pools, defragmentation, (re-)applying compression on filesystems and so on.[22]
- Recovery tools will be added for recovering from the loss of a pool.
Limitations
- Capacity expansion is normally achieved by adding groups of disks as a top-level vdev: simple device, RAID-Z, RAID-Z2, RAID-Z3, or mirrored. Newly written data will dynamically start to use all available vdevs. It is also possible to expand the array by iteratively swapping each drive in the array with a bigger drive and waiting for ZFS to heal itself — the heal time will depend on amount of stored information, not the disk size. The new free space will not be available until all the disks have been swapped.
- It is currently not possible to reduce the number of top-level vdevs in a pool nor otherwise reduce pool capacity.[23] This functionality was said to be in development already in 2007[24]. It is not available as of Solaris 10 10/09 (AKA update 8).
- It is not possible to add a disk as a column to a RAID-Z, RAID-Z2, or RAID-Z3 vdev. This feature depends on the block pointer rewrite functionality due to be added soon. You can however create a new RAID-Z vdev and add it to the zpool.
- Vdevs cannot be nested, so a mirror or RAID-Z top-level vdev can only contain files or disks. Mirrors of mirrors (or other combinations) are not allowed.
- Reconfiguring the number of top-level vdev requires copying data offline, destroying the pool, and recreating the pool with the new top-level vdev configuration.
- ZFS is not a native cluster, distributed, or parallel file system and cannot provide concurrent access from multiple hosts as ZFS is a local file system. Sun's Lustre distributed filesystem will adapt ZFS as back-end storage for both data and metadata in version 3.0, which is scheduled to be released in 2010.[25]
- ZFS expects a disk cache flush command to commit cached data to media. Some virtualization software are configured by default to ignore cache flush commands, and some consumer-grade hardware 'lies' about actually executing the command as well. For example, VirtualBox can be, but is not by default configured to properly respect cache flushes (configuration would be using the procedure described in section 11.1.3 Responding to guest IDE flush requests of the Sun VirtualBox User Manual[26]); consumer grade USB disk enclosures are said to be particularly vulnerable to this problem. In the event of an outage or fault this can quite possibly lead to damage to the pool; recovery can be attempted by importing the pool as of few transactions ago (i.e. an older uberblock), losing minutes/seconds of data. Recovery enhancement is expect to be integrated in Q1 2010 (already in the latest development versions of OpenSolaris). A scrub is used to verify the integrity; however, some files may still need to be restored from backups, in the unlikely event they have already been deleted, blocks freed and then overwritten.
- ZFS has no defragmentation utility. Usage of COW with often changed files leads to high fragmentation.
- "Copies" are not the same thing as "replicas" for purposes of data recovery. Therefore, pools of non-replicated vdevs have the resiliency of RAID-0 with none of the performance.[27]
Platforms
ZFS is part of Sun's own Solaris operating system and is thus available on both SPARC and x86-based systems. Since the code for ZFS is open source, a port to other operating systems and platforms can be produced without Sun's involvement.
OpenSolaris
OpenSolaris 2008.05 and 2009.06 use ZFS as their default filesystem. There are a half dozen 3rd party distributions.
FreeBSD
FreeBSD version 8 includes a much-updated implementation of ZFS.[28]. zpool version 13 is supported in 8.0-RELEASE.[28] zpool version 14 support was added to the 8-STABLE branch on 11 January 2010,[29] and will be included in the upcoming FreeBSD 8.1 release.
Pawel Jakub Dawidek ported ZFS to FreeBSD, and it has been part of FreeBSD since version 7.0.[30] 7-stable is on zpool version 13 while 8-stable and the current development branch uses ZFS version 14. Moreover, zfsboot has been implemented in both branches.[31][32] It's fully functional; the only missing features are kernel CIFS server and iSCSI.
GNU/kFreeBSD
GNU/kFreeBSD is a special case, because by virtue of being based on the kernel of FreeBSD, it provides the kernel side of ZFS support (see above). However, the only distribution of this system to the date (Debian GNU/kFreeBSD) doesn't yet provide the userland tools necessary for complete use of this filesystem.[33]
NetBSD
ZFS port was started as a part of the 2007 Google Summer of Code and in August 2009 the code has made it into NetBSD's source tree.[34]
Mac OS X
The first indication of Apple Inc.'s interest in ZFS was an April 2006 post on the opensolaris.org zfs-discuss mailing list where an Apple employee mentioned being interested in porting ZFS to their Mac OS X operating system.[35]
In the release version of Mac OS X 10.5, ZFS was available in read-only mode from the command line, which lacks the possibility to create zpools or write to them.[36] Before the 10.5 release, Apple released the "ZFS Beta Seed v1.1", which allowed read-write access and the creation of zpools,[37] however the installer for the "ZFS Beta Seed v1.1" has been reported to only work on version 10.5.0, and has not been updated for version 10.5.1 and above.[38]
In August 2007, Apple opened a ZFS project on their Mac OS Forge site. On that site, Apple provided the source code and binaries of their port of ZFS which includes read-write access, but there was no installer available[39] until a third-party developer created one.[40]
In October 2009, Apple announced a shutdown of the ZFS project on Mac OS Forge. No explanation was given, just the following statement: "The ZFS project has been discontinued. The mailing list and repository will also be removed shortly." Versions of the previously released source and binaries, as well as the wiki, have been preserved and development has been adopted by a group of enthusiasts.[41][42]
Complete ZFS support was once advertised as a feature of Snow Leopard Server (Mac OS X Server 10.6). However, all references to this feature have been silently removed; it is no longer listed on the Snow Leopard Server features page.[43] Apple has not commented regarding the omission.
Linux
Porting ZFS to Linux is complicated by the fact that the GNU General Public License, which governs the Linux kernel, is incompatible with the Sun CDDL under which ZFS is distributed. A single derived work of both projects cannot be legally distributed, as it is not possible to simultaneously meet both licenses' requirements. To include ZFS in the Linux kernel it would have to be cleanly reimplemented, and patents may hamper this.[44]
The solution to this problem was to port ZFS to Linux's FUSE system so the filesystem runs in userspace instead, where it is not considered a derived work of the kernel. A project to do this was sponsored by Google's Summer of Code program in 2006[45] The original ZFS on FUSE project is available here. Sun Microsystems has stated that a Linux port is being investigated.[46] Development for ZFS on FUSE/Linux now takes place at zfs-fuse.net.
A native port of ZFS for Linux is now available. This ZFS on Linux port was produced at the Lawrence Livermore National Laboratory (LLNL) under Contract No. DE-AC52-07NA27344 (Contract 44) between the U.S. Department of Energy (DOE) and Lawrence Livermore National Security, LLC (LLNS) for the operation of LLNL. It has been approved for release under LLNL-CODE-403049.
Another native port is also being worked on by KQ Infotech [1]. No code has been released yet.
See also
- List of file systems
- Comparison of file systems
- Veritas File System and Veritas Volume Manager — similar to ZFS
- Write Anywhere File Layout — a similar file system by NetApp
- Btrfs — for Linux
- HAMMER
- LFS — BSD Log Structured Filesystem
- NILFS — a Linux filesystem with checksumming (but not scrubbing), also supporting snapshots
- LZJB — data compression algorithm used in ZFS
- Versioning file systems — List of versioning file systems
References
- ^ a b "OpenSolaris.org". Sun Microsystems. Retrieved 2007-10-21.
- ^ "Sun Trademarks - ZFS". Sun Microsystems.
- ^ "ZFS: the last word in file systems". Sun Microsystems. September 14, 2004. Retrieved 2006-04-30.
- ^ Jeff Bonwick (October 31, 2005). "ZFS: The Last Word in Filesystems". Jeff Bonwick's Blog. Retrieved 2006-04-30.
- ^ "Sun Celebrates Successful One-Year Anniversary of OpenSolaris". Sun Microsystems. June 20, 2006.
- ^ "ZFS FAQ at OpenSolaris.org". Sun Microsystems. Retrieved 2009-03-03.
- ^ "Solaris ZFS Administration Guide". Sun Microsystems. Retrieved 2007-10-02.
- ^ "ZFS Best Practices Guide". Solaris Performance Wiki. Retrieved 2007-10-02.
- ^ Leventhal, Adam. "Bug ID: 6854612 triple-parity RAID-Z". Sun Microsystems. Retrieved 2009-07-17.
- ^ Leventhal, Adam (2009-07-16). "6854612 triple-parity RAID-Z". zfs-discuss (Mailing list). Retrieved 2009-07-17.
{{cite mailing list}}
: Unknown parameter|mailinglist=
ignored (|mailing-list=
suggested) (help) - ^ "Solaris ZFS Enables Hybrid Storage Pools—Shatters Economic and Performance Barriers"
- ^ "Solaris ZFS Administration Guide". Sun Microsystems. Retrieved 2007-10-05.
- ^ "Solaris ZFS Administration Guide". Sun Microsystems. Retrieved 2007-10-05.
- ^ "ZFS On-Disk Specification" (PDF). Sun Microsystems, Inc. 2006. See section 2.4.
- ^ ""ZFS Deduplication"".
- ^ "Solaris ZFS Administration Guide". Chapter 6 Managing ZFS File Systems. Retrieved 2009-03-17.
- ^ "Smokin' Mirrors". Jeff Bonwick's Weblog. 2006-05-02. Retrieved 2007-02-23.
- ^ "ZFS Block Allocation". Jeff Bonwick's Weblog. 2006-11-04. Retrieved 2007-02-23.
- ^ "Ditto Blocks - The Amazing Tape Repellent". Flippin' off bits Weblog. 2006-05-12. Retrieved 2007-03-01.
- ^ "Adding new disks and ditto block behaviour". Retrieved 2009-10-19.
- ^ "OpenSolaris.org". Sun Microsystems. Retrieved 2009-05-22.
- ^ Jeff Bonwick Keynote at Kernel Conference Australia 2009
- ^ "Bug ID 4852783: reduce pool capacity". OpenSolaris Project. Retrieved 2009-03-28.
- ^ Goebbels, Mario (2007-04-19). "Permanently removing vdevs from a pool". zfs-discuss (Mailing list).
{{cite mailing list}}
: Unknown parameter|mailinglist=
ignored (|mailing-list=
suggested) (help) - ^ ""Lustre Roadmap"".
- ^ ""Sun VirtualBox User Manual version 3.0.4" (PDF).
- ^ ""The official error message for a vdev going missing, even if it's replaced"".
- ^ a b "FreeBSD 8.0-RELEASE Release Notes". FreeBSD. Retrieved 2009-11-27.
- ^ "FreeBSD 8.0-STABLE Subversion logs". FreeBSD. Retrieved 2010-02-05.
- ^ Dawidek, Pawel (April 6, 2007). "ZFS committed to the FreeBSD base". Retrieved 2007-04-06.
- ^ "Revision 192498". May 20, 2009. Retrieved 2009-05-22.
- ^ "ZFS v13 in 7-STABLE". May 21, 2009. Retrieved 2009-05-22.
- ^ "Debian GNU/kFreeBSD FAQ". March 4, 2010.
- ^ "NetBSD Google Summer of Code projects: ZFS".
- ^ "Porting ZFS to OSX". zfs-discuss. April 27, 2006. Retrieved 2006-04-30.
- ^ "Apple: Leopard offers limited ZFS read-only". MacNN. June 12, 2007. Retrieved 2007-06-23.
- ^ "Apple delivers ZFS Read/Write Developer Preview 1.1 for Leopard". Ars Technica. October 7, 2007. Retrieved 2007-10-07.
- ^ Ché Kristo (November 18, 2007). "ZFS Beta Seed v1.1 will not install on Leopard.1 (10.5.1) « ideas are free". Retrieved 2007-12-30.
- ^ http://zfs.macosforge.org
- ^ http://alblue.blogspot.com/2008/11/zfs-119-on-mac-os-x.html
- ^ http://code.google.com/p/maczfs/
- ^ http://groups.google.com/group/zfs-macos/?pli=1
- ^ "Snow Leopard". June 9, 2009. Retrieved 2008-06-10.
- ^ Jeremy Andrews (April 19, 2007). "Linux: ZFS, Licenses and Patents". Retrieved 2007-04-21.
- ^ Ricardo Correia (March 16, 2009). "ZFS on FUSE/Linux". Retrieved 2009-03-16.
- ^ "Fast Track to Solaris 10 Adoption: ZFS Technology". Solaris 10 Technical Knowledge Base. Sun Microsystems. Retrieved 2006-04-24.
Bibliography
- Watanabe, Scott (November 23, 2009), Solaris ZFS Essentials (1st ed.), Prentice Hall, p. 256, ISBN 0137000103