Home > Article > Operation and Maintenance > Centos7 adjusts LVM size of XFS format
The following column centos Getting Started Tutorial will introduce to you how to adjust the LVM size of XFS format in centos7. I hope it will be helpful to friends in need!
Premise: XFS is the pre-installed operating system of centos7. XFS can only be expanded but not reduced, so you need to use the xfsdump / xfsrestore tool to back up and Restore data.
The results of this experiment are:
1, /dev/mapper/centos-home only retains 500G;
2, allocate the space separated from /home to / dev/mapper/centos-root.
The original space size is as shown below:
#step1: Install xfsdump package
yum -y install xfsdump
step2: Back up /home
xfsdump -f /home.xfsdump /homeplease enter label for this dump session (timeout in 300 sec)-> homeplease enter label for media in drive 0 (timeout in 300 sec)-> home
step3: Reduce the size of /dev/mapper/centos-home
Uninstall /home
# umount /home
Reduce the Logical Volume of /home to 5GB
# lvreduce -L 5G /dev/mapper/centos-homeDo you really want to reduce home? [y/n]: y
step4: Increase / Space size of dev/mapper/centos-root
# lvextend -l +100%FREE /dev/centos/root
Extend xfs space
# xfs_growfs /dev/centos/root
step5: Restore the contents of /home
Format the lvm of /home
# mkfs.xfs -f /dev/mapper/centos-home
Mount /home /dev/mapper/centos-home
# mount /home
Restore backup data to /home
# xfsrestore -f /home.xfsdump /home
The adjusted space size is as shown below:
For more centos related technical articles, please visit the centos system tutorial column!
The above is the detailed content of Centos7 adjusts LVM size of XFS format. For more information, please follow other related articles on the PHP Chinese website!