I have a Ubuntu 8.10 software RAID5 setup that uses 4 active disks and 1 spare. The spare disk has three partitions, one of which is devoted to the spare function. I am using a second partition on the spare disk to be a home to the write-intent bitmap file specified with the --bitmap option in the mdadm command line. Whenever I do a mdadm --detail -v /dev/md2 after reboot, it fails to show the Intent Bitmap. I have to manually do an mdadm command to get the Intent Bitmap going again.

My chief concern is that a disk will fail, perhaps under the stress of a power outage, and then, when the machine reboots, it will start resyncing to the spare, but without taking notice of the Intent Bitmap. Can mdadm (or mdadm.conf, or any other config file) be used to instruct mdadm or Ubuntu to set up the write-intent bitmap on reboot? Will that help to allow a rapid transition from an inconsistent state to a consistent & clean state?

For the uninitiated: the write-intent bitmap is a small file that tracks the intended write that will be placed on RAID, so that if the write does not complete to all disks, the processor has only to look to those sectors/tracks where the write was incomplete in order to assure consistency among the disks. Without that file, all tracks are treated as suspect, and a data-intensive operation that takes (what hours, days?) begins to bring everything consistent.


You probably just need to set it in the configuration file:

The option specifies a file in which a write-intent bitmap  should  be  found.
When  assembling  the array,  mdadm  will provide this file to the md driver
as the bitmap file.  This has the same function as the --bitmap-file option
to --assemble.

It should be noted that enabling the bitmaps will cause a large performance hit.

Add a bitmap with the following command: mdadm /dev/mdX -Gb internal

Where X is the number that represents your array.


  • 1
    The performance hit is different with an external bitmap versus an internal one. Since the original poster explicitly says he is using an external bitmap, this really doesn't apply. Also, it doesn't address their question. Dec 28 '09 at 21:47
  • Just to mention: I use internal write-intent bit-map with rather huge chunks, so performance penalty is neglectful whilst it speeds up re-sync significantly anyway.
    – poige
    Apr 20 '11 at 2:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.