====== ZFS - Structure - Blocks ====== In a ZFS pool, all data, including metadata, is stored in blocks. * The maximum size of a block is defined for each dataset in the **recordsize** property. * Recordsize is mutable, but changing recordsize will not change the size or layout of any blocks which have already been written to the dataset. Only for new blocks as they are written. * Any given block references data from only one file. * You cannot cram two separate files into the same block. * Each file will be composed of one or more blocks, depending on size. * If a file is smaller than Recordsize, it will be stored in an undersized block. * For example, a block holding a 2KiB file will only occupy a single 4KiB sector on disk. * If a file is large enough to require multiple blocks, all records containing that file will be Recordsize in length, including the last record, which may be mostly slack space. * Zvols do not have the Recordsize property. * Instead, they have volblocksize, which is roughly equivalent. ---- ===== Recordsize ===== The current default recordsize is 128KiB. * This represents a sort of uneasy compromise in which performance will not be ideal for much of anything, but will be awful for much of anything either. * Recordsize may be set to any value from 4K through 1M. * Recordsize may be set even larger with additional tuning and sufficient determination, but that is rarely a good idea.