5

df -h shows that only 71% of space used:

root@ip-xxx-xxx-xxx-xxx:/home/myuser# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          7.9G  5.3G  2.2G  71% /
udev             10M     0   10M   0% /dev
tmpfs            60M   88K   60M   1% /run
/dev/xvda1      7.9G  5.3G  2.2G  71% /
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           120M     0  120M   0% /run/shm

However nothing can create a file anymore, even MC does not start

#mc
Cannot create temporary directory /tmp/mc-root: No space left on device (28)

Php can not create files

PHP Warning:  fopen(/home/.../file.json): failed to open stream: No space 
left on device in /webdev/www/..../my.php on line 10

What could it be?

I use Debian 7 on Micro instance.

Pavel
  • 3,687
  • 2
  • 24
  • 34

1 Answers1

7

df -h shows you disk free space in human readable format. But this sounds like an inode table issue which you can check via df -i. For example, here is my inode usage on my own Amazon ECS micro instance running Ubuntu 12.04:

Filesystem     Inodes  IUsed  IFree IUse% Mounted on
/dev/xvda1     524288 116113 408175   23% /
udev            73475    379  73096    1% /dev
tmpfs           75540    254  75286    1% /run
none            75540      5  75535    1% /run/lock
none            75540      1  75539    1% /run/shm

Depending on the output, I bet your inode table is filled to the brim. The inode table logs each individual file data. Not just how much space. Meaning you might have 71% in use, but that 71% can be filled with thousands of files. So if you have tons of small files, you might still technically have free space, but the inode table is full so you have to clear that out to get your system fully functional again.

Not too clear on the best way to clear this up, but if you know of a directory that has tons of files you can toss away right away, I would recommend removing them first. For what it’s worth, this question & answer thread looks like it has some decent ideas.

Community
  • 1
  • 1
Giacomo1968
  • 24,837
  • 11
  • 67
  • 96
  • You are right: - rootfs Inodes 100%. I do have a lot of relatively small files. Does it mean I can not use space anymore because i ran out of inodes? This sounds awkward :) because I just freed 2 GBs deleting large files, and boom - i still can not create new files =) – Pavel Jun 12 '14 at 03:17
  • 1
    @Pavel “Does it mean I can not use space anymore because I ran out of inodes?” 100% yes. The inode table—an index for your files—is maxed out. You need to somehow clear out those small files. How? Your call. But like I said in the post, [this question & answer thread](http://stackoverflow.com/questions/653096/howto-free-inode-usage) has some ideas. If the files are just cached data, seriously consider tossing them. Or check `/var/logs/` and see of that makes a difference. – Giacomo1968 Jun 12 '14 at 03:22
  • 1
    No, not just files, those are images for catalog in DB. Anyway, thanks! I will figure something out since i know what causes problem now :) – Pavel Jun 12 '14 at 03:29