Hot Article
- Centos7 closes and restarts the system firewall and opens firewall ports
- How IID server uses Xshell to connect to Linux (centos) server
- BT panel forgets the background login URL, and the solution to the security entrance verification failure
- The php domain name points to ip, how to use the specified ip address to access a server in the url request domain name in curl mode
- How to purchase a dedicated server
- Error connecting to MySQL: Cant connect to MySQL server (10060)
Expand the root directory space of the CentOS system, and expand the home directory space to the root directory
- Author:Kevin
- Category:Server Maintain
- Release Time:2022-11-13
A lot of customers do not require the partition format when they purchase the IID.HK server and place an order. The default installation is the maximum capacity of the /home directory. After you deploy the software or have already deployed the software, you will find that the root directory space is full. Need to expand, then the following method is mainly to give /home space to the root directory, and then /home also uses the root directory space to store
1. Check the allocation and usage of space
Execute command:
df -h
2. Uninstall the /home partition
Note: Check first whether there are files in the home directory that need to be saved and backed up. If necessary, copy it out first and perform the following operations, otherwise the file will be lost
Execute the uninstall command:
umount /home
vi /etc/fstab #Comment out /home to avoid POST
3. Delete the lv where /home is located
Execute the following commands. Then enter y and press Enter
lvremove /dev/mapper/centos_hk02--5038ml--041--08-home
4. Check the physical volume
Execute the following commands:
vgdisplay
Focus on the content behind Free PE / Size, it will display
Free PE / Size 4505/ <17GiB similar content, the modified content is the space we can allocate
5. Expand the LV where /root is located
Execute the following commands:
lvextend -L +872.63G /dev/mapper/centos_hk02--5038ml--041--08-root
6. Expand /root space
Execute command:
xfs_growfs /dev/mapper/centos_hk02--5038ml--041--08-root
7, the final check is successful
df -h