mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-04 09:18:36 +03:00
writecache: prompt before using an LV to hold cache
This commit is contained in:
parent
89c61f2018
commit
938b6b8253
@ -48,7 +48,7 @@ cp pattern1 $mount_dir/pattern1
|
|||||||
umount $mount_dir
|
umount $mount_dir
|
||||||
lvchange -an $vg/$lv1
|
lvchange -an $vg/$lv1
|
||||||
|
|
||||||
lvconvert --type writecache --cachepool $lv2 $vg/$lv1
|
lvconvert --yes --type writecache --cachepool $lv2 $vg/$lv1
|
||||||
|
|
||||||
check lv_field $vg/$lv1 segtype writecache
|
check lv_field $vg/$lv1 segtype writecache
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ lvchange -an $vg/$lv2
|
|||||||
|
|
||||||
# test2: create fs on LV after writecache is attached
|
# test2: create fs on LV after writecache is attached
|
||||||
|
|
||||||
lvconvert --type writecache --cachepool $lv2 $vg/$lv1
|
lvconvert --yes --type writecache --cachepool $lv2 $vg/$lv1
|
||||||
|
|
||||||
check lv_field $vg/$lv1 segtype writecache
|
check lv_field $vg/$lv1 segtype writecache
|
||||||
|
|
||||||
|
@ -5498,6 +5498,12 @@ static int _lvconvert_writecache_attach_single(struct cmd_context *cmd,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!arg_is_set(cmd, yes_ARG) &&
|
||||||
|
yes_no_prompt("Erase all existing data on %s? [y/n]: ", display_lvname(lv_fast)) == 'n') {
|
||||||
|
log_error("Conversion aborted.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Ensure the two LVs are not active elsewhere. */
|
/* Ensure the two LVs are not active elsewhere. */
|
||||||
if (!lockd_lv(cmd, lv, "ex", 0))
|
if (!lockd_lv(cmd, lv, "ex", 0))
|
||||||
goto_bad;
|
goto_bad;
|
||||||
|
Loading…
Reference in New Issue
Block a user