7
votes

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) I want to use old EBS volume with new instance and to stop old instance.

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

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

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

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

7) I want every old data on new instance.


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

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

1
We're going to need a bit more information to be able to answer this question. Was your previous instance a Micro instance, and if so, did you stop it, or did you terminate it? Was the old data on the EBS volume that was automatically created when you created your first instance, or on a separate EBS volume? Did you mount the old EBS volume on the new instance using mount? You can check by running df in an SSH shell. Can you show us the output of that df command?Daan
1) Yes both are micro instance of same zone, 2) I stopped old one, 3) It was on separate volume and 2nd instance also created a new volume but i attached both to the new instance, 4) I don't know how to mount old EBS volume to new instance but i have attached it through amazon control panel, 5) DF output is Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 8256952 961696 7211384 12% / tmpfs 305624 0 305624 0% /dev/shmMohd Shahid

1 Answers

4
votes

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

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.

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.