所以我有以下设置:
[ec2-user@ip-172-31-9-177 ~]$lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 80G 0 disk
├─xvda1 202:1 0 6G 0 part /
└─xvda2 202:2 0 4G 0 part /data
我发现的所有教程都说使用xfs_growfs< mountpoint>但这没有效果,也没有-d选项:
[ec2-user@ip-172-31-9-177 ~]$sudo xfs_growfs -d /
meta-data=/dev/xvda1 isize=256 agcount=4, agsize=393216 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0
data = bsize=4096 blocks=1572864, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data size unchanged, skipping
我应该补充说我正在使用:
[ec2-user@ip-172-31-9-177 ~]$cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.0 (Maipo)
[ec2-user@ip-172-31-9-177 ~]$xfs_info -V
xfs_info version 3.2.0-alpha2
[ec2-user@ip-172-31-9-177 ~]$xfs_growfs -V
xfs_growfs version 3.2.0-alpha2
解决方法:
你有一个4GB xfs文件系统在4GB分区上,所以没有工作要做.
要克服,请使用parted扩展分区,然后使用xfs_growfs扩展fs.您可以使用parted rm而不会丢失数据.
# umount /data
# parted
GNU Parted 3.1
Using /dev/xvda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s
(parted) print
....
(parted) rm 2
(parted) mkpart
....
(parted) print
(parted) quit
# xfs_growfs /dev/xvda2
# mount /dev/xvda2 /data
完成.无需更新/ etc / fstab,因为分区号相同.