简体   繁体   中英

Why am I not seeing new content in an Amazon EBS volume created from an existing snapshot?

I created an EBS volume, attached and mounted it on an EC2 instance. Created few sample text files in the mounted directory and took a snapshot from the AWS console.

Problem is, when I create a new EBS volume using this snapshot and mount this new volume, I am not seeing the stored content (in snapshot).

What can be the issue? Is my data not going into the snapshot? Or is the newly created volume having any issue?

Thanks in advance.

Found the issue. Not a system admin, else I should have know this thing. Following command is flushing the data from the EBS volume.

yes | mkfs -t ext3 /dev/sdf

On an EBS volume, started using snapshot, don't run above command. Hope it this thread will help someone in future.

This should normally work. The only explication could be a mistake during the execution of the commands, eg that you created a file-system on the newly created volume instead simply mounting it (happened once to me).

The above answers are WRONG and will lead to data corruption. The steps above result in "inconsistent snapshots" which means the snapshots will contain a corrupted copy of the file system.

Linux and Windows caches file system data and metadata in memory. You have to flush the file system from memory, freeze all processes that write to disk, take the snapshot and then unfreeze. Review the document link below.

Note the best solution is to snapshot the volume during the reboot phase of an instance. This is the offically supported AWS recommendation.

Creating consistent EBS snapshots

don't mount the filesystem use sudo mount -0 nouuid devicename with the mounting point] sudo mount -o nouuid devicename(if it is other than root volume)mention the name /dev/xvdf using so your content will be present if you mount the filesystem which already has a uuid will overwrite and the data store on the volume created from the snapshot will be lost.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM