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 appropriate. 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 2. 3. Actual results: Expected results: Additional info:
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
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.