Amazon EC2: No space left on device
So a funny thing happened today at out pre-production environment. I was performing our pre-big-PR deployment when a beautiful error was shown in my terminal:
|
|
What?! How could that be possible. I know that our environment don’t have a lot of bytes for us to play with but having the storage already full with our database and other services outside this machine just wasn’t possible. And I was right.
|
|
What?! Now I sure don’t understand a thing. I was laughing hysterically when my brain just started working as I remembered an old friend: the inode.
|
|
F**k you. Our deploys are made using “isolated” builds. That is, we reinstall pip/bower requirements for every build. So each build take about ~50k inodes, and we keep some in case some rollback is needed, but of course, keeping two months old builds wasn’t needed at all, so I made a script that just deletes builds older than two weeks and our poor thing was happy again.
To search which folder of your server is eating the inode limit, you can run this command:
|
|
This will show the path name and the inode count, keep going inside dirs to get some detailed input, once found, just delete the files that are causing havok.