[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]

/bsd/ - *BSD Discussion

Best thing to come from UC-Berkeley since LSD

Catalog

8chan Bitcoin address: 1NpQaXqmCBji6gfX8UgaQEmEstvVY7U32C
The next generation of Infinity is here (discussion) (contribute)
Google blocks 8ch.net with obscure message.
If you know any community sites of similar size to 8chan blocked with this message, please email their URLs to admin@8chan.co. I feel like we've a glitch in the matrix.
Name
Email
Subject
Comment *
File
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Oekaki
Show oekaki applet
(replaces files and can be used instead)
Options
Password (For file and post deletion.)

Allowed file types:jpg, jpeg, gif, png, webm, mp4
Max filesize is 8 MB.
Max image dimensions are 10000 x 10000.
You may upload 5 per post.


File: 1428261899266.jpg (14.59 KB, 400x320, 5:4, zfs_logo.jpg)

da9c6e No.5

Filesystem Thread

This thread discusses filesystems, this post specifically the ZFS filesystem. ZFS is supported by FreeBSD.

Note: If you have something against ZFS, you might like HAMMER. That is the default fs in DragonflyBSD.

Introduction to ZFS
ZFS was designed by Sun Microsystems as a need for databases. Databases were growing too large for filesystems of the time, and the filesystems weren't matching up to the technology of the time. Performance and data was suffering because of the lack of a 'future' filesystem.

ZFS is now owned by the Oracle Corporation, comparable to a trademark. The OpenZFS project aims to open-source the ZFS filesystem. OpenZFS is released under the CDDL license, and therefore is technically incompatible with the GPL; similar to how Firefox is not used on Debian, instead Iceweasel is used.

ZFS Features
ZFS has a number of features which make it better for servers (and even desktops) over traditional filesystems like UFS, NTFS, or ext*.

1. Data Integrity
ZFS has protection against silent data corruption. This includes bit rot, electrical inconsistencies, and other general physical disk errors.

Each block written to the ZFS system has a corresponding checksum. Eventually, when the block is read, it will check to see if it matches the checksum.

If it doesn't, then a hard drive error has occurred. If the filesystem is in a RAIDZ volume, then the volume will perform a self-healing operation which will fix the disk error using the other drives.

If the checksum doesn't match and there is no additional disk to pull correct data from, then the corrupted data will be sent to the application with the hope that the corrupted data is still usable.

2. Software RAID
ZFS allows for software RAID. RAID allows multiple disks to be treated as a single 'disk,' which (depending on the setup) will allow for more I/O performance and (possibly) more storage. However, RAID is usually used for redundancy; that is, a RAID volume is designed to allow for complete disk failures.

ZFS calls their software raid RAIDZ-1 (RAID5; 1 disk failure allowed), RAIDZ-2 (RAID6; 2 disk failures allowed), and RAIDZ-3 (3 disk failures allowed.) ZFS also supports disk mirroring and striping.

RAIDZ is special compared to normal RAID because of the support behind it. Most RAID implementations are either completely proprietary or weakly supported.

Additionally, the RAIDZ uses tools like scrub, which allows for data integrity checking while the filesystem is active. This is different from fscking, which only checks the metadata (headers), not the actual data. If a disk is lost and then replaced, the dataless disk can be filled with data by a process called resilvering.

3. ARC, L2ARC, & ZIL Caching
ZFS supports three forms of data caching; Adaptive Replacement Cache (ARC), Level 2 ARC, and ZFS intent log (ZIL.)

ARC is a memory cache for the disk. Data is stored in two different memory buffers; one buffer stores commonly used files, the other stores recently used files. The memory used is the memory which hasn't been allocated to any programs. This cache is used for both reading and writing. Therefore, if the entire file is inside of memory, then the 'disk performance' will be the speed of the memory! Additionally, if a file is read and then written to, then the write will be performed in memory before it is performed to the disk.

Therefore, adding more memory to the system means more disk pool I/O. Please note: On FreeBSD, ARC is disabled if you have less than 4gb RAM. You can enable it if you desire.

