VMware Cloud Community
JoeM1
Contributor
Contributor

Problems expanding VM using esxi (only)

Hi all: I am having issues getting my cPanel to "see" the expanded VM I created in esxi. It is causing errors when trying to perform automated backups, as it thinks there's not enough room.

I am running esxi Version 7.0 Update 3, on a server. The VM is using AlmaLinux 8.8 for its OS. I recently expanded the VM from 500 GB to 750 GB using esxi, and in esxi, it shows its hard disk size as the newly expanded partition (750GB).

Then I unmounted the partition, ran a fsck command and it passed the bad blocks test. Then I tried to resize with the resize2fs command, which it struggled with (various vague errors). I remounted it, but cPanel still doesn't recognize the larger partition.

cPanel's support suggests, "Please make sure the partition is not actively being used and is not a primary system partition. If it is, you may need to take additional steps not covered by this guide." The partition I am re-sizing IS the primary system partition for that VM. It contains a score of websites, mostly on a shared IP for hosting.

Also, I ran the terminal command lsblk inside WHM (cPanel) and it shows the expanded/larger partition. I am stumped.

I would really appreciate any suggestions, as I really need to get cPanel to see the larger partition size.

With thanks in advance, and apologies if this was already covered somewhere else.

0 Kudos
4 Replies
louyo
Virtuoso
Virtuoso

"various vague errors" does not sound encouraging. What does sudo fdisk -l (in the VM ) show?

Sachchidanand
Expert
Expert

Before extending using the resize2fs, have you created the physical volume and added this physical volume to volume group? After that you can extend the logical volume.

Regards,

Sachchidanand

JoeM1
Contributor
Contributor

Thanks for your reply. 

sudo sdisk -l shows the new partition is being recognized - I changed it from 500 GB to approx 700 GB, which it shows as 666.9 GB on /dev/sda4. The issue is how do I get cPanel/WHM to "see" the same thing. I paid for a support ticket in cPanel, and they just gave me generic instructions, which did not work.

 

result of sdisk -l:

Disk /dev/sda: 700 GiB, 751619276800 bytes, 1468006400 sectors
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: gpt
Disk identifier: 065C2FA6-5EEF-4628-9CC3-FFF24EA3C6C7

Device Start End Sectors Size Type
/dev/sda1 2048 1230847 1228800 600M EFI System
/dev/sda2 1230848 3327999 2097152 1G Linux filesystem
/dev/sda3 3328000 69404671 66076672 31.5G Linux swap
/dev/sda4 69404672 1468006366 1398601695 666.9G Linux filesystem


Disk /dev/loop0: 4 GiB, 4294967296 bytes, 8388608 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Here is the reply from cPanel support I received (and the article, below that). I tried these steps exactly, but it did not work.

WHM only reports what the operating system reports. When looking at the available disk space for "/", you can see is about 500GB:

df -Th|grep -w "/"
/dev/sda4 ext4 459G 349G 87G 81% /

 
This means the space is not yet available to use. The partition was resized and increased but you still need to make the new space available with the command resize2fs.
 
The "lsblk" command shows the actual blocks available in the disk, but not the logical access to it. 
 
Please review the following article for more information in regards to steps missing when resizing a disk partition:
I added additional space to my partition and it's not showing up, what else do I need to do?
 
I am confident the knowledge shared in the above article will guide you toward solving the issue you have outlined in this request. Would you please review the article and let me know if you have any outstanding questions or concerns? It’s been a pleasure working with you on this issue, and I hope you are satisfied with the experience!

<end reply>

<begin article>

If the partition is currently mounted, you will need to unmount the partition first. Please make sure the partition is not actively being used and is not a primary system partition. If it is, you may need to take additional steps not covered by this guide. We highly advise consulting with your system administrator before making any partition related changes.


For example:

 

 
# umount /dev/sda

 

Next, run a fsck on the unmounted file system to verify there are no bad blocks.

# e2fsck /dev/sda
e2fsck 1.41.12 (06-Aug-2020) Pass 1:Checking inodes, blocks, and sizes Pass 2:Checking directory structure Pass 3:Checking directory connectivity Pass 4:Checking reference counts Pass 5:Checking group sumary information ext4-1:11/131072 files (0.0% non-contiguous),27050/524128 blocks

 

Resize the file system with the resize2fs /dev/device command.

For example:

