In the morning, Lao Zhang asked me: I purchased a VPS with a 15GB hard drive, but why did the probe show only 10GB? Suddenly I thought of the VPS provided by some hosting providers, the hard drive needs to be mounted by itself, such as Uno (official website), and the Jiuwang Data (official website) we just tested. It just so happens that I have a Jiuwang one on hand. Use it to test the mount.
***Preface*** This article is not a tutorial, it is just a record of an operation process based on Xiaoye's tutorial for your reference.
First, use SSH to log in as the root user and check the current hard disk space usage:
fdisk –l
As shown in the picture above, the VPS hard drive I bought is 15GB, about 10GB has been allocated, and the remaining unallocated is about 5GB. Then we look at the current space usage:
df –hal
Next, we are going to start adding partitions. First the following command:
fdisk /dev/xvdb
Next, enter the following commands in sequence as shown above (# followed by a comment):
n #New partition
p #Primary partition
3 #3rd partition
Enter #default is
Enter #default is
t #Specify partition format
8e #Partition format is LVM
w #Save
Finally, we enter reboot to restart the VPS. At this time, the SSH connection will be disconnected. After the VPS restart is completed, log in again via SSH. At this time, check again (fdisk –l) and you can see the partition we added.
Next, create the physical volumes and partitions:
pvcreate /dev/xvdb4
vgextend VolGroup00 /dev/xvdb4
Then, we check the physical volume and know the total amount of hard disk space capacity that needs to be increased.
vgdisplay
Next is the key point. Increase it as appropriate according to the actual size. For example, my current capacity is 4.97GB, which is slightly smaller than the actual capacity. 4.95GB is enough.
lvresize -L +4.95G /dev/VolGroup00/LogVol00
Then dynamically expand the size of the partition:
resize2fs /dev/VolGroup00/LogVol00
You’re done! Let’s take a look at the current space size.
OK, the whole mounting process is like this. The previously installed probe demo, DX, and WP demos are all intact, the probe shows, and the hard disk space has increased (^o^)/