VMware guest is running Kali Linux, but the procedure is same for any distro – CentOS, RedHat, or Ubuntu, as filesystem extension is ext4.
And so here I will approached it mainly via using “gparted”.
First shutdown the OS, and use VMware setting to increase the diskspace via “expand disk” option.
After selecting “Expand Disk” VMware will increase the filesize of the VMDK file in the host machine – make sure you have sufficient space for that:
After expansion, bootup the OS and issue “fdisk” to see the new size:
As noted above, the new physical size is 40G, but the total allocated (by adding up all the start to end sectors and multiply by 512 bytes and you get 20G.
So now to extend the disk, you will need to remove the “Extended” and “Swap” partition, and followed by “resize2fs” command as shown in articles below:
http://www.uptimemadeeasy.com/vmware/grow-an-ext4-filesystem-on-a-vmware-esxi-virtual-machine/
https://serverfault.com/questions/509468/how-to-extend-an-ext4-partition-and-filesystem
http://manpages.ubuntu.com/manpages/xenial/man8/resize2fs.8.html
But an easier way is to use “gparted”:
Starting “sudo gparted /dev/sda”:
First is disable the swapspace, and delete the swap partition, and then “extended” partition:
Delete the swap partition:
Now deleting the “extended” partition:
And now you get the two unallocated partition combined into one:
Now select the “/dev/sda” partition for resizing:
After specifying the new size, select “apply all operation”:
This is what you will end up with after resizing:
You must be logged in to post a comment.