Skip to content

Disk space getting full quickly

0

Dears,

I'm running bintami wordpress on ec2 for the last 5 years, recently, the server database crashed for disk space issue, and it won't come up.

I'm regularly monitoring the space using df -h and it gives me 60% free on root. however, during the application crash I ran df -i and I got that root is 100% full.

I increased the disk by 10gb more and extend the root volume and the application came up smoothly (it was 20gb), but i noticed that the disk started to grow 1% per hour.

I have Three questions please.

  1. what is the difference between -h and -i ?
  2. how can I know, which directory is consuming more storage? regards,
asked 2 years ago992 views
2 Answers
1

df -h shows disk space usage and available space in GB/MB.

df -i shows inode usage, inode are data structures that store metadata about files. Every single file or directory uses one inode, regardless of its size.

If df -i is showing 100% full but df -h showing some free disk space that means you have free disk space but inodes are exhausted. There must be some process which is continuously creating multiple but very small size files that has been eating all available inodes. You can look at the inode count at directory level by this command - sudo ls -idl /*

Infact run it with watch to find which directory is having growing inodes. watch -n5 sudo ls -idl /*

AWS
answered 2 years ago
EXPERT
reviewed 2 years ago
0

I understand your concern about disk space issues on your EC2 instance running Bitnami WordPress. Let me address your questions:

  1. The difference between df -h and df -i:
  • df -h shows disk space usage in a human-readable format, displaying used and available space in gigabytes (GB) or megabytes (MB).
  • df -i shows inode usage. Inodes are data structures that store metadata about files. Each file or directory uses one inode, regardless of its size. When inodes are exhausted, you can't create new files even if you have free disk space.
  1. To identify which directory is consuming more storage, you can use the du command. Here are some helpful commands:
  • To see the size of directories in the root filesystem: sudo du -sh /*

  • To find the largest directories/files: sudo du -a / | sort -n -r | head -n 20

These commands will help you identify which directories or files are taking up the most space.

Regarding your disk space growing quickly, this could be due to various reasons such as:

  • Rapid content creation in WordPress
  • Large log files
  • Database growth
  • Temporary files accumulation

To address this, consider:

  • Regularly cleaning up old logs and temporary files
  • Optimizing your database
  • Monitoring and limiting file uploads
  • Setting up log rotation

If the issue persists, you may need to investigate further by analyzing specific application logs or database growth patterns.

Sources
How do I know the amount of data used in a volume attached to EC2 instance?? | AWS re:Post
EC2 Storage increased in AWS but not showing in Linux server | AWS re:Post

answered 2 years ago
EXPERT
reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.