问题描述
我已经按照 aws 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 磁盘└─xvda1 202:1 0 8G 0 部分/
但是更新的大小没有反映在 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 :-
sudo resize2fs/dev/xvda1 resize2fs 1.42.12 (29-Aug-2014)文件系统已经有 2096635 (4k) 个块长.无事可做!
让我知道,我需要为操作系统做些什么来获取我的卷大小.
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 实例上扩展弹性根卷不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!