For example, if you run migratepv to move your data to a new, fast-performing LUN (you hope), you might like to check the state of the volume group (VG). If you try to view the VG while it is locked, you'll get a message such as this:
0516-1201 lsvg: Warning: Volume group datavg is locked. This command will continue retries until lock is free. If lock is inadvertent and needs to be removed, execute 'chvg -u datavg'.
Advice for the impatient
You just want to look at the state of your VG, without changing it and you're getting a "come back later" sign. What can you do about it? Actually, you have a few options:
- run the chvg -u command to remove the lock. Actually, it looks to me as if this command is only meant if the vg is locked because of an abnormal termination of another, legit LVM command. So chvg -u is probably not your first choice of action.
- Wait until the original command finishes successfully and then check. Go get a coffee while instead of staring at a screen. A watched pot never boils (which might mean you'll have cold coffee)
- Use the -L flag to ignore the lock.
On LVM list commands, the -L flag lets you view the information without waiting to obtain a lock on the volume group. So, if you come across the message which tells you the volume group is locked, and you really can't wait, you could use:
The first -L doesn't wait for a lock on the volume group. The second one is to list logical volumes.
To list a single logical volume, such as lv00, use
And to list PVs (physical volumes, although these days they're almost always virtual)
For more information about these LVM commands, have a look at he command documentation:
To list information about volume groups, use lsvg
lslv displays information about a logical volume.
And lspv displays information about a physical volume in a volume group.