Amazon-web-services – increase the number of inodes on AWS EBS

amazon ec2amazon-web-servicesinode

I need to have an EC2 machine that stores some million small files on 20Gb.

in the meadle of the process of creating the files I get this issue No space left on device. There is free disk but no inodes.

The problem is that I don't understand how to create a machine (with CloudFormation) to solve this problem. This is both a Linux and AWS missing knowledge issue.

Can someone help me with this issue?

Best Answer

I'd do something like this

  1. make a seperate new EBS volume. Attach it to the EC2. See http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html
  2. format the new volume as ext4 for many inodes, see this answer How to store one billion files on ext4?
  3. add mount point to fstab and mount it

The directories under the mount point will be able to handle more small files

For CloudFormation add the volume to the CloudFormation template as described here

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volumeattachment.html

and add the mkfs command to your cloud init scripts

Related Topic