ARC is very clever and efficient, and over time will reduce total disk wear!

L2ARC is a read-only version of ARC which uses faster hard drives ('cache disks') than the data drives. The cache disks are almost always SSDs (uncommonly 10-15K SAS drives.) L2ARC follows the exact same principles as ARC, however the storage mediums are different, and L2ARC is read only.

When the data requested from the pool is not found in ARC ('cache miss'), the file system will search for the data in L2ARC. If the level-2 cache is missed, then the data will be pulled from the data disks.

ZIL is a write-only level-two cache. It is not used as often as L2ARC, but in some cases you may benefit. For example, write heavy databases/logs which often exceed the max disk I/O will benefit.

4. Data Compression
ZFS has a feature called data compression. You might think this is 'slow,' but it's actually rather smart and even increases I/O performance (if using LZ4 at least.)

When data is being written to the disk, the file system will attempt to compress the data. If the data compression ratio is less than 12.5%, then the data will not be encrypted! Therefore, compression is only used where real benefits can be gained!

Similarly, when data is read, the data will be decompressed. Because the decompressed data is larger than the compressed data, the virtual performance of the pool increases! Thus, compression in this case not only decreases overall file sizes, but also increases I/O performance.

5. Deduplication
Deduplication is where the ZFS volume will find duplicated blocks/files and then seamlessly deletes one of the duplicates, while maintaining overall data. It is not enabled by default, because the vast majority of users do not need it or would not benefit. For example, a user at home would not benefit much from it; whereas, a image uploading service could benefit because of people uploading the same image repeatedly. Deduplication is often considered a serious performance hit unless a large amount of ARC/L2ARC is present. You can toy with this and see if you would benefit, however. You would benefit most when storage space is more valuable than performance.

6. Snapshots ('Smart Backups')
ZFS supports backups called 'snapshots.' It is a space-efficient deduplicating backup scheme.

For example, if you do a backup in January for your entire /home/ directory, everything will be stored. When you do another backup in February, only new files and modified files will be saved. Therefore, the February backup will only backup what is required, and will require less space than January and February combined.

7. Disk Encryption
ZFS supports disk encryption seamlessly ontop of the above features. This means that disk encryption will work with the above features.

Incomplete?
This list contains the most notable ZFS features, however more may be added at a later date.
Post last edited at

da9c6e No.18

No interest in filesystems anyone?

cce39b No.19

alright i am building a nas box, but i plan to spend on cheap hardware, so ecc motherboard is out of the question.

how much risk am i taking using non ecc motherboard for zfs?

*note i rarely restart my nasbox.

http://louwrentius.com/please-use-zfs-with-ecc-memory.html


a3c6fc No.24

Very interesting, thanks!


7be38a No.96

>>19

From the mouth of one of the zfs founders:

There's nothing special about ZFS that requires/encourages the use of ECC RAM more so than any other filesystem. If you use UFS, EXT, NTFS, btrfs, etc without ECC RAM, you are just as much at risk as if you used ZFS without ECC RAM. Actually, ZFS can mitigate this risk to some degree if you enable the unsupported ZFS_DEBUG_MODIFY flag (zfs_flags=0x10). This will checksum the data while at rest in memory, and verify it before writing to disk, thus reducing the window of vulnerability from a memory error.

http://arstechnica.com/civis/viewtopic.php?f=2&t=1235679&p=26303271#p26303271


9d566a No.100

>>96

Very nice information Anon. I did not know about the ZFS_DEBUG_MODIFY flag. I will have to keep that in mind!


7be38a No.127

That L2ARC, seems like the best for deduplication, am I wrong?

I keep on wanting to shill for HAMMERFS but deduplication plus zfs scrub for bitrot really makes me think ZFS is king.


2a00c5 No.129

>>127

ZFS doesn't do encryption




[Return][Go to top][Catalog][Post a Reply]
Delete Post [ ]
[]
[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]