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

pvmove/RAID: Disallow pvmove on RAID LVs until properly handled

Attempting pvmove on RAID LVs replaces the kernel RAID target with
a temporary pvmove target, ultimately destroying the RAID LV.  pvmove
must be prevented on RAID LVs for now.

Use 'lvconvert --replace old_pv vg/lv new_pv' if you want to move
an image of the RAID LV.
This commit is contained in:
Jonathan Brassow 2012-12-04 17:47:47 -06:00
parent 35a4d70aad
commit 3835755259
2 changed files with 16 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
Disallow pvmove on RAID LVs until they are addressed properly
Allow empty activation/{auto_activation|read_only|}_volume_list config option.
Add lvm.conf option global/thin_disabled_features.
Add lvconvert support to swap thin pool metadata volume.

View File

@ -179,6 +179,7 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
unsigned *exclusive)
{
struct logical_volume *lv_mirr, *lv;
struct lv_segment *seg;
struct lv_list *lvl;
uint32_t log_count = 0;
int lv_found = 0;
@ -206,6 +207,7 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
/* Find segments to be moved and set up mirrors */
dm_list_iterate_items(lvl, &vg->lvs) {
lv = lvl->lv;
seg = first_seg(lv);
if (lv == lv_mirr)
continue;
if (lv_name) {
@ -218,6 +220,19 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
log_print_unless_silent("Skipping snapshot-related LV %s", lv->name);
continue;
}
if (seg_is_raid(seg)) {
lv_skipped = 1;
log_print_unless_silent("Skipping %s LV %s",
seg->segtype->ops->name(seg),
lv->name);
continue;
}
if (lv_is_raid_type(lv)) {
lv_skipped = 1;
log_print_unless_silent("Skipping RAID sub-LV %s",
lv->name);
continue;
}
if (lv->status & MIRRORED) {
lv_skipped = 1;
log_print_unless_silent("Skipping mirror LV %s", lv->name);