If your company's server needs to be expanded, you can search for information online and record it.
The following are the steps to expand the Linux root directory. Follow these steps and you will be successful.
If you find this information useful, please don't forget to like it.
df -hl
Query disk
fdisk -l
Use the added disk
fdisk /dev/sdb
After entering this command, the following picture will appear. Just follow the operation command
Create physical volume
pvcreate /dev/sdb1
Query the created physical volume
WeChat search public account: front-end technical programming, reply: front-end to receive information.
pvdisplay
Add the newly added volume to the volume group centos through vgextend
vgextend centos /dev/sdb1
View volume group free block Free PE
vgdisplay
Add expansion capacity to the directory to be expanded
Extend the root directory mount point /dev/mapper/centos-root through the lvextend command
lvextend -L 60G /dev/mapper/centos-root
xfs_growfs /dev/mapper/centos-root
df -hl View expansion status
If you see the red box in the picture above, it means the expansion is successful.
The above is the detailed content of The company server Linux server needs to be expanded. Let's organize and record it.. For more information, please follow other related articles on the PHP Chinese website!