1

Data deleted from /mnt directory after stop and start EC2 instance

[root@localhost opt]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            9.7G  1.4G  7.8G  15% /
none                  1.9G     0  1.9G   0% /dev/shm
/dev/xvdb             394G  199M  374G   1% /mnt

I place my data in /mnt .I stop instance yesterday . Afetr starting the instance today ,I didnt find any data form /mnt . I have another from /opt .

How can i recover that data from /mnt .

If /mnt is Temporary mounting point .Then how can i use these all space

Srinivas Nallapati
  • 135
  • 1
  • 3
  • 11

3 Answers3

4

On EC2, /mnt directory is mounted to ephemeral storage.

After reboot or instance stop/start, all data is lost.

Please refer to this post.

Community
  • 1
  • 1
Roman Newaza
  • 10,151
  • 9
  • 50
  • 73
4

It is a common misconception that a reboot/restart will wipe the ephemeral storage - this isn't true.

You can try it yourself and see.

What will is a stop/start - that actually deprovisions your VM, and then moves it to another host machine - which will have wiped ephemeral drive(s) and then starts it up with your root ebs (at least) attached. Stop/start and reboot are often conflated - but they are very different things here.

Michael Neale
  • 18,590
  • 18
  • 72
  • 106
1

/mnt should really just be used for ephemeral data storage that is not critical if instance needs to be restarted. This is actually well suited for things such as local on-disk cache, temporary data storage, etc. as this ephemeral storage will oftentimes perform better from an I/O standpoint than say an EBS volume mount. Just understand that you should only place non-critical data there.

Mike Brant
  • 66,858
  • 9
  • 86
  • 97