{"id":9669,"date":"2022-10-03T17:00:42","date_gmt":"2022-10-03T11:30:42","guid":{"rendered":"https:\/\/www.skynats.com\/?p=9669"},"modified":"2025-10-23T17:04:45","modified_gmt":"2025-10-23T11:34:45","slug":"preventing-the-deletion-of-amazon-ebs-volumes","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/preventing-the-deletion-of-amazon-ebs-volumes\/","title":{"rendered":"Preventing The Deletion Of Amazon EBS Volumes"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Do you want to avoid having your Amazon EBS volumes deleted? You can rely on us.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As part of our&nbsp;AWS Support Services, we at Skynats help customers with a variety of <a href=\"https:\/\/aws.amazon.com\/\" target=\"_blank\" rel=\"noopener\">AWS<\/a> inquiries.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s see how our support technicians handle this problem.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-normal-font-size\" id=\"h-how-to-prevent-the-deletion-of-amazon-ebs-volumes\">How to prevent the deletion of Amazon EBS volumes?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The value of the DeleteOnTermination attribute for each attached EBS volume determines whether or not to keep the volume after an instance terminates.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The DeleteOnTermination attribute is by default set to False for all other volume types and to True for the root volume.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Change the root volume&#8217;s DeleteOnTermination attribute from True to False to prevent the root volume from being deleted when an instance terminates.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-normal-font-size\" id=\"h-how-can-you-launch-a-new-instance-with-the-deleteontermination-attribute-set-to-false\">How can you launch a new instance with the DeleteOnTermination attribute set to False?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s look at the steps our Support Techs took today to modify a console instance&#8217;s root volume so that it persists at launch.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, go to https:\/\/console.aws.amazon.com\/ec2\/ to launch the Amazon EC2 console.<\/li>\n\n\n\n<li>Next, choose Launch Instance from the console dashboard.<\/li>\n\n\n\n<li>After that, select an AMI from the Choose an Amazon Machine Image (AMI) page.<\/li>\n\n\n\n<li>The Configure Instance Details and Choose an Instance Type pages can be finished by following the wizard.<\/li>\n\n\n\n<li>Deselect the Delete On Termination check box for the root volume on the Add Storage page.<\/li>\n\n\n\n<li>Finish the last few wizard pages, and then select Launch.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">By looking at the root device volume&#8217;s details in the instance&#8217;s details pane, you can confirm the setting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Select the entry for the root device volume next to Block devices. Delete on termination is set to True by default.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Delete on termination is False if you alter the default behavior.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-normal-font-size\" id=\"h-how-do-you-set-the-deleteontermination-attribute-on-a-running-instance-to-false\">How do you set the DeleteOnTermination attribute on a running Instance to false?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the instance is already running, you can use the command line to set DeleteOnTermination to False.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the command as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --block-device-mappings file:\/\/mapping.json<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Include the following in mapping.json:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;\n{\n\"DeviceName\": \"\/dev\/sda1\",\n\"Ebs\": {\n\"DeleteOnTermination\": false\n}\n}\n]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Need help on Preventing The Deletion Of Amazon EBS Volumes?&nbsp;<a href=\"https:\/\/www.skynats.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener\">Contact<\/a>&nbsp;our technical support team.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do you want to avoid having your Amazon EBS volumes deleted? You can rely on us. As part of our&nbsp;AWS Support Services, we at Skynats help customers with a variety of AWS inquiries. Let&#8217;s see how our support technicians handle this problem. How to prevent the deletion of Amazon EBS volumes? The value of the [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[737],"class_list":["post-9669","post","type-post","status-publish","format-standard","hentry","category-blog","tag-deleteontermination"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/9669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=9669"}],"version-history":[{"count":1,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/9669\/revisions"}],"predecessor-version":[{"id":16235,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/9669\/revisions\/16235"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=9669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=9669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=9669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}