Operations on the Xfs File System in CenOS7
Xfs is the default file system type of CentOS7.0. Different file system types have different creation, check, and adjustment commands.
Adjust the Xfs partition size (only increase ):
Lvextend-L 120G/dev/mapper/centos-root # increase to 120G
Lvextend-L + 20G/dev/mapper/centos-root # increase by 20G
Xfs_growfs/dev/mapper/centos-root # execute the adjustment
Note: The Adjustment Command for ext2/ext3/ext4 is resize2fs, as follows:
Lvextend-L 120G/dev/mapper/centos-root # increase to 120G
Lvextend-L + 20G/dev/mapper/centos-root # increase by 20G
Lvreduce-L 50G/dev/mapper/centos-home # reduce to 50G
Lvreduce-L-8G/dev/mapper/centos-home # reduce 8G
Resize2fs/dev/mapper/centos-root # execute the adjustment
Repair command:
Xfs_repair/dev/sdb1
Note: The repair commands for Jfs, Ext2, and Ext3 are as follows:
Fsck. jfs-y/dev/sdb1
Fsck. ext2-y/dev/sdb1
Fsck. ext3-y/dev/sdb1
Problems encountered during adjustment:
1. Run the mke2fs command on the Xfs file system and change it to ext2. You need to modify the file system type in the file/etc/fstab.
2. Different file system types correspond to different creation, check, and adjustment commands.