0

So, the story is a bit long... but in a nutshell: I had a ec2 microinstance and I lost the connection with it by doing, installing and running whereami (silly me). Then I took a snapshot of the instance and created a volume from it. Then I created a new micro instance and added that volume I got from the one I broke, so now this new instance has two drives sda1 (by default) and sdf (which is the one I added), I atached it from the AWS panel and now I'd like to mount it on my new instance, but I cannot get it. I installed the AWS complement for it sudo apt-get install ec2-api-tools ec2-ami-tools but even know it fails. I tried ec2-attach-volume volume_id -i instance_id -d device like this:

ec2-attach-volume vol-4d826724 -i i-6058a509 -d /dev/sdf

But now it asks me for a key: Required option '-K, --private-key KEY' missing (-h for usage)

And I am quite stuck on this... Of course I do not want to format the drive I'm adding because I want to recover the information it has.

Watchmaker
  • 4,908
  • 1
  • 37
  • 38

1 Answers1

0

If you have already attached the volume from the AWS Management Console, you don't need to run ec2-attach-volume. You just need to mount it. You can find instructions here.

If you get a message saying that the device does not exist, see this answer.

Community
  • 1
  • 1
David Levesque
  • 22,181
  • 8
  • 67
  • 82
  • OK, I think I got it... I was beating around the bushes far too much. So I just created a folder and mounted there my volume, without formatting it. In detail, I saw with `df -h` that my main volume was /dev/xvda1 even-though in the panel of AWS was called /dev/sda1 So I did: `sudo mkdir /mnt/disk2` `sudo mount /dev/xvdf /mnt/disk2` And was solved. I found inspiration here: http://resources.arcgis.com/en/help/main/10.1/index.html#//00rq00000054000000 But remember not to format the volume with `mkfs` if you do not want to lose all the data. – Watchmaker Sep 30 '13 at 19:49