3

I have AWS EC2 instance with xvdb disk. After reboting my instance, I mount my disk but it seems to be empty. I think I lost all my data.

Does some one know how I can recover my data?

Many thanks

Raouf
  • 989
  • 2
  • 11
  • 15

1 Answers1

9

There are two different types of disk storage on an Amazon EC2 instance.

Amazon Elastic Block Store (EBS) is persistent disk storage. It retains data when an instance is stopped and started. Amazon EBS volumes can be moved between instances. It is also possible to Snapshot an EBS volume to create a point-in-time backup.

Instance Store is temporary block-level storage for an instance. The size of an instance store as well as the number of devices available varies by Instance Type. When an instance is stopped, the contents of an instance store disk is lost. However, if an instance is merely restarted, the contents is not lost because the same virtual machine continues to be used (it is just the OS that restarts).

The recommendation is always to use EBS volumes because they are persistent, can be resized and made faster, allow snapshotting and can be moved between instances.

The benefit of using instance store is that they are faster (being directly attached to the host computer) and incur no additional charge. (They are actually more of a historical artefact, since they predate EBS.)

As to how to recover your data... If it was an EBS volume, the data would not have disappeared. If it was instance store, merely restarting the instance would not have lost your data. So, it is a mystery as to why/how it disappeared. Regardless, there is no way to recover the data unless you were using EBS and previously took a Snapshot.

Ben Butterworth
  • 22,056
  • 10
  • 114
  • 167
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • 1
    This has happened to me even though my storage volume is EBS. Is there some kind of caching of files that happen before they are written to the disk? – SSF Aug 25 '18 at 09:31