我的 EC2 运行 CentOS 7 HVM 社区镜像,默认为 xfs 文件系统,我有一个 10GB 的根卷,在分离 > 创建快照 > 重新附加到/dev/sda1 后我扩展到 15GB 但我注意到我不必运行任何类型的调整大小命令,就像我们必须运行 resize2fs 和 ext 文件系统一样,分区现在显示 15GB,无需执行任何操作。虽然有一个命令 xfs_growfs 但即使这样我也没有运行。
那么,这是 xfs 在 EC2 世界(和其他世界)中扩展的正常行为,还是其他?
问候, 农场
最佳答案
这是 Amazon Linux AMI 上的正常行为。
来自 Amazon Linux AMI 2014.03 Release Notes :
Cloud-Init 0.7.2
Cloud-Init has been updated to the 0.7 series, adding a number of useful features. One example is dracut-modules-growroot, which automatically resizes your root filesystem on boot.
我注意到 CentOS 7 (x86_64) with Updates HVM说:
Starting with CentOS-7 we now include cloud-init support in all CentOS AMI's
因此,您的磁盘镜像可能正在使用此版本的 cloud-init
来自动调整大小。
请注意,Amazon Linux AMI 基于 CentOS,因此您可能希望使用它们而不是 CentOS AMI,因为它们由 AWS 直接更新。
关于linux - CentOS7 的 EC2 根卷扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30395227/