I have a Linux MIPS router with 2.4.17 kernel. Root fs is a tmpfs and /rom is a cramfs. There is 4MB free memory and 3MB free on tmpfs.

I can create a few new empty files, but the next ones fail with "not enough space". However, I can append 1MB of data to an existing file. So my trouble is in inode count.

And my questions:

  1. Is there any way to dynamically increase inodes?
  2. If I can't increase it dynamically - Where can I increase it in kernel sources?
  • What does df -i say? – womble Nov 17 '09 at 14:42
  • df in busybox does not have -i option – vlad Nov 17 '09 at 14:53
  • vlad: What about the stat command, is there a stat command that supports -f option? then just stat -f <mountpoint> . If not and you can bang out some c and cross compile to mips, you can maybe use the statfs() or family calls yourself? – Kyle Brandt Nov 17 '09 at 15:18

If the inode count is your actual issue, you can increase the amount of available inodes for the tmpfs filesystem with the nr_inodes mount option. If you set nr_inodes=0 , then there will be unlimited inodes.

All this information is in the tmpfs kernel documentation.

See womble's answer for remount example. For boot, you will need to edit your fstab, or whatever does this for your particular Linux build so future mounts are handled correctly.


You can set the number of inodes available in a tmpfs with the nr_inodes mount option. To do this live, you can just run:

mount -o remount,nr_inodes=<bignum> /tmp

I suspect that setting this number very, very large will result in a lot of memory consumption, so be careful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.