From eac05c1b5d8d698ef9945c018eb9cb89ee236c29 Mon Sep 17 00:00:00 2001 From: Thanos Makatos Date: Fri, 4 Mar 2016 18:18:29 +0300 Subject: [PATCH 1/2] document how to extract thin pool metadata --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index d23dae5..ce83bd7 100644 --- a/README.md +++ b/README.md @@ -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 + + + + + + + + + +Finally, release the root: + + $ dmsetup message vg001-mythinpool-tpool 0 release_metadata_snap From f162d59bf6da9a3e930f8498e6b41c6029be1920 Mon Sep 17 00:00:00 2001 From: Thanos Makatos Date: Fri, 4 Mar 2016 18:30:02 +0300 Subject: [PATCH 2/2] no need to supply held root, thin_dump -m will look it up --- README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index ce83bd7..005ae50 100644 --- a/README.md +++ b/README.md @@ -140,16 +140,9 @@ 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 + $ sudo bin/thin_dump -m /dev/mapper/vg001-mythinpool_tmeta