0

Today I can not access my instance by ssh, it seems all services were stopped.

I decided to attach current volume to a new instance to access the data and recover them. However I can not mount the old volume to new instance.

Here is what I have done:

  • Create new instance.
  • Detach old volume from its own instance.
  • Attach old volume to new instance (it automatically rename from sdf to xvdf).

Mounting:

mkdir /oldpartition
mount /dev/xvdf2 /oldpartition

The above code doesn't work, it throws mount: wrong fs type, bad option, bad superblock on /dev/xvdf2

Other information:

fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/xvda: 10.7 GB, 10737418240 bytes, 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt


#         Start          End    Size  Type            Name
 1         2048         4095      1M  BIOS boot parti
 2         4096     20971486     10G  Microsoft basic
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/xvdf: 16.1 GB, 16106127360 bytes, 31457280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt


#         Start          End    Size  Type            Name
 1         2048         4095      1M  BIOS boot parti
 2         4096     31457246     15G  Microsoft basic

Sorry if this is a stupid question, but I'm a Linux newbie.

Any help will be appreciated, thanks!

1

You need to perform the following steps in order to recover data from stopped EC2 Linux instance.

1. Stop the EC2 Linux Instance
2. Detach the Root Volume
3. Launch a new Temporary Instance. We need to create a new EC2 instance with exact same settings and in the same availability zone.
4. Select same Security Group that is attached to the original instance
5. Attach the Root Volume to New Instance
6. Mount the original root volume to /mnt directory of a new temporary instance.

Before starting this exercise, we need to note down the following key information:

Instance ID, AMI ID, and Availability Zone of original Instance
Name of Root Device volume such as /dev/sda1
Volume ID of Root Volume
| improve this answer | |
  • I able to solve my problem cause wrong permission so I can mount the volume properly. Anw thank you for your reply. – trinvh Sep 29 '17 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.