Adjust the home partition in Centos 7 to expand the root partition.

Source: Internet
Author: User

Adjust the home partition in Centos 7 to expand the root partition.

Back up/home content, delete the logical volume of the/home file system, expand/root file system, create/home, and restore/home content

1. View partitions
df -h
2. Back up the home partition File
tar cvf /tmp/home.tar /home
3. Uninstall/home. If uninstallation fails, terminate the process of using the/home file system.
fuser -km /home/umount /home 
4. Delete the lv of/home
lvremove /dev/mapper/centos-home
5. Increase the lv of the extended/root instance by 800 GB.
 lvextend -L +800G /dev/mapper/centos-root
6. Extended/root file system
xfs_growfs /dev/mapper/centos-root
7. Recreate home lv
lvcreate -L 73G -n /dev/mapper/centos-home 
8. Create a File System
 mkfs.xfs  /dev/mapper/centos-home
9. Mount home
mount /dev/mapper/centos-home
10. Restore the home file
tar xvf /tmp/home.tar -C /home/cd /home/home/mv * ../

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.