main - vdo: fixes
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1ae157a0f67e984ef3037d19d62b84a3b0201c84 Commit: 1ae157a0f67e984ef3037d19d62b84a3b0201c84 Parent: 419c93c87358ad311aa78dcd6fd8298325356df4 Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Aug 31 20:52:26 2021 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Aug 31 22:05:47 2021 +0200
vdo: fixes
Better identify VDO device with major:minor.
Handle different LV name from originally converted origin LV. Improve --dry-run handling.
--- WHATS_NEW | 4 +++ scripts/lvm_import_vdo.sh | 70 +++++++++++++++++++++++++++++++++++------------ test/shell/vdo-convert.sh | 28 ++++++++++++++----- 3 files changed, 78 insertions(+), 24 deletions(-)
WHATS_NEW +4 -0
@@ -1,5 +1,9 @@ Version 2.03.14 - ================================== + Improve lvm_import_vdo script. + Support VDO LV with lvcreate -ky. + Fix lvconvert for VDO LV bigger then 2T. + Create VDO LVs automatically without zeroing. Rename vdoimport to lvm_import_vdo. Version 2.03.13 - 11th August 2021
scripts/lvm_import_vdo.sh +53 -17
154 lines not on this page · raw message
test/shell/vdo-convert.sh +21 -7
@@ -61,22 +61,36 @@ lvm_import_vdo --dry-run -y -v --name $lv1 "$DM_DEV_DIR/$vg/$lv1" lvm_import_vdo -y --name $lv1 "$DM_DEV_DIR/$vg/$lv1" -# ATM needed - since we do not call 'vdo convert' in this case -vdo remove $VDOCONF --force --name "$VDONAME" || true +# ensure VDO device is not left in config file +vdo remove $VDOCONF --force --name "$VDONAME" 2>/dev/null || true + +lvremove -f $vg + + +# Test user can specify different VDO LV name (so the original LV is renamed) +lvcreate -y -L5G -n $lv1 $vg + +vdo create $VDOCONF --name "$VDONAME" --device="$DM_DEV_DIR/$vg/$lv1" --vdoLogicalSize=10G + +lvm_import_vdo -y --name $vg/$lv2 "$DM_DEV_DIR/$vg/$lv1" + +check lv_exists $vg $lv2 +check lv_not_exists $vg $lv1 vgremove -f $vg +# ensure VDO device is not left in config file +vdo remove $VDOCONF --force --name "$VDONAME" 2>/dev/null || true + aux wipefs_a "$dev1" # prepare 'unused' $vg2 vgcreate $vg2 "$dev2" # -# Check conversion of VDO volume on non-LV device +# Check conversion of VDO volume on non-LV device and with >2T size # -vdo create $VDOCONF --name "$VDONAME" --device="$dev1" --vdoLogicalSize=31G - -mkfs -E nodiscard "$DM_DEV_DIR/mapper/$VDONAME" +vdo create $VDOCONF --name "$VDONAME" --device="$dev1" --vdoLogicalSize=3T # Fail with an already existing volume group $vg2 not lvm_import_vdo --dry-run -y -v --name $vg2/$lv1 "$dev1" |& tee err
@@ -87,7 +101,7 @@ vdo stop $VDOCONF --name "$VDONAME" lvm_import_vdo -y -v --name $vg/$lv1 "$dev1" -fsck -n "$DM_DEV_DIR/$vg/$lv1" +check lv_field $vg/$lv1 size "3.00t" vgremove -f $vg