Yesterday, I installed a system for people. I forgot to slide the automatic partition. The size of the automatic partition is speechless and not suitable for daily use.
We can see that the system automatically allocates all the remaining space to the home partition, but we usually use the space under the root partition, so we have to move more space under home to the root partition
First, you need to back up the contents of the home folder and execute the command:
cp -r /home/ homebak/(if the new system does not create other accounts, it can not be backed up.)
umount /home (if there is a “home” process, use “fuser – M – V – I – K / home” to terminate the process under “home”, and finally use “umount / home” to unload / home.)
Delete home sector:
Add 100g to the sector where root is located
lvextend -L +100G /dev/mapper/centos-root
Expand the root file system:
Re create Home Lv:
lvcreate -L 64G -n home centos(the 64g here is the original minus the removed space, not random filling)
To create a file system:
Mount @ home:
mount /dev/centos/home /home
Return the backup to home and delete the backup;
The above is the whole content of this article, I hope to help you learn, and I hope you can support developer more.