本文介绍了AWS ec2根卷增加:在AWS ubuntu实例上扩展弹性根卷不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经按照 aw doc扩展弹性根卷 并让我的根卷大小从8 GB增加到20 GB,我已使用lsblk确认了.

I've followed aws doc for expanding elastic root volume and got my root volume size increased from 8 GB to 20 GB, which i confirmed using lsblk.

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTxvda 202:0 0 20G 0 disk└─xvda1 202:1 0 8G 0 part /

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTxvda 202:0 0 20G 0 disk└─xvda1 202:1 0 8G 0 part /

但是更新的大小并没有反映在df -h命令中,即使在我使用sudo resize2fs /dev/xvda1命令显式调整设备大小之后,因为我的文件系统类型是ext4,但我使用sudo file -s /dev/xvd*命令进行了检查. sudo resize2fs /dev/xvda1命令给出以下输出:-

But updated size not reflecting in the df -h command, even after i explicitly resize the device using the sudo resize2fs /dev/xvda1 command as my file system type is ext4 which i checked using sudo file -s /dev/xvd* command. sudo resize2fs /dev/xvda1 command giving below output :-

让我知道,我需要做些什么才能使OS提取卷中的大小.

Let me know, what i need to do for OS to pickup the size in my volume.

谢谢

推荐答案

/dev/xvda1是20 GiB设备上的8 GiB分区,该卷上没有其他分区.在这种情况下,必须为调整大小进行分区使用卷上的剩余空间.

/dev/xvda1 is an 8 GiB partition on a 20 GiB device and there are no other partitions on the volume. In this case, the partition must be resized in order to use the remaining space on the volume.

调整分区大小后,可以扩展文件系统(通过sudo resize2fs /dev/xvda1)以占据分区上的所有空间.

After you resize the partition, you can extend the file system (via sudo resize2fs /dev/xvda1) to occupy all of the space on the partition.

这篇关于AWS ec2根卷增加:在AWS ubuntu实例上扩展弹性根卷不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-28 05:28
查看更多