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

lvremove: remove thin volumes on damaged pools

Support remove of thin volumes With --force --force
when thin pools is damaged.

This way it's possible to remove thin pool with
unrepairable metadata without requiring to
manually edit lvm2 metadata.

lvremove -ff vg/pool

removes all thin volumes and pool even when
thin pool cannot be activated (to accept
removal of thin volumes in kernel metadata)
This commit is contained in:
Zdenek Kabelac 2014-07-02 00:13:32 +02:00
parent 0b872ce870
commit 93a80018ae
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.108 -
=================================
Support lvremove -ff to remove thin volumes from broken thin pools.
Require --yes to skip raid repair prompt.
Change makefile %.d generation to handle filename changes without make clean.
Fix use of buildir in make pofile.

View File

@ -4923,8 +4923,13 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
/* Clear thin pool stacked messages */
if (pool_lv && !pool_has_message(first_seg(pool_lv), lv, 0) &&
!update_pool_lv(pool_lv, 1)) {
log_error("Failed to update thin pool %s.", pool_lv->name);
return 0;
if (force < DONT_PROMPT_OVERRIDE) {
log_error("Failed to update thin pool %s.", pool_lv->name);
return 0;
}
log_warn("WARNING: Forced to ignoring failure of pool metadata update %s.",
pool_lv->name);
pool_lv = NULL; /* Do not retry */
}
visible = lv_is_visible(lv);