LinuxCommandLibrary

lvresize

changes the size of a logical volume, either extending or reducing it

TLDR

Set volume to specific size

$ sudo lvresize -L 120G [vg]/[lv]
copy
Extend with filesystem resize
$ sudo lvresize -L +120G --resizefs [vg]/[lv]
copy
Extend to 100% free space
$ sudo lvresize -l 100%FREE [vg]/[lv]
copy
Reduce with filesystem resize
$ sudo lvresize -L -120G --resizefs [vg]/[lv]
copy

SYNOPSIS

lvresize [options] -L size vg/lv

DESCRIPTION

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.

PARAMETERS

-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

CAVEATS

Reducing requires filesystem resize first or --resizefs. Extending is generally safe. Always backup before reducing.

SEE ALSO

lvextend(8), lvreduce(8), lvm(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community