恢复AWS Snapshot并使用它

时间:2022-09-19 06:51:54

I have a snapshot and I can start a new EC2 and attach it but I cannot access the snapshot on the EBS drive without formatting it which destroys the data. Here is the command list I am using:

我有一个快照,我可以启动一个新的EC2并附加它,但我不能访问EBS驱动器上的快照而不格式化它会破坏数据。这是我正在使用的命令列表:

cat /proc/partitions
sudo mke2fs -F -t ext4 /dev/xvdf
sudo mount /dec/xvdf /data

This works but the EBS is empty due to the mke2fs.

这有效,但由于mke2fs,EBS是空的。

How can I just mount the EBS snapshot and hence use it under /data?

如何才能挂载EBS快照,从而在/ data下使用它?

1 个解决方案

#1


Don't use mke2fs. As you have observed, that reformats the volume. If, for some reason, you don't think you can otherwise mount it, you may be mounting the wrong logical entity.

不要使用mke2fs。正如您所观察到的那样,重新格式化了音量。如果由于某种原因,您认为无法以其他方式安装它,那么您可能正在安装错误的逻辑实体。

Identify the device or partition with lsblk and then mount it, as above.

使用lsblk识别设备或分区,然后安装它,如上所述。

If there are partitions, you need to supply the partition, not the device, as an argument to mount.

如果存在分区,则需要提供分区而不是设备作为mount的参数。

/dev/xvde  # device
/dev/xvde1 # first partition

#1


Don't use mke2fs. As you have observed, that reformats the volume. If, for some reason, you don't think you can otherwise mount it, you may be mounting the wrong logical entity.

不要使用mke2fs。正如您所观察到的那样,重新格式化了音量。如果由于某种原因,您认为无法以其他方式安装它,那么您可能正在安装错误的逻辑实体。

Identify the device or partition with lsblk and then mount it, as above.

使用lsblk识别设备或分区,然后安装它,如上所述。

If there are partitions, you need to supply the partition, not the device, as an argument to mount.

如果存在分区,则需要提供分区而不是设备作为mount的参数。

/dev/xvde  # device
/dev/xvde1 # first partition