document how to extract thin pool metadata

This commit is contained in:
Thanos Makatos 2016-03-04 18:18:29 +03:00
parent c8276a41f7
commit eac05c1b5d

View File

@ -130,3 +130,35 @@ Once you've done this you can run the tests with a simple:
Or specific tests with:
cucumber features/thin_restore -n 'print help'
Dump Metadata
=============
To dump the metadata of a live thin pool, you must first create a snapshot of
the metadata:
$ dmsetup message vg001-mythinpool-tpool 0 reserve_metadata_snap
Then, extract the held root from the device mapper's status of the thin pool
(7th field). This value must be passed to ```thin_dump```.
$ sudo dmsetup status vg001-mythinpool-tpool
0 8192 thin-pool 2 11/1024 1/64 10 rw discard_passdown
^
Extract the metadata:
$ sudo bin/thin_dump -m10 /dev/mapper/vg001-mythinpool_tmeta
<superblock uuid="" time="1" transaction="2" data_block_size="128"nr_data_blocks="0">
<device dev_id="1" mapped_blocks="1" transaction="0" creation_time="0" snap_time="1">
<single_mapping origin_block="0" data_block="0" time="0"/>
</device>
<device dev_id="2" mapped_blocks="1" transaction="1" creation_time="1" snap_time="1">
<single_mapping origin_block="0" data_block="0" time="0"/>
</device>
</superblock>
Finally, release the root:
$ dmsetup message vg001-mythinpool-tpool 0 release_metadata_snap