Home  >  Article  >  System Tutorial  >  The company server Linux server needs to be expanded. Let’s organize and record it.

The company server Linux server needs to be expanded. Let’s organize and record it.

WBOY
WBOYforward
2024-02-09 17:45:23400browse

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.

Query disk usage

df -hl

The company server Linux server needs to be expanded. Let’s organize and record it.

Query disk

fdisk -l

The company server Linux server needs to be expanded. Let’s organize and record it.

Use the added disk

fdisk /dev/sdb

After entering this command, the following picture will appear. Just follow the operation command

The company server Linux server needs to be expanded. Let’s organize and record it.

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

The company server Linux server needs to be expanded. Let’s organize and record it.

Add the newly added volume to the volume group centos through vgextend

vgextend centos /dev/sdb1

View volume group free block Free PE

vgdisplay

The company server Linux server needs to be expanded. Let’s organize and record it.

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

The company server Linux server needs to be expanded. Let’s organize and record it.

xfs_growfs /dev/mapper/centos-root

The company server Linux server needs to be expanded. Let’s organize and record it.

df -hl View expansion status

The company server Linux server needs to be expanded. Let’s organize and record it.

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!

Statement:
This article is reproduced at:lxlinux.net. If there is any infringement, please contact admin@php.cn delete