By default, the root device volume for an AMI backed by Amazon EBS is deleted when the instance terminates. To change the default behavior, set the DeleteOnTermination attribute to false using a block device mapping.
- To change the root device volume of an instance to persist at launch using the console
- Open the Amazon EC2 console.
- From the Amazon EC2 console dashboard, click Launch Instance.
- On the Choose an Amazon Machine Image (AMI) page, choose the AMI to use and click Select.
- Follow the wizard to complete the Choose an Instance Type and Configure Instance Details pages.
- On the Add Storage page, deselect the Delete On Termination check box for the root volume.
- Complete the remaining wizard pages, and then click Launch.
- Changing the Root Volume of an Instance to Persist Using the AWS CLI
- Use the run-instances command to preserve the root volume by including a block device mapping that sets its DeleteOnTermination attribute for to false.