2021-03-24 20:44:01 +00:00
|
|
|
# lvm
|
|
|
|
|
|
|
|
> Manage physical volumes, volume groups, and logical volumes using the Logical Volume Manager (LVM) interactive shell.
|
2024-06-18 16:51:01 +01:00
|
|
|
> More information: <https://manned.org/lvm>.
|
2021-03-24 20:44:01 +00:00
|
|
|
|
|
|
|
- Start the Logical Volume Manager interactive shell:
|
|
|
|
|
|
|
|
`sudo lvm`
|
|
|
|
|
|
|
|
- Initialize a drive or partition to be used as a physical volume:
|
|
|
|
|
|
|
|
`sudo lvm pvcreate {{/dev/sdXY}}`
|
|
|
|
|
2021-04-10 20:30:31 +01:00
|
|
|
- Display information about physical volumes:
|
2021-03-24 20:44:01 +00:00
|
|
|
|
|
|
|
`sudo lvm pvdisplay`
|
|
|
|
|
|
|
|
- Create a volume group called vg1 from the physical volume on `/dev/sdXY`:
|
|
|
|
|
|
|
|
`sudo lvm vgcreate {{vg1}} {{/dev/sdXY}}`
|
|
|
|
|
|
|
|
- Display information about volume groups:
|
|
|
|
|
|
|
|
`sudo lvm vgdisplay`
|
|
|
|
|
|
|
|
- Create a logical volume with size 10G from volume group vg1:
|
|
|
|
|
|
|
|
`sudo lvm lvcreate -L {{10G}} {{vg1}}`
|
|
|
|
|
|
|
|
- Display information about logical volumes:
|
|
|
|
|
|
|
|
`sudo lvm lvdisplay`
|
2024-01-30 04:55:24 +00:00
|
|
|
|
|
|
|
- Display help for a specific command:
|
|
|
|
|
|
|
|
`lvm help {{command}}`
|