Linux Not Recognizing Disk Expansion in VMware? Here’s How to Easily Solve It!

Problem Analysis

Due to selecting standard partitioning instead of LVM (Logical Volume Management) when installing the system in VMware, the vgextend command cannot be used to dynamically extend the root partition (/).

Linux Not Recognizing Disk Expansion in VMware? Here's How to Easily Solve It!

The created partition disk is sdax.

Linux Not Recognizing Disk Expansion in VMware? Here's How to Easily Solve It!

At this point, entering the system and typing vgdisplay will yield no response, as there is currently no LVM logical volume group created in the system.

Linux Not Recognizing Disk Expansion in VMware? Here's How to Easily Solve It!

Expanding the Disk

Now, if we want to expand the disk in VMware, what should we do?

Note: This method is applicable to virtual machines without snapshots.

Click the expand button => enter the size to expand, for example, I previously had a size of 20G, now changed to 30G, which means an expansion of 10G.

Linux Not Recognizing Disk Expansion in VMware? Here's How to Easily Solve It!

After loading, it will remind you to make adjustments inside the system.

Linux Not Recognizing Disk Expansion in VMware? Here's How to Easily Solve It!

To prevent errors, you can take a snapshot before expanding.

Linux Not Recognizing Disk Expansion in VMware? Here's How to Easily Solve It!

After the system starts, the root partition size remains unchanged, and we can see that the current root partition is using /dev/sda4.

Linux Not Recognizing Disk Expansion in VMware? Here's How to Easily Solve It!

The total size of the current disk has changed to 30G.

Linux Not Recognizing Disk Expansion in VMware? Here's How to Easily Solve It!

Use fdisk to expand the root partition.

[root@localhost ~]# fdisk /dev/sda
# Delete the root partition, which is sda4
Command (type m for help): d
Partition number (1-4, default  4): 4

Partition 4 has been deleted.

# Recreate the partition, pay attention to the available sector range;
Command (type m for help): n
Partition number (4-128, default  4): 4
First sector (3149824-62914526, default 3149824): 
Last sector, +/-sectors or +size{K,M,G,T,P} (3149824-62914526, default 62912511): 

Created a new partition 4 of type "Linux filesystem" with size 28.5 GiB.
Partition #4 contains an ext4 signature.

Do you want to remove the signature? Yes[Y]/No[N]: y

The write command will remove the signature.

Command (type m for help): w
Partition table has been altered.
Syncing disks.

At this point, checking the disk space again shows that the capacity is still 20G and has not changed.

Linux Not Recognizing Disk Expansion in VMware? Here's How to Easily Solve It!

Restart the system to refresh the partition and make it effective.

The partition type here is ext4.

Linux Not Recognizing Disk Expansion in VMware? Here's How to Easily Solve It!

Use the following command to refresh.

resize2fs /dev/sda4
# For xfs formatted partitions, use the following command
xfs_growfs /dev/sda4

At this point, the root partition expansion is complete.

Linux Not Recognizing Disk Expansion in VMware? Here's How to Easily Solve It!

PS: For expanding LVM logical partitions, refer to: Introduction to Common Linux Commands—(2), How to Expand Linux File Systems? Look here ↑↑↑

▽Previous Recommendations△

Can’t Play VLLM on Windows? WSL2 Deployment Tutorial, Even Beginners Can Quickly Get Started!

Say goodbye to complex configurations! Easily use VLLM to deploy large models.

Dify+ollama local large model knowledge base sharing full process analysis.

Deployment notes for the Nightingale monitoring system.

Say goodbye to manual work! AI+Python automates the generation of network inspection reports.

Say goodbye to single-machine limitations! Multi-machine multi-card deployment of large models, GPU cluster practical guide is here!

Say goodbye to network dependencies! DeepSeek+Vs Code, easily manage offline.

A step-by-step guide to using DeepSeek: Easily have your own AI assistant.

Can ordinary computers run large AI models? Complete guide to local deployment of DeepSeek.

A hands-on guide to mastering the H3C simulator SERVER.

No worries about database backups! Python helps you quickly solve it.

Using Python + MySQL, quickly achieve local password freedom.

Linux system email alert tool: Efficient script giveaway!

Revealed! How to cleverly test network latency on devices that block ping.

Leave a Comment