By using AWS re:Post, you agree to the Terms of Use
/Why snapshot file are 0 bytes. Files exist when mounted but take up no space on disk and have no content./

Why snapshot file are 0 bytes. Files exist when mounted but take up no space on disk and have no content.

0

I am making a Snapshot of a mounted volume to a path called /home/ec2-user/restore - when I use the web interface all works as expected.

When I use AWS CLI to create a new volume from the snapshot and mount the new volume to /home/ec2-user/restore again, the new volume from the snapshot has all the files that are supposed to be there, but the files have nothing in them.

Do you know why a snapshot would omit all the data within the files?

1 Answers
0

The reason the files were 0 bytes was because the snapshot had not completed yet.

Doing first:

aws ec2 describe-snapshots --snapshot-id ${snapshotId}

and waiting for Snapshots0.State === 'completed'

before creating a volume from the snapshot can ensure t

AWS-User-6294425
answered 3 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions