Disk Full Error on EC2

I tried following lesson 2 to create my own image classifier, but I keep running into an error (shown below) or some variant of it.

OSError: [Errno 28] No space left on device: ‘/tmp/pymp-bpxj14zc’
OSError: [Errno 28] No space left on device: ‘/tmp/pymp-t9ixsjmp’

I downloaded at most 100MB of images for my classifier. I’m guessing that Jupyter or something else is creating another isolated disk space for my notebooks.

Does anybody know how I can expand this amount of disk space or resolve this issue?

An easy way to resolve this is just to allocate a bigger disk when creating your instance. Under EBS in the sidebar on Amazon EC2 you can also find an option to expand the volume, but then you need to resize the partition etc from the command line, and I found it easier just to create a new instance with a larger disk.

Old thread, however I ran into this issue and found it easy to add more space to an existing EC2 instance.

In AWS ec2 console, go to Elastic Block Store / Volumes and click on Actions / Modify Volume

Increase Size to desired volume.


Now, grow the partition and extend the file system as detailed in this guide.

run lsblk to shows partition info.

Note: xvda has 150G available, however partition xvda1 only uses 75G of that.

run sudo growpart /dev/xvda 1

run lsblk again

Note: xvda has 150G available and xvda1 uses all of it.

run df -h to show file system info.

Note Initial state /dev/xvda1 is almost full :frowning:

run sudo resize2fs /dev/xvda1

Note We now have 74G of free space. Hoorah!