Ext4 file system: Delayed allocation, dirty data blocks

Photo by Mr Cup / Fabien Barral on Unsplash

Delayed Allocation

The delayed allocation feature is enabled by default. That’s why the data may not be committed to the disk immediately when you try to write or modify a data block.

What are the dirty data blocks?

Data blocks that have not been committed to disk are called “dirty data blocks”.

  1. data=journal (delayed allocation not supported)
  2. data=writeback

How can I see the size and number of dirty blocks?

How often dirty blocks are getting flushed to the disk?

It depends on several system parameters: dirty_background_ratio, dirty_ratio, dirty_expire_centisecs, dirty_writeback_centisecs. (see each parameter’s description here)

What is fs-verity?

fs-verity is something supported by ext4 and I really like it. Let’s say you are running a SIEM application and you want to sign the log files and make log files read-only. fs-verity may help you in this scenario.

mkfs.ext4 -O verity /dev/sdb



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store