Rexxer

Some tips for me and other

Extend LVM partition in CentOS 7/8 under VmWare

  1. Add more space on the disk in VmWare console.
  2. Run cfdisk and check that you see free space after /dev/sda5.
  3. 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.
  4. Delete /dev/sda5. Don’t worry – your data will be OK.
  5. Delete /dev/sda4.
  6. Create /dev/sda4 as extended partition with full space.
  7. Create /dev/sda5 and change type to LVM (8e).
  8. Check the start sectors – must be the same as before.
  9. Write changes.
  10. Exit from cfdisk.
  11. Run pvresize /dev/sda5.
  12. Run lvextend -r cl/root /dev/sda5. (-r means you resize the file system too).
  13. 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.