大网数据广告活动
服务器运维问答

backup/restore ec2 instance before o.s. update

· 52CE 我爱测

I have an EC2 instance with an EBS backed root volume. The OS hasn't been updated in some time and I'd like to remedy that, but I need a rollback plan in case the updates cause issues. I think I know what to do, but I was hoping …

问题原文

原帖链接 · jph · CC BY-SA 4.0

I have an EC2 instance with an EBS backed root volume. The OS hasn't been updated in some time and I'd like to remedy that, but I need a rollback plan in case the updates cause issues.

I think I know what to do, but I was hoping to have someone sanity check my plan before making changes. Does the following seem reasonable?

Update:

  1. Create snapshot of root volume; wait for it to complete.
  2. Update O.S.

Rollback:

  1. Create new volume from snapshot.
  2. Stop instance.
  3. Detach root volume.
  4. Attach volume created from snapshot as new root volume.
  5. Start instance.

Reasonable?

已采纳解答

原帖链接 · kenlukas · CC BY-SA 4.0

Yes, you have the gist of it. A couple of things to point out.

If you can shut off the server before you take the snapshot you're guaranteed to get all the data that may be cached for writing.

You can take a snapshot of an attached volume that is in use. However, snapshots only capture data that has been written to your Amazon EBS volume at the time the snapshot command is issued. This might exclude any data that has been cached by any applications or the operating system. If you can pause any file writes to the volume long enough to take a snapshot, your snapshot should be complete.

Second, the snapshot may not be available immediately. If you'd have to restore quickly you should wait for the snapshot to be out of the pending state.

Snapshots occur asynchronously; the point-in-time snapshot is created immediately, but the status of the snapshot is pending until the snapshot is complete (when all of the modified blocks have been transferred to Amazon S3), which can take several hours for large initial snapshots or subsequent snapshots where many blocks have changed

References

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-snapshot.html

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-10-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。