{"id":30009,"date":"2022-05-10T03:39:08","date_gmt":"2022-05-10T03:39:08","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=30009"},"modified":"2022-12-23T05:52:57","modified_gmt":"2022-12-23T05:52:57","slug":"aws-tutorial-auto-mount-ebs-volume-to-ec2-linux-instance-on-reboot","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/aws-tutorial-auto-mount-ebs-volume-to-ec2-linux-instance-on-reboot\/","title":{"rendered":"AWS Tutorial: Auto mount EBS Volume to ec2 Linux instance on Reboot"},"content":{"rendered":"\n<p>By default on every reboot, the EBS volumes other than root volume will get unmounted. To enable automount, you need to make an entry in the \/etc\/fstab file.<\/p>\n\n\n\n<p>Follow the steps given below to automount the EBS volume to ec2 instance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Back up the \/etc\/fstab file.<\/h2>\n\n\n\n<p>sudo cp \/etc\/fstab \/etc\/fstab.bak<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Open \/etc\/fstab file and make an entry in the following format.<\/h2>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">device_name mount_point file_system_type fs_mntops fs_freq fs_passno\n\nFor example,\n\n\/dev\/xvdf       \/newvolume   ext4    defaults,nofail        0       0<\/code><\/span><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Step 3: Execute the following command to check id the fstab file has any error.<\/h2>\n\n\n\n<p>sudo mount -a<\/p>\n\n\n\n<p>If the above command shows no error, it means your fstab entry is good.<\/p>\n\n\n\n<p>Now, on every reboot, the extra EBS volumes will get mounted automatically.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default on every reboot, the EBS volumes other than root volume will get unmounted. To enable automount, you need to make an entry in the \/etc\/fstab file. Follow the&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-30009","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/30009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=30009"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/30009\/revisions"}],"predecessor-version":[{"id":30010,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/30009\/revisions\/30010"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=30009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=30009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=30009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}