[ubuntu] How to expand the hard disk of ubuntu in the virtual machine

1. Opening

When using a virtual machine (VMware Workstation in this article) to run ubuntu, sometimes the hard disk capacity set when installing the virtual machine is not enough in the later stage. If expansion is required, what should I do at this time. This article will describe this topic.

If the system in the virtual machine is running, it needs to be shut down. Then open "Virtual Machine Settings", select the hardware column, and then select the "Extension" option, as shown in the following figure:

Then set the maximum disk size, Xiaosheng here is set to expand to 100GB:

Then click the "Extend" button. Up to this point, the expansion of the hard disk capacity has not been successful, and the system in the virtual machine will not automatically expand the newly allocated hard disk free area.

2. Discussion on capacity expansion

The hard disk size has been set in VMware Workstation above.

Next, is the actual expansion operation. Start the ubuntu system in the virtual machine and check the current file system hanging status:


As can be seen from the figure above, the root directory has a total capacity of 49G, and 27G has been used so far, leaving 20G capacity.

We enter the ubuntu application menu bar, find GPartedthe software, and open:

After GParted is running, the software interface is as shown in the figure below:

(From the figure above, GParted will find that the currently unallocated memory capacity is 50GB)

Then we use the mouse to click on the existing partition (note: the partition you want to expand), and then click the "Resize/Move Selected Partition" arrow button, as shown in the figure below:

Then use the mouse to drag the moving arrow to increase the size of the hard disk capacity. After the movement is completed, click "Resize", as shown in the figure below:

Then click the small tick as shown in the figure below:

Then a warning box will pop up, we click "Apply":

Then GParted will automatically adjust the partition size.

After the expansion is complete, use df to view:

As can be seen from the figure above, it is found that the total size of /dev/sda1 has changed to 99G.

So far, the expansion of the hard disk capacity of the virtual machine ubuntu has been completed.


Of course, ubuntu comes with a [hard disk] operating software by default, and we can also use this software to adjust the partition size:

After the software is running, the interface is as shown in the figure below:

Then click the button identified in the red box above and select "Resize":

Then use the mouse to drag the slider to set the position of the hard disk capacity that you want to adjust to, and then select "Resize":

Ok, hard drive expansion is complete!

Guess you like

Origin blog.csdn.net/iriczhao/article/details/126274036