What is the inode?
Inode is a data structure in a Unix-style filesystem that describes a file-system object such as a file or a directory. It may contain metadata information like file access time, permissions, etc.
Each filesystem or partition has its own set of inodes. To uniquely identify a file, you need both the inode and the device partition information.
If all the inodes in a filesystem are used up, the kernel can not create new files even when there is available free disk space. So, if you have ample free disk space but unable to create new files, check the inode usage for that partition.
To get the inode usage for active file system on your system.
$ df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/vda1 13640832 1487624 12153208 11% /
devtmpfs 232604 326 232278 1% /dev
tmpfs 235277 1 235276 1% /dev/shm
tmpfs 235277 555 234722 1% /run
tmpfs 235277 16 235261 1% /sys/fs/cgroup
/dev/loop0 146592 139 146453 1% /tmp
tmpfs 235277 1 235276 1% /run/user/0
How to count Inode usage
echo "Detailed Inode usage for: $(pwd)" ; for d in `find -maxdepth 1 -type d |cut -d\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf "$c\t\t- $d\n" ; done ; printf "Total: \t\t$(find $(pwd) | wc -l)\n"
Detailed Inode usage for: /home/daygeek
11 - 2g
46 - bash-insulter
140 - batstat
96 - betty
178 - .bundle
43114 - .cache
965 - .cargo
1870 - .config
156 - Desktop
3258 - Documents
186 - Downloads
60 - drivesync
3055 - .local
4058 - .mozilla
1568 - .npm
250 - Pictures
16492 - .rustup
146 - snap
64 - ssh-audit
1552 - Videos
159 - yay
Total: 77682