Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to replace root ebs volume with another root ebs volume? [closed]

I accidentally formatted my system and the access keys to the ec2 volume were also deleted. So I stopped the instance and detached the ebs volume.
However I am not able to attach it to another ec2 instance as root(/dev/sda1). Can anyone please guide me through it? All my data and server files are there in the volume.
I mounted the first ebs volume and on the 2nd instance and browsed the files in there. They are all intact. If it cannot be mounted on as root volume, I need a way to get all the mysql data from the volume as there are a number of wordpress websites hosted on it. I can access the wordpress files but I dont know how to get the database from the instance.
Any of the solutions will save my life... Thank you very much

like image 572
Rajesh Kumar Padhy Avatar asked Feb 07 '16 19:02

Rajesh Kumar Padhy


1 Answers

What you need to do:

  1. Stop the instance
  2. Detach the current root EBS
  3. Attach you new EBS under /dev/sda1 (for Linux) and /dev/xvda (for Windows)
  4. Start your instance

Technically that's it. In case of problems, you can always attach the EBS as non-rooted EBS (such as /dev/sdb) and browse the files and fix the error if possible.

like image 187
Avihoo Mamka Avatar answered Sep 21 '22 17:09

Avihoo Mamka