1

Just as in the title. I was unable to find reliable information about dirty blocks in software RAID, but I heard this term many times.

Is it bad to have many dirty blocks? How to check the amount of dirty blocks? Why are they appearing/being created in the system?

3 Answers 3

2

You are probably conflating two different concepts:

  • dirty pages are the modified memory pages which have to be written to stable storage. For example, when you write something under linux (ie: cp /etc/services /etc/testfile) you do not immediately hit the physical disks; rather, the linux pagecache keep track of which memory areas were dirtied and writes out them later;

  • dirty blocks are the blocks that a mirror leg need to resync from its peer (ie: the other mirror leg). In modern RAID1/mirroring implementation, when a disk temporarily fails out of the array but it is then re-added, it often does not need to completely resync from the other disk; rather, a dirty block tracking mechanism exists to allow selective re-sync of changed areas only.

1

Ok, so I can answer myself using this link: https://www.thomas-krenn.com/en/wiki/Linux_Page_Cache_Basics

it turns out that I probably meant dirty pages, not dirty blocks, it seems like it is called "pages". And dirty pages occur in in linux page cache. When linux cache something in unused RAM and it is not yet written to the disk, then those pages are dirty (because they have not been saved to a disk yet, only to RAM cache, to make saving faster). You can check dirty pages by using at /proc/meminfo | grep Dirty and flush them (save from RAM to disk) for example by executing sync.

1

Learner, I'd say that shodanshok's second answer is probably what is actually correct for you, since you said, "in the context of RAID."

"Dirty pages" is purely a virtual-memory concept meaning an in-memory page that needs to be written out to backing store. This has nothing to do with RAID.

Whereas, "dirty blocks" have everything to do with RAID. These are blocks which right now are not yet identical on all of the devices in the array.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .