Extend LVM partition in CentOS 7/8 under VmWare
- Add more space on the disk in VmWare console.
- Run cfdisk and check that you see free space after /dev/sda5.
- In my case there are /dev/sda4 as extended partition and /dev/sda5 as LVM2 partition in extended. Remember start sectors for /dev/sda4 and sda5.
- Delete /dev/sda5. Don’t worry – your data will be OK.
- Delete /dev/sda4.
- Create /dev/sda4 as extended partition with full space.
- Create /dev/sda5 and change type to LVM (8e).
- Check the start sectors – must be the same as before.
- Write changes.
- Exit from cfdisk.
- Run pvresize /dev/sda5.
- Run lvextend -r cl/root /dev/sda5. (-r means you resize the file system too).
- Profit!
P.S.: In Ubuntu 18.04 with GPT table I had to fix the disk/partition with gdisk /dev/sdaX. Just make write and it will correct the error. Then you can see it in cfdisk and resize a partition there. Then run resize2fs /dev/sdaX
Comments are currently closed.