con*_*ior 2 amazon-ec2 amazon-web-services devops
我有一个t2.medium正在运行的实例,其容量4GB为RAM和。25GBEBS
该实例当前正在运行Apache服务器、wordpress 应用程序、mysql 服务器和 codeigniter 应用程序。
我不希望丢失任何数据。
如何将卷增加到 100GB?
我在这里找到了一篇文章,但我不确定这样做是否会导致所有数据丢失。
我们可以增加 ebs 卷,而无需分离卷或重新启动实例。最好创建 ebs 卷的快照,以防出现问题
用于创建快照
Go to your EBS volume list from your EC2 Dashboard.
Right click the volume.
Click Create Snapshot link.
Add the description value any thing is good here.
Add key : Name and value : snapshot-your-volume.
Click button Create Snapshot.
Run Code Online (Sandbox Code Playgroud)
增加尺寸
Right click on the volume you wish to increase.
Add your desired size; In our example type 40.
Click Modify.
You will get confirmation to extend OS file system.
Click Yes.
Run Code Online (Sandbox Code Playgroud)
完成修改卷后,您需要扩展操作系统文件系统才能看到增加的卷大小。
ssh into your instance
df -h -> will tell you the volume size
lsblk -> display information about the block devices attached to your instance
sudo growpart /dev/xvda 1
df -h -> to verify the size again
sudo resize2fs /dev/xvda1
Run Code Online (Sandbox Code Playgroud)
扩展文件系统的文档
| 归档时间: |
|
| 查看次数: |
2041 次 |
| 最近记录: |