1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

tests: add check for lvconvert without zeroing

Check lvconvert -Zn does not zero thin-pool metadata.
Also check --type zero is usable for thin-pool data.
This commit is contained in:
Zdenek Kabelac 2021-03-18 18:19:16 +01:00
parent c06325263f
commit accf324ccb

View File

@ -77,4 +77,22 @@ dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/mapper/$POOL 0"
fsck -n "$DM_DEV_DIR/mapper/$THIN"
clean_thin_
lvchange -an $vg
# Take a copy of metadata
lvchange -y -ay $vg/pool_tmeta
lvcreate -L2 -n $lv1 $vg
dd if="$DM_DEV_DIR/$vg/pool_tmeta" of="$DM_DEV_DIR/$vg/$lv1" bs=1M count=1
# Use zero backend for data device
lvcreate --type zero -L2 -n $lv2 $vg
lvconvert --thinpool $vg/$lv2 --poolmetadata $vg/$lv1 -Zn -y
# Metadata should NOT be zeroed and device should be available
dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/$vg/$lv2 0"
# exit calls cleanup_mounted_and_teardown