Tuesday, May 7, 2013
ZFS file system
ZFS
The features of ZFS include protection against data corruption, support for high storage capacities, integration of the concepts of file-system, and volume management, snapshots and copy-on-write clones, continuous integrity checking and automatic repair.
One major feature that distinguishes ZFS from other file systems is that ZFS is designed from the ground up with a focus on data integrity.
It is done this by keeping checksum of each block. And stored the value in pointer block not the block is self. Even a checksum of pointer block also stored, this continues till the root node.
First it calculate checksum of data/metadata and compare, if its matched then it will be pass to the programing stack which the process is asking for it.
When the checksum is mismatched it use zfs mirroring or RAID data to heal the data. This way it make sure the data integrity
Even with single disk you can have pool by specifying "copies=2" means two copies of data.
Repair
There is no tool similar to fsck in zfs. Which is available on Linux. Which does file system validation and system repair.
But it has tool called scrub which is fix some silent corruption and other problems.
But it check not only metadata like fsck it check data itself, so fsck on bigger diak can be completed in few minutes while scrub will take hours. Eventhough fsck return completed still the data may be corrupted.
And unlike fsck scrub doesn't need file system to be unmounted while running the file system check.
Sun microsystem recommend to run scrub on once in a month for enterprise disks(cause they provide higher reliability) and for cheap commodity disks once in week.
Snapshot
Heavy price is paid during data writes. So the snapshot are very fast. This is due to zfs use copy on write transactional object model. zfs has feature where we can track back to old data. This is base on copy on write method. It always use empty blocks to write, so the old data is always preserved.
zpool command has -F option where user can discard latest changes and go back to previous functional state. This is how the snaphost also worked. Since data are already there creation of snapshot is very fast.
Writable snapshots or clones also available. Still it uses copy on write transactional model when sharing the same set of blocks on different file system.
Limits
zfs 128 bit file system. It was design that the limitations are so high and will not encountered.
248 — Number of entries in any individual directory[52]
16 exabytes (264 bytes) — Maximum size of a single file
16 exabytes — Maximum size of any attribute
256 zettabytes (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
filling a 128-bit file system would require more energy than that needed to boil all the oceans on planet Earth
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment