Linux command
vgchange 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Activate
sudo vgchange -a y
Deactivate
sudo vgchange -a n [volume_group]
Refresh
sudo vgchange --refresh [volume_group]
Set
sudo vgchange -l [128] [volume_group]
Make
sudo vgchange -x n [volume_group]
说明
vgchange modifies the attributes of LVM volume groups. The most common use is activating or deactivating logical volumes within a volume group, which is necessary before the volumes can be mounted. Volume group activation makes the logical volumes available to the system. Deactivation is required before physical volumes can be removed or the system can be safely shut down.
参数
- -a, --activate y|n|ay
- Activate or deactivate logical volumes (y=yes, n=no, ay=autoactivation)
- -x, --resizeable y|n
- Enable or disable adding/removing physical volumes
- -l, --logicalvolume _Number_
- Set the maximum number of logical volumes allowed in the volume group
- -p, --maxphysicalvolumes _Number_
- Set the maximum number of physical volumes in the volume group
- -s, --physicalextentsize _Size_
- Change the physical extent size on physical volumes
- --refresh
- Reload metadata for all active logical volumes
- --monitor y|n
- Start or stop monitoring logical volumes with dmeventd
- --poll y|n
- Control background transformation of logical volumes
- --sysinit
- Indicate that the command is being invoked during early system initialization
- -u, --uuid
- Generate new random UUID for the volume group
- --addtag _tag_
- Add a tag to the volume group
- --deltag _tag_
- Delete a tag from the volume group
- -f, --force
- Override various checks, confirmations, and protections
- --alloc contiguous|cling|normal|anywhere|inherit
- Set the physical extent allocation policy
FAQ
What is the vgchange command used for?
vgchange modifies the attributes of LVM volume groups. The most common use is activating or deactivating logical volumes within a volume group, which is necessary before the volumes can be mounted. Volume group activation makes the logical volumes available to the system. Deactivation is required before physical volumes can be removed or the system can be safely shut down.
How do I run a basic vgchange example?
Run `sudo vgchange -a y` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -a, --activate y|n|ay do in vgchange?
Activate or deactivate logical volumes (y=yes, n=no, ay=autoactivation)