将旧 EBS 卷挂载到新实例 - Amazon EC2 [英] Mounting Old EBS Volume to the new Instance - Amazon EC2

查看:23
本文介绍了将旧 EBS 卷挂载到新实例 - Amazon EC2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1) 我有一个实例,但 sudo 命令无法解决此实例上的一些错误所以我不得不创建一个新实例.

1) I had an instance and sudo commands were not working do to some mistakes on this instance so i had to create a new instance.

2) 我想将旧 EBS 卷与新实例一起使用并停止旧实例.

2) I want to use old EBS volume with new instance and to stop old instance.

3) 我创建了一个新实例(新的 EBS 卷是用新实例自动创建的)

3) I created a new instance (New EBS Volume is created automatically with new instance)

4) 我创建了旧卷的快照并附加了新实例.

4) I created snapshot of old volume and attached with new instance.

5) 所以两个 EBS 卷附加了新实例.

5) So two EBS volumes are attached with new instance.

6) 当我使用 SSH 登录到新实例时,我在任何地方都看不到旧数据.

6) When i login using SSH into new instance, i don't see old data anywhere.

7) 我想要新实例上的所有旧数据.

7) I want every old data on new instance.

我的问题是......如何在新实例中使用旧卷?

my question is..... how i can use old volume with new instance?

请帮助我..我从过去 10 小时开始一直在尝试:(..

please help me.. i am trying it from last 10 hours continuously :(..

推荐答案

您需要做的是将旧卷挂载到新实例上.转到 Amazon EC2 控制面板,然后单击卷"(在 Elastic Block Store 下).查看旧 EBS 卷的附件信息.这将类似于 (<实例名称>):/dev/sdg

What you need to do is mount the old volume on the new instance. Go to the Amazon EC2 control panel, and click "Volumes" (under Elastic Block Store). Look at the attachment information for the old EBS volume. This will be something like <instance id> (<instance name>):/dev/sdg

记下此处给出的路径,以便在上面的示例中为/dev/sdg.然后使用 SSH 并连接到您的新实例,然后键入 mkdir/mnt/oldvolume 然后 mount/dev/sdg/mnt/oldvolume(或任何在控制面板是).您的文件现在应该在 /mnt/oldvolume 下可用.如果这不能解决您的问题,请在完成所有这些操作后使用 df 命令的输出再次发布.

Make a note of the path given here, so that'd be /dev/sdg in the example above. Then use SSH and connect to your new instance, and type mkdir /mnt/oldvolume and then mount /dev/sdg /mnt/oldvolume (or whatever the path given in the control panel was). Your files should now be available under /mnt/oldvolume. If this does not solve your problem, please post again with the output of your df command after doing all of this.

因此,总结一下,要在实例上使用 EBS 卷,您需要使用控制面板(或 API 工具)将其附加到该实例,然后将其安装在实例本身上.

So, to recap, to use an EBS volume on an instance, you need to attach it to that instance using the control panel (or API tools), and then mount it on the instance itself.

这篇关于将旧 EBS 卷挂载到新实例 - Amazon EC2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