# resize2fs /dev/sda
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/ada to 524128 (1k) blocks.The filesystem on /dev/sda is now 524128 blocks long.

 

 The following block sizes are accepted:

 

S - 512 byte sectors
K - kilobytes
M - megabytes
G - gigabytes

 

Finally, mount the partition again.

 

# mount /dev/sda /home

 

For additional information, please refer to Red Hat's Documentation, How to Grow an ext2/3/4 File System with resize2fs

0 Kudos
JoeM1
Contributor
Contributor

Hi, thanks for your reply. I appreciate it.

The steps I took were what esxi suggested: 

1) In esxi, increase size of volume in Management, under "Edit settings."

2A) Then I tried this: Placed the server into single user mode (we tried normal mode too). Maybe I need to do something more extreme - like put it into maintenance mode? Not sure . . .

2B) Unmounted partition
3) ran e2fsck to check all was well. It was.

4) resize2fs. It failed. I can't remember the exact verbiage, but it was super vague. Like, unuseful vague.

Remounted volume. No change. (sigh). I paid for a ticket in cPanel. It was not helpful. (see below) Any insight offered would be most appreciated. (and to be clear, I am using only the free version of esxi, not the paid version. Which I understand handles all of these steps . . . )

 

sudo sdisk -l shows the new partition is being recognized - I changed it from 500 GB to approx 700 GB, which it shows as 666.9 GB on /dev/sda4. The issue is how do I get cPanel/WHM to "see" the same thing. I paid for a support ticket in cPanel, and they just gave me generic instructions, which did not work.

 

result of sdisk -l:

Disk /dev/sda: 700 GiB, 751619276800 bytes, 1468006400 sectors
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: gpt
Disk identifier: 065C2FA6-5EEF-4628-9CC3-FFF24EA3C6C7

Device Start End Sectors Size Type
/dev/sda1 2048 1230847 1228800 600M EFI System
/dev/sda2 1230848 3327999 2097152 1G Linux filesystem
/dev/sda3 3328000 69404671 66076672 31.5G Linux swap
/dev/sda4 69404672 1468006366 1398601695 666.9G Linux filesystem


Disk /dev/loop0: 4 GiB, 4294967296 bytes, 8388608 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

 

Here is the reply from cPanel support I received (and the article, below that). I tried these steps exactly, but it did not work.

WHM only reports what the operating system reports. When looking at the available disk space for "/", you can see is about 500GB:

df -Th|grep -w "/"
/dev/sda4 ext4 459G 349G 87G 81% /

 
This means the space is not yet available to use. The partition was resized and increased but you still need to make the new space available with the command resize2fs.
 
The "lsblk" command shows the actual blocks available in the disk, but not the logical access to it. 
 
Please review the following article for more information in regards to steps missing when resizing a disk partition:
I added additional space to my partition and it's not showing up, what else do I need to do?
 
I am confident the knowledge shared in the above article will guide you toward solving the issue you have outlined in this request. Would you please review the article and let me know if you have any outstanding questions or concerns? It’s been a pleasure working with you on this issue, and I hope you are satisfied with the experience!

<end reply>

<begin article>

If the partition is currently mounted, you will need to unmount the partition first. Please make sure the partition is not actively being used and is not a primary system partition. If it is, you may need to take additional steps not covered by this guide. We highly advise consulting with your system administrator before making any partition related changes.


For example:

 

 
# umount /dev/sda

 

Next, run a fsck on the unmounted file system to verify there are no bad blocks.

# e2fsck /dev/sda
e2fsck 1.41.12 (06-Aug-2020) Pass 1:Checking inodes, blocks, and sizes Pass 2:Checking directory structure Pass 3:Checking directory connectivity Pass 4:Checking reference counts Pass 5:Checking group sumary information ext4-1:11/131072 files (0.0% non-contiguous),27050/524128 blocks

 

Resize the file system with the resize2fs /dev/device command.

For example:

# resize2fs /dev/sda
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/ada to 524128 (1k) blocks.The filesystem on /dev/sda is now 524128 blocks long.

 

 The following block sizes are accepted:

 

S - 512 byte sectors
K - kilobytes
M - megabytes
G - gigabytes

 

Finally, mount the partition again.

 

# mount /dev/sda /home

 

For additional information, please refer to Red Hat's Documentation, How to Grow an ext2/3/4 File System with resize2fs

0 Kudos