wiki:resize_lvm_partition_used_by_vm
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| wiki:resize_lvm_partition_used_by_vm [2025/09/04 12:16] – created antisa | wiki:resize_lvm_partition_used_by_vm [2025/10/21 11:59] (current) – add info about parttion number antisa | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| ----------------------------------------------------- | ----------------------------------------------------- | ||
| vda 40.000 GiB (parted) select /dev/vda | vda 40.000 GiB (parted) select /dev/vda | ||
| - | Using /dev/vda | ||
| - | (parted) print | ||
| - | Model: Virtio Block Device (virtblk) | ||
| - | Disk /dev/vda: 64.4GB | ||
| - | Sector size (logical/ | ||
| - | Partition Table: msdos | ||
| - | Disk Flags: | ||
| - | |||
| - | Number | ||
| - | | ||
| - | | ||
| - | |||
| - | (parted) print free | ||
| - | Model: Virtio Block Device (virtblk) | ||
| - | Disk /dev/vda: 64.4GB | ||
| - | Sector size (logical/ | ||
| - | Partition Table: msdos | ||
| - | Disk Flags: | ||
| - | |||
| - | Number | ||
| - | 32.3kB | ||
| - | | ||
| - | | ||
| - | 49.4GB | ||
| - | |||
| - | (parted) quit | ||
| - | 38.564 GiB 60.000 GiB | ||
| You can see that the Physical and Allocation column are almost the same. | You can see that the Physical and Allocation column are almost the same. | ||
| Line 71: | Line 44: | ||
| </ | </ | ||
| - | Check that the LV volume is part of the VG volume (centos here). | + | Check that the LV volume is part of the VG volume (centos here) by running the '' |
| + | |||
| Now expand the disk size | Now expand the disk size | ||
| ~# lvextend -L +100G / | ~# lvextend -L +100G / | ||
| - | The above is the new disk size in GB. | + | The above is the new disk size increased by 100GB. So if it was 50GB now its 150GB. |
| Restart the VM to pick up the new disk size. | Restart the VM to pick up the new disk size. | ||
| Line 96: | Line 71: | ||
| </ | </ | ||
| - | Here we want to expand vda2, centos-lv_root FS. Run these commands: | + | Here we want to expand vda2, centos-lv_root FS. Get the partition number by running |
| + | parted /dev/vda | ||
| + | print free | ||
| + | |||
| + | Then ruun these commands: | ||
| sudo yum install -y cloud-utils-growpart | sudo yum install -y cloud-utils-growpart | ||
| - | sudo growpart /dev/vda 2 | + | sudo growpart /dev/vda 2 <-- 2 is partition you get via parted |
| sudo pvresize /dev/vda2 | sudo pvresize /dev/vda2 | ||
| sudo lvextend -l +100%FREE / | sudo lvextend -l +100%FREE / | ||
wiki/resize_lvm_partition_used_by_vm.1756988188.txt.gz · Last modified: by antisa
