← 返回命令列表

Linux command

lvchange 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Activate

sudo lvchange -a y /dev/vg_name/lv_name

Deactivate

sudo lvchange -a n /dev/vg_name/lv_name

Example

sudo lvchange -a ay /dev/vg_name/lv_name

Example

sudo lvchange -p r /dev/vg_name/lv_name

Skip activation

sudo lvchange -k y /dev/vg_name/lv_name

Refresh

sudo lvchange --refresh /dev/vg_name/lv_name

说明

lvchange changes attributes or the activation state of logical volumes in LVM. It can activate/deactivate volumes, change permissions, and modify various LV properties.

参数

-a, --activate y|n|ay
Activate (y), deactivate (n), or autoactivate (ay)
-p, --permission r|rw
Set read-only (r) or read-write (rw)
-k, --setactivationskip y|n
Set activation skip flag
--refresh
Refresh volume using latest metadata
-Z, --zero y|n
Zero first KB of new logical volume
--addtag TAG
Add tag to logical volume

FAQ

What is the lvchange command used for?

lvchange changes attributes or the activation state of logical volumes in LVM. It can activate/deactivate volumes, change permissions, and modify various LV properties.

How do I run a basic lvchange example?

Run `sudo lvchange -a y /dev/vg_name/lv_name` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --activate y|n|ay do in lvchange?

Activate (y), deactivate (n), or autoactivate (ay)