Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lvresize: add vg to positional arg and example extend #5150

Merged
merged 8 commits into from
Jan 17, 2021
16 changes: 10 additions & 6 deletions pages/linux/lvresize.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

> Change the size of a logical volume.

- Change a volume's size to 120GB:
- Change a logical volume's size to 120GB:
aaaawwWWWwwwwWWW marked this conversation as resolved.
Show resolved Hide resolved

`lvresize -L {{120G}} {{logical_volume}}`
`lvresize --size {{120G}} {{volume_group}}/{{logical_volume}}`

- Reduce a volume's size by 120GB as well as the underlying filesystem:
- Extend a logical volume's size by 120GB as well as the underlying filesystem:
aaaawwWWWwwwwWWW marked this conversation as resolved.
Show resolved Hide resolved

`lvresize --size -{{120G}} -r {{logical_volume}}`
`lvresize --size -{{120G}} --resizefs {{volume_group}}/{{logical_volume}}`
aaaawwWWWwwwwWWW marked this conversation as resolved.
Show resolved Hide resolved

- Increase a volume's size to 100% of the free physical volume space:
- Extend a logical volume's size to 100% of the free physical volume space:
aaaawwWWWwwwwWWW marked this conversation as resolved.
Show resolved Hide resolved

`lvresize --size {{100}}%FREE {{logical_volume}}`
`lvresize --size {{100}}%FREE {{volume_group}}/{{logical_volume}}`

- Reduce a logical volume's size by 120GB as well as the underlying filesystem:
aaaawwWWWwwwwWWW marked this conversation as resolved.
Show resolved Hide resolved

`lvresize --size -{{120G}} --resizefs {{volume_group}}/{{logical_volume}}`