Linux – increase inode count in Linux

inodekernellinux

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?

Best Answer

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.