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?

已提问 2 年前479 查看次数
1 回答
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 Snapshots[0].State === 'completed'

before creating a volume from the snapshot can ensure t

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则