1 #Device Mapper Mirror Target
11 - DM: Device Mapper (see: http://sources.redhat.com/dm/)
12 - Volume: a DM's idea of the whole or the a part of a disk's storage area
16 1. The Mirror target should implement RAID 1.
17 2. Two or more volumes should be able to used within the mirror.
18 3. Removal of all but one volume should still produce a working volume.
19 4. Online removal of any volumes should keep the mirror working, given that there is still a working volume present.
20 5. Failure to any of the disks holding any of the volumes should not lead to data loss or corruption, given that one or more disks holding at least one of the mirrored volumes are still present and healthy.
21 6. The Mirror target's interface should be integrated with LVM Tools.
22 7. Any meta data stored on disk should be kept consistent across any possible unclean shutdown.
24 ##The Write Intent Bitmap
28 Chunk status is stored in a bitmap data structure. Every chunk has 1 byte of information
29 in the bitmap, a typical chunk size would be 1MB. This way the bitmap is easily addressable.
30 the 2 lower bit of the byte will be used initially for the status. The status could be CLEAN, DIRTY.
31 We can also store a MODIFIED flag, which means that there was a write to that chunk when the
32 volume was out of sync (for faster recovery).
36 [[header: WIBM][size][primary/secondary][serial][crc32]]
40 - validate signature (TODO Maybe only on first read?)
42 - if any crc is invalid -> use the other (TODO, what if serial is different?)
43 - if both crc is invalid -> trouble! full resync
44 - if both valid: continue
47 - if one of the copies is outdated, use the other
48 - if match we have a valid bitmap
51 - modify bitmap in memory (bump serial, 1 if overflow)
52 - write first copy, mark as primary
53 - flushing would be a good idea here! [1]
54 - write second copy, mark as secondary
55 - flushing would be a good idea here! [1]
59 [1] does it kill performance?