How can I resize A Linux partition when it is full ?, Linux partition full resizing
The figure shows that the usage of the mount point "/" has been moved to 100%, and the space is insufficient. Therefore, you need to partition the mount point.
1. First enter the VM settings to increase disk space
Note: Change 25 to 50 to expand the space. Here we must write a number larger than 25, because it is "increased to" 50 GB, rather than "increased by 25 GB"
2. You can see that the disk space is increased to 53.7 GB. There are two partitions on the device, sda1 and sda2 (ignore sda3 ). Next, add a partition.
Type the command: fdish/dev/sda
Type: m (for help)
Type: n (add partition)
Type: p (add primary partition)
Type: Press enter (start and end sectors)
Last: w (Exit)
Note: If you press enter directly in the "starting sector", random writing may cause a waste of space.
Now the system has three points: sda1, sda2, and sda3.
3. Create a physical volume
Type the command pvcreate/dev/sda3.
If sda3 is not found, type partprobe or restart the VM.
4. Use vgscan to query physical volumes
4.1 The physical volume name of the local machine can be found as "cl ",
4.2 Use the new physical volume extension cl:
Type the command: vgextendcl/dev/sda3
5. Extend lv
Enter the command: lvextend-L + 24G plus the name of the partition to be extended
Then we use dh-f to find that the actual capacity has not changed, because our system does not know the file system of the Newly Added Disk, so we need to resize the file system.
Type: xfs_growfs and the name of the partition to be extended.
Or
Resize2fs-f add the name of the partition to be extended