Answers: <p>That <em>150GB disk</em> that <code>r5ad.xlarge</code> comes with is known as <em>ephemeral storage</em> - its content is wiped when you stop the instance. If you need persistent storage you can use <code>r5a.xlarge</code> that doesn't have the ephemeral storage disk and simply give it a bigger EBS disk. </p>
  
  <p>Either you can increase the size of the root disk during instance creation or create another EBS and use that. EBS volumes are persistent, they don't go away when you <em>stop</em> the instance (they may be deleted if you <em>terminate</em> the instance though). </p>
  
  <p>If you don't see the previous content of EBS volume after a reboot make sure you're properly mounting it during boot (hint: <code>/etc/fstab</code>).</p>
  
  <p>Hope that helps :)</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-10-07T06:48:26.023Z
Answers: Thanks for the answer, however, even though I attached a EBS and verified mounting without errors, still it was wiped after _stop_. So I'm not sure why is it...
Answers: Moshisho
Answers: CC BY-SA 4.0
Answers: 2019-10-06T22:32:03.113Z
Answers: 2019-10-06T22:32:03.113Z
Answers: MLu
Body: <p>I created an EC2 instance of <code>r5ad.xlarge</code> and installed Jenkins on it. However, after a few jobs I configured and ran I saw a warning about no space left. Then realised Jenkins was installed on 8 GB drive and that it's a non-persistent drive.</p>
  
  <p>1st try: After reading on the subject I changed the 2 volumes of the machine with <code>modify-instance</code> to be <code>DeleteOnTerminate</code> to false and copied Jenkins to the bigger disk and configured auto-mount, following <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html" rel="nofollow noreferrer">this</a> and <a href="https://linuxtechlab.com/simple-way-to-change-home-directory-of-jenkins-server/" rel="nofollow noreferrer">this</a>. Then I stopped and started the machine and everything got deleted from the disk.</p>
  
  <p>2nd try: So I defined a new EBS volume (SSD gp2)(with <a href="https://devopscube.com/mount-ebs-volume-ec2-instance/" rel="nofollow noreferrer">this</a> article) and attached it to the instance. Again with <code>DeleteOnTerminate=false</code>, formatted then setup auto mount and copied Jenkins directory. Stopped and Started the machine, again everything gone...</p>
  
  <p>What am I doing wrong? How do you make the attached volume persistent?</p>
  
Tags: <amazon-web-services><amazon-ec2><storage><amazon-ebs>
Title: How to setup a permanent storage volume for EC2 instance?
UserDisplayName: Moshisho
ThreadText: # How to setup a permanent storage volume for EC2 instance?
  
  (Asked by: username_0 on 2019-10-06)
  
  I created an EC2 instance of `r5ad.xlarge` and installed Jenkins on it. However, after a few jobs I configured and ran I saw a warning about no space left. Then realised Jenkins was installed on 8 GB drive and that it's a non-persistent drive.
  
  1st try: After reading on the subject I changed the 2 volumes of the machine with `modify-instance` to be `DeleteOnTerminate` to false and copied Jenkins to the bigger disk and configured auto-mount, following [this](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html) and [this](https://linuxtechlab.com/simple-way-to-change-home-directory-of-jenkins-server/). Then I stopped and started the machine and everything got deleted from the disk.
  
  2nd try: So I defined a new EBS volume (SSD gp2)(with [this](https://devopscube.com/mount-ebs-volume-ec2-instance/) article) and attached it to the instance. Again with `DeleteOnTerminate=false`, formatted then setup auto mount and copied Jenkins directory. Stopped and Started the machine, again everything gone...
  
  What am I doing wrong? How do you make the attached volume persistent?
  
  **Tags:** amazon-web-services, amazon-ec2, storage, amazon-ebs
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-10-06. Score: 2
  
  That *150GB disk* that `r5ad.xlarge` comes with is known as *ephemeral storage* - its content is wiped when you stop the instance. If you need persistent storage you can use `r5a.xlarge` that doesn't have the ephemeral storage disk and simply give it a bigger EBS disk.
  
  Either you can increase the size of the root disk during instance creation or create another EBS and use that. EBS volumes are persistent, they don't go away when you *stop* the instance (they may be deleted if you *terminate* the instance though).
  
  If you don't see the previous content of EBS volume after a reboot make sure you're properly mounting it during boot (hint: `/etc/fstab`).
  
  Hope that helps :)
  
  > **Comments:**
  > **username_0**: Thanks for the answer, however, even though I attached a EBS and verified mounting without errors, still it was wiped after _stop_. So I'm not sure why is it...  
  
  ---
  
  