开发者

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

开发者 https://www.devze.com 2022-12-30 12:56 出处:网络
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.

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.

开发者_JAVA技巧

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, e.g. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消