## EC2 Missing Disk Space

This morning I created a r3.xlarge spot instance on EC2. The job I’m planning on running requires a good wad of data to be uploaded, which is why I chose the r3.xlarge instance: it’s cost effective and, according to AWS, has 80 Gb of SSD storage.

So I was a little surprised when I connected to the running instance and found that the root partition was only around 8 Gb. This is what I did to claim that missing disk space.

Swathes of shared memory, but that wasn’t going to help. Mulling this over for a moment, it occurred to me that perhaps the remaining space had simply not been mounted.

Indeed, /dev/xvdb/ had masses of untapped space!

I used fdisk to create a partition.

Just follow the steps in the fdisk menu to create a new primary partition. When you’re done use lsblk to check that all is well.

We see that there is a new partition at /dev/xvdb1 but that it is currently not mounted.

Then created an ext4 partition and mounted it.

Boom! Space issues resolved.

It’s also worth mentioning that you can actually amount the full disk during the instance creation process. However, if you only spot the missing space after the fact then this will do the trick.