Linux command
lvresize 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
sudo lvresize -L 120G [vg]/[lv]
Extend
sudo lvresize -L +120G --resizefs [vg]/[lv]
Example
sudo lvresize -l 100%FREE [vg]/[lv]
Reduce
sudo lvresize -L -120G --resizefs [vg]/[lv]
说明
lvresize changes the size of a logical volume, either extending or reducing it. It combines the functionality of lvextend and lvreduce into a single command.
参数
- -L, --size SIZE
- New size (+/- for relative change)
- -l, --extents EXTENTS
- Size in extents (100%FREE, +50%FREE)
- -r, --resizefs
- Also resize underlying filesystem
- -f, --force
- Force resize without confirmation
- -n, --nofsck
- Skip filesystem check
FAQ
What is the lvresize command used for?
lvresize changes the size of a logical volume, either extending or reducing it. It combines the functionality of lvextend and lvreduce into a single command.
How do I run a basic lvresize example?
Run `sudo lvresize -L 120G [vg]/[lv]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -L, --size SIZE do in lvresize?
New size (+/- for relative change)