# Resize VMDK on ESXi

ESXi 7.0\
Ubuntu 18.04

1. Navigate to web interface for ESXi. Find guest VM. **You are not required to turn off the VM.**
2. Select VM. Edit. Hard disk - change size for disk (if there is datastore space available).
3. SSH (or use console) into the guest VM. Make the following changes.
4. No reboot required.

```
parted ---pretend-input-tty /dev/sda resizepart 2 100%
partx -u /dev/sda
pvresize /dev/sda2
lvextend -r vg/lv_root /dev/sda2
```

* /dev/sda is the disk you've resized
* /dev/sdaX is the partition you have an LV sitting in/on
* /vg/lv\_root is the logical volume name which you wish to resize

![](/files/6iToPqbDRQZyvGHSdDAM)

Source: <https://www.ryadel.com/en/linux-resize-extend-disk-partition-unallocated-space-centos-rhel-ubuntu-debian-vm/>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.iblue.team/general-notes-1/resize-vmdk-on-esxi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
