Bug 422811 - vgchange -an <vgname> gives confusing message
Summary: vgchange -an <vgname> gives confusing message
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2   
(Show other bugs)
Version: 5.0
Hardware: All Linux
Target Milestone: ---
: ---
Assignee: Dave Wysochanski
QA Contact: Corey Marthaler
Depends On:
TreeView+ depends on / blocked
Reported: 2007-12-13 03:41 UTC by Don Hoover
Modified: 2010-05-17 21:05 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-05-17 21:05:26 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Don Hoover 2007-12-13 03:41:40 UTC
Description of problem:
The message returned when doing a vgchange -an <vgname> is confusing/misleading. 

The command returns the message like this: "0 logical volume(s) in volume group
"<vgname>" now active".

This is confusing to the user because they are not activating the vg, but
deactivating it.  This is also kind of misleading due to the "0 logical volumes"
part of the message as well.  

It seems like a message more like "vg <vgname> deactivated." would be more

Version-Release number of selected component (if applicable):
LVM2 2-2.02.16-3

How reproducible:
vgchange -an any volume group

Steps to Reproduce:
1. vgchange -an any volume group that was active
Actual results:

Expected results:

Additional info:

Comment 1 Dave Wysochanski 2009-12-08 23:20:17 UTC
Perhaps the confusion is that "vgchange -an" sounds like you're deactivating the volume group.  However, this is not really what that option does.  From the man page:
       -a, --available [e|l]{y|n}
              Controls the availability of the logical volumes in  the  volume
              group  for input/output.  In other words, makes the logical vol-
              umes known/unknown to the kernel.

So it is really an LV operation in disguise.  ;-)

Not sure we can really clean this up w/out a second output line, but I can see why the one default output prints the total # active.  There is a verbose message that says "Deactivated N logical volumes..." - you can see this with 'vgchange -an -v' on the latest upstream code (recently improved):

# tools/lvm vgchange -v -an vg
    Using volume group(s) on command line
    Finding volume group "vg"
    Found volume group "vg"
    Found volume group "vg"
    Deactivated 1 logical volumes in volume group vg
  0 logical volume(s) in volume group "vg" now active
]# tools/lvm vgchange -v -ay vg
    Using volume group(s) on command line
    Finding volume group "vg"
    Archiving volume group "vg" metadata (seqno 9).
    Creating volume group backup "/etc/lvm/backup/vg" (seqno 9).
    Found volume group "vg"
    Creating vg-lv1-real
    Loading vg-lv1-real table (253:2)
    Resuming vg-lv1-real (253:2)
    Creating vg-lv1
    Loading vg-lv1 table (253:3)
    Creating vg-snap-cow
    Loading vg-snap-cow table (253:4)
    Resuming vg-snap-cow (253:4)
    Creating vg-snap
    Loading vg-snap table (253:5)
    Resuming vg-snap (253:5)
    Resuming vg-lv1 (253:3)
    Activated 1 logical volumes in volume group vg
  2 logical volume(s) in volume group "vg" now active

Comment 4 Dave Wysochanski 2010-05-17 21:05:26 UTC
As stated earlier, the man page explains the '-a' flag is really an LV operation. As I recall, the maintainer did not want to change the existing message as stated in the original description (there is no way to really "activate/deactivate" a VG) so in the absence of further comment, I'm closing this as WONT_FIX.

Note You need to log in before you can comment on or make changes to this bug.