diff --git a/wiki/linux/lvm.md b/wiki/linux/lvm.md index 4496d9f..e78a45b 100644 --- a/wiki/linux/lvm.md +++ b/wiki/linux/lvm.md @@ -12,3 +12,36 @@ partition table and will display the error `Device /dev/sdb excluded by a filter This can be solved by removing the old partition table with `wipefs -a /dev/sdb`. And finally create the volume group `vgcreate vmdata /dev/sdb`. Then follow the guide in proxmox on how to connect a `vg` to proxmox. + +## Add Drive to existing volume group + +First format the disk so that it has one partition (we will assume its called +`/dev/sdc1`). +To add the partition to a group run: + +```shell +pvcreate /dev/sdc1 +vgextend /dev/sdc1 +``` + +## Increase size of a logical volume + +To increase the size of the logical volume you need to have free space in the +according volume group. You can check that by running: `vgdisplay`. +Then run: + +```shell +lvextend -L + /dev// +``` + +If you want to allocate all the free space existing in a volume group run: + +```shell +lvextend -l +100%FREE /dev// +``` + +Now you need to extend the filesystem with: + +```shell +resize2fs /dev// +```