RAID-Z is not actually a kind of RAID, but a higher-level software solution that implements an integrated redundancy scheme similar to RAID 5, using ZFS. RAID-Z avoids the RAID 5 “write hole” using copy-on-write: rather than overwriting data, it writes to a new location and then automatically overwrites the pointer to the old data. It avoids the need for read-modify-write operations for small writes by only ever performing full-stripe writes. Small blocks are mirrored instead of parity protected, which is possible because the file system is aware of the underlying storage structure and can allocate extra space if necessary. RAID-Z2 doubles the parity structure to achieve results similar to RAID 6: the ability to sustain up to two drive failures without losing data.