Occasionally (albeit rarely) you’ll have a need to grow a local VMFS volume. If storage is remote, you would expand it, rescan HBAs, and go on your merry way as ESXi does all the work for you. In the case of a local (as in “inside an ESXi host”) volume, this is a manual process. I assume the reason for this is that it’s often shared with the operating system partitions, so we want to be careful. I’ll walk you through the process of expanding one of these volumes. First up – grow the actual volume! That’s outside the scope of this tutorial, so come back once you have the space allocated to the end of the disk.
Steps:
- Before starting, I’ll show you that the current capacity of this local datastore is 32.5 GB:
- Let’s grab an SSH session to the ESXi host. If SSH isn’t enabled, see this guide. Also, see my SSH Tool!
- First of all, we need to find the device identifier for the volume. In my case, the volume is ‘va-esx-03-local.” We will use the ‘-P’ flag with vmkfstools to find this.
- Take note of something: the :3 on the end denotes partition #3. We’ll need to use this in the future, but also need to leave it off in certain areas. Take special care to note whether or not each of the following commands is specifying the partition or the whole disk.
- Next we will use partedUtil to determine the starting sector for the partition. We’ll need this in a later step to specify the boundaries of the grown partition. Use the partition numbers down the left hand side to find the correct partition (mine is 3) and then write down the beginning sector, highlighted in the screenshot below.
- Last step before expanding – we need to find the ending sector. Since our VMFS partition is at the end of the disk, we just need to specify the starting sector, and then the last sector usable. We will again use partedUtil. Take the second number, which is the last usable sector.
- You should now have a beginning sector and an end sector. In my example, they are 15472640 and 419430366. We will finally use partedUtil one last time to issue the resize command. The format is disk partition first sector last sector. No news from this command is good news 🙂
- Now the partition is the proper size. We just need to expand the filesystem to fill the space. We’ll go back to vmkfstools to do this. First run ‘vmkfstools -V’ to do a refresh of the volumes.
- In this step, we’re back to using the partition number, so make sure to include that on the end! Also note that the syntax of the command requires us to enter the disk twice.
- Okay – lets pop back into the vSphere Client, do a “Refresh” and see what we have! It’s now showing 192.5 GB because I grew the drive by 160 GB!
Conclusion
Hopefully you made it through that without too many bruises! Check out the official documentation on this process if you have any questions about what I showed here. Good luck!