diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2018-02-28 17:16:17 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2018-03-06 15:42:46 +0100 |
commit | 112846ce0b01e5353dfa81979a2d8ccb3e25a900 (patch) | |
tree | 9dc15b13ae002215e4dbf8439b7b5e079ebe5f4b /tools/vgchange.c | |
parent | 6134a71a906744dec2d602f83915f0adb05e77f7 (diff) | |
download | lvm2-112846ce0b01e5353dfa81979a2d8ccb3e25a900.tar.gz |
activation: support activation of component LVs
Occasionaly users may need to peek into 'component devices.
Normally lvm2 does not let users activation component.
This patch adds special mode where user can activate
component LV in a 'read-only' mode i.e.:
lvchange -ay vg/pool_tdata
All devices can be deactivated with:
lvchange -an vg | vgchange -an....
Diffstat (limited to 'tools/vgchange.c')
-rw-r--r-- | tools/vgchange.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/vgchange.c b/tools/vgchange.c index 616a9d3f3..6d739fe9b 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c @@ -92,7 +92,7 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd, struct volume_group *vg, lv = lvl->lv; - if (!lv_is_visible(lv)) + if (!lv_is_visible(lv) && (!cmd->process_component_lvs || !lv_is_component(lv))) continue; /* If LV is sparse, activate origin instead */ @@ -222,6 +222,8 @@ int vgchange_activate(struct cmd_context *cmd, struct volume_group *vg, /* FIXME Move into library where clvmd can use it */ if (do_activate) check_current_backup(vg); + else /* Component LVs might be active, support easy deactivation */ + cmd->process_component_lvs = 1; if (do_activate && (active = lvs_in_vg_activated(vg))) { log_verbose("%d logical volume(s) in volume group \"%s\" " |