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

4

5

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.

Shondrashone answered 12/5, 2010 at 8:48 Comment(1)
Hope this help a bit understanding what might be wrong. I tried an existing Amazon snapshot to create EBS volume. Step: 1. From aws console I created a new volume using amazon snapshot "snap-63cf3a0a -- DBpedia (Linux)" 2. Attached it with a fedora 8 machine "ami-48aa4921:ec2-public-images/fedora-8-i386-base-v1.10.manifest.xml" 3. logged in to this machine and mounted the device, using following commands: # yes | mkfs -t ext3 /dev/sdf # mkdir /mnt/ebs-store # mount /dev/sdf /mnt/ebs-store But still I am not seeing any data in /mnt/ebs-store directory.Shondrashone
S
5

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.

Shondrashone answered 13/5, 2010 at 10:47 Comment(0)
M
2

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).

Myriam answered 12/5, 2010 at 9:46 Comment(1)
I order to mount EBS, attached with a instance, followed following steps: yes | mkfs -t ext3 /dev/sdf mkdir /mnt/ebs-store mount /dev/sdf /mnt/esb-store And then created text files in "/mnt/esb-store" and created a snapshot using AWS Console. I think if I mount original EBS and snapshot EBS on same EC2 instance, it's not different from mounting both EBS on different EC2 instances.Shondrashone
T
0

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

Tailing answered 30/9, 2017 at 1:2 Comment(0)
B
0

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.

Bil answered 26/12, 2022 at 11:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.