Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
thin_repair is capable of rebuilding the thin-pool superblock if it broke. However, it doesn't work if the thin-pool has one or more empty devices. None of the devices could be recovered in this situation.
Version-Release number of selected component (if applicable):
v0.9.0-el8
Steps to Reproduce:
1. Create a thin metadata with one empty device, using thin_restore:
```shell
# dd if=/dev/zero of=src.bin bs=1M count=4
# thin_restore -i src.xml -o src.bin
```
src.xml is listed below:
```xml
<superblock uuid="" time="0" transaction="1" flags="0" version="2" data_block_size="128" nr_data_blocks="1024">
<device dev_id="1" mapped_blocks="16" transaction="0" creation_time="0" snap_time="0">
<range_mapping origin_begin="0" data_begin="0" length="16" time="1"/>
</device>
<device dev_id="2" mapped_blocks="0" transaction="0" creation_time="0" snap_time="0">
</device>
</superblock>
```
2. Wipe the superblock
```shell
# dd if=/dev/zero of=src.bin bs=4K count=1 conv=notrunc
```
3. Try repairing the broken metadata, using 'thin_dump --repair' or thin_repair
```shell
# thin_dump --repair --transaction-id 1 --data-block-size 128 --nr-data-blocks 1024 src.bin
```
Actual results:
None of the devices are recovered
```xml
<superblock uuid="" time="100000" transaction="1" flags="0" version="2" data_block_size="128" nr_data_blocks="1024">
</superblock>
```
Expected results:
The output should be identical to the `src.xml`
Having an unwritten, empty thin-volume might not be a common case. However, the patch could avoid potential issues, and reduce the effort of customer support.
Patch has been upstreamed. The link below is the backport. Two new test cases were added accordingly.
https://github.com/mingnus/thin-provisioning-tools/commit/d3f796f5e35162b0867ee2ba8de781f14ad35c61
# autoconf
# ./configure --enable-testing
# make functional-test
thin-dump
...
repair-superblock
...
with-empty-devices ..................................... pass
thin-repair
...
superblock
...
with-empty-devices ..................................... pass
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (device-mapper-persistent-data bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2022:2033
thin_repair is capable of rebuilding the thin-pool superblock if it broke. However, it doesn't work if the thin-pool has one or more empty devices. None of the devices could be recovered in this situation. Version-Release number of selected component (if applicable): v0.9.0-el8 Steps to Reproduce: 1. Create a thin metadata with one empty device, using thin_restore: ```shell # dd if=/dev/zero of=src.bin bs=1M count=4 # thin_restore -i src.xml -o src.bin ``` src.xml is listed below: ```xml <superblock uuid="" time="0" transaction="1" flags="0" version="2" data_block_size="128" nr_data_blocks="1024"> <device dev_id="1" mapped_blocks="16" transaction="0" creation_time="0" snap_time="0"> <range_mapping origin_begin="0" data_begin="0" length="16" time="1"/> </device> <device dev_id="2" mapped_blocks="0" transaction="0" creation_time="0" snap_time="0"> </device> </superblock> ``` 2. Wipe the superblock ```shell # dd if=/dev/zero of=src.bin bs=4K count=1 conv=notrunc ``` 3. Try repairing the broken metadata, using 'thin_dump --repair' or thin_repair ```shell # thin_dump --repair --transaction-id 1 --data-block-size 128 --nr-data-blocks 1024 src.bin ``` Actual results: None of the devices are recovered ```xml <superblock uuid="" time="100000" transaction="1" flags="0" version="2" data_block_size="128" nr_data_blocks="1024"> </superblock> ``` Expected results: The output should be identical to the `src.xml`