0

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 and this. 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 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?

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 :)

1
  • 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...
    – Moshisho
    Oct 7 '19 at 6:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.