Need help to expand disk for a fedora 31 vm guest

I am using VMware workstation to have a fedora 31 guest.

I have expand the disk in the VMware setting.

fdisk -l
Disk /dev/sda: 80 GiB, 85899345920 bytes, 167772160 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb00312ac

Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 4095 2048 1M 83 Linux
/dev/sda2 * 4096 618495 614400 300M 83 Linux
/dev/sda3 618496 4894719 4276224 2G 82 Linux swap / Solaris
/dev/sda4 4894720 62914559 58019840 27.7G 5 Extended
/dev/sda5 4896768 62914559 58017792 27.7G 83 Linux

How to proceed?

  1. Fedora 31 is more than 5 years old

  2. VMware is a proprietary hypervisor and not open source. You may need to contact vmware developers for an answer.

With that said. it may be possible to expand the virtual disk with something like gparted on the host when the virtual VM is powered off.

I am assuming that /dev/sda5 is the partition you wish to expand, but that cannot be altered AFAIK when the VM is running. The fact you are using an msdos partition table complicates things a lot.

Hmm. Is there an easy way to migrate the entire vm to a new one with a larger disk allocated?

as you already extended the lun, create a snapshot! You can rollback to this snapshot anytime if things go south.

You need to change the extended partition /dev/sda4 and then either do the same with sda5 or create a new partition, it depends on the setup.
One way is to edit the partition table and change the end sector.

Assuming sda5 is a LVM pv, you can then extend the pv with pvresize /dev/sdX and extend the logical volumes with lvextend

It’s maybe easier to boot a gparted ISO and resize/extend the partitions.

pls post the outpuf of lsblk -f

lsblk -f
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
├─sda1
├─sda2 xfs 0ab9bdbb-0915-4251-9a82-84a7f004595a 138.7M 53% /boot
├─sda3 swap aafceafb-aaf4-46ed-ac06-31cdaa321174 [SWAP]
├─sda4
└─sda5 xfs aa22a859-b1eb-43a5-9bdd-db7f3ac1c11b 10.2G 63% sr0

lvdisplay And vgdisplay return nothing

I am not sure how to boot gparted ISO. It needs to be within this vm machine, no? How?

Assign/mount iso to the virtual cd drive and boot from cdrom.
Back up the VM first and create a snapshot.

Pls post output of df -Th .

df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs tmpfs 2.0G 8.0K 2.0G 1% /dev/shm
tmpfs tmpfs 2.0G 1.2M 2.0G 1% /run
/dev/sda5 xfs 28G 18G 11G 63% /
tmpfs tmpfs 2.0G 176K 2.0G 1% /tmp
/dev/sda2 xfs 295M 156M 139M 53% /boot
tmpfs tmpfs 391M 0 391M 0% /run/user/0

If I try to create a new partition from the 50GB - it says cannot have more than 4 partitions

you have to resize /dev/sda4 first. Then you should be able to either extend /dev/sda5 or create a new partition inside the extended partition /dev/sda4 (similar to /dev/sda5 ) .

Maybe you can extend /dev/sda5 right away, and the extended partition will be updated automatically by gparted. Or you should be able to create a new extended partition /dev/sda6.
It’s not possible to create a new primary partition in a MBR disk format. It supports only 4 primary partitions.

Thanks you a lot.

Now all 50GB is added to sda5 just as you explained.