1 minute read

To extend an eagerly zeroed thick drive in ESXi do the following:

  1. Enable the shell.
  2. Confirm the vm is turned off or the disk is not active on any vm
  3. Login to the shell in your favorite terminal
  4. use the following command: vmkfstools -X NumberG/T -d eagerzeroedthick /vmfs/volumes/Path/to/your/volume/volume_name.vmdk
  5. Once completed verify you’ve properly extended the drive with this command: vmkfstools -D /vmfs/volumes/Path/to/your/volume/volume_name.vmdk
  6. Back in the web console, remove the drive from the vm, and then re-add it. It should now show the correct size.

Source

To be able to use this extra space in linux you also need to resize the partition and file system in linux. To achieve that do the following:

  1. Firstly, confirm the disk is not mounted, if you have the disk mounted automatically on boot you’ll need to either unmount it with the command: sudo umount /dev/sdX OR if that doesn’t work you should just disable automount entirely here: /etc/fstab and then restart the machine to unmount
    • Either sudo umount /dev/sdX or sudo vi /etc/fstab
  2. Enter command: sudo parted /dev/sdX print
    • Record the partition number of the partition you want to extend
  3. To automatically extend the partition to take up all available space:
    • enter command: sudo growpart /dev/sdX PartitionNumber
  4. To begin extending the filesystem, first we need to do a quick diskcheck:
    • enter command: sudo e2fsck -fy /dev/sdXPN
  5. Once the disk check is completed and all optimizations have been completed, we can now extend the filesystem with the following command:
    • sudo resize2fs /dev/sdXPN

Source

Congratulations, your disk should now be extended and usable by the OS.