扩展根分区的AWS EC2分区、AWS

2023-09-11 09:20:47 作者:祝你长命百岁.

我创建了一个公共VPC,然后添加了一堆节点给它,这样我可以使用它的火花集群。不幸的是,他们都有一个分区设置,看起来像下面这样:

I created a public VPC and then added a bunch of nodes to it so that I can use it for a spark cluster. Unfortunately, all of them have a partition setup that looks like the following:

ec2-user@sparkslave1: lsblk
/dev/xvda 100G
/dev/xvda1 5.7G /

我安装在这些机器顶部的云管理器,所有的节​​点只有1G留给HDFS。如何扩展的分区,这样,它占用了所有的100G的?

I setup a cloud manager on top of these machines and all of the nodes only have 1G left for HDFS. How do I extend the partition so that it takes up all of the 100G?

我试图创建的/ dev / xvda2,然后创建一个卷组,添加了所有的/ dev / xvda *到它,但为/ dev / xvda1没有得到补充,因为它的安装。我无法从现场CD在这种情况下启动,这是在AWS上。我也试过resize2fs中,但它说,根分区已经占用了所有的可用块,所以它不能被调整。我该如何解决这个问题?如何避免以后发生这种问题呢?

I tried created /dev/xvda2, then created a volume group, added all of /dev/xvda* to it but /dev/xvda1 doesn't get added as it's mounted. I cannot boot from a live CD in this case, it's on AWS. I also tried resize2fs but it says that the root partition already takes up all of the available blocks, so it cannot be resized. How do I solve this problem and how do I avoid this problem in the future?

谢谢!

推荐答案

我不认为你可以调整正在运行的根卷。这是你如何去增加根大小:

I don't think you can just resize the running root volume. This is how you'd go about increasing the root size:

创建您的当前根卷的快照 创建的大小,你想要这个快照新卷(100G?) 停止实例 拆下旧的小容量 附加新的更大的音量 启动实例