6.5. SSD Optimization
mkfs.btrfsturns off metadata duplication on a single device when
/sys/block/device/queue/rotationalis zero for the single specified device. This is equivalent to specifying
-m singleon the command line. It can be overridden and duplicate metadata forced by providing the
-m dupoption. Duplication is not required due to SSD firmware potentially losing both copies. This wastes space and is a performance cost.
ssdoption does several things:
- It allows larger metadata cluster allocation.
- It allocates data more sequentially where possible.
- It disables btree leaf rewriting to match key and block order.
- It commits log fragments without batching multiple processes.
ssdmount option only enables the ssd option. Use the
nossdoption to disable it.
mount -o ssdwill find groupings of blocks where there are several free blocks that might have allocated blocks mixed in. The command
mount -o ssd_spreadensures there are no allocated blocks mixed in. This improves performance on lower end SSDs.
ssd_spreadoption enables both the
ssd_spreadoptions. Use the
nossdto disable both these options.
ssd_spreadoption is never automatically set if none of the ssd options are provided and any of the devices are non-rotational.