4 dm-era is a target that behaves similar to the linear target. In
5 addition it keeps track of which blocks were written within a user
6 defined period of time called an 'era'. Each era target instance
7 maintains the current era as a monotonically increasing 32-bit
10 Use cases include tracking changed blocks for backup software, and
11 partially invalidating the contents of a cache to restore cache
12 coherency after rolling back a vendor snapshot.
17 era <metadata dev> <origin dev> <block size>
19 metadata dev : fast device holding the persistent metadata
20 origin dev : device holding data blocks that may change
21 block size : block size of origin data device, granularity that is
27 None of the dm messages take any arguments.
32 Possibly move to a new era. You shouldn't assume the era has
33 incremented. After sending this message, you should check the
34 current era via the status line.
39 Create a clone of the metadata, to allow a userland process to read it.
44 Drop the metadata snapshot.
49 <metadata block size> <#used metadata blocks>/<#total metadata blocks>
50 <current era> <held metadata root | '-'>
52 metadata block size : Fixed block size for each metadata block in
54 #used metadata blocks : Number of metadata blocks used
55 #total metadata blocks : Total number of metadata blocks
56 current era : The current era
57 held metadata root : The location, in blocks, of the metadata root
58 that has been 'held' for userspace read
59 access. '-' indicates there is no held root
64 The scenario of invalidating a cache when rolling back a vendor
65 snapshot was the primary use case when developing this target:
67 Taking a vendor snapshot
68 ------------------------
70 - Send a checkpoint message to the era target
71 - Make a note of the current era in its status line
72 - Take vendor snapshot (the era and snapshot should be forever
75 Rolling back to an vendor snapshot
76 ----------------------------------
78 - Cache enters passthrough mode (see: dm-cache's docs in cache.txt)
79 - Rollback vendor storage
80 - Take metadata snapshot
81 - Ascertain which blocks have been written since the snapshot was taken
82 by checking each block's era
83 - Invalidate those blocks in the caching software
84 - Cache returns to writeback/writethrough mode
89 The target uses a bitset to record writes in the current era. It also
90 has a spare bitset ready for switching over to a new era. Other than
91 that it uses a few 4k blocks for updating metadata.
93 (4 * nr_blocks) bytes + buffers
98 Metadata is updated on disk before a write to a previously unwritten
99 block is performed. As such dm-era should not be effected by a hard
100 crash such as power failure.
105 Userland tools are found in the increasingly poorly named
106 thin-provisioning-tools project:
108 https://github.com/jthornber/thin-provisioning-tools