Nano %-bash: cannot create temp file for here-document: No space left on device

When I use cd + tab, comman line show this log,
and I use vim, when start text file, show,

E303: Unable to open swap file for "examples.desktop", recovery impossible

and quit(:q) text file, show this log

E138: Can't write viminfo file /home/nvidia/.viminfo.tmp!

I search this issue, it’s seem ubuntu space problem
But i show df -h

/dev/mmcblk0p1   59G   24G   33G  42% /
none            1.7G     0  1.7G   0% /dev
tmpfs           2.0G  4.0K  2.0G   1% /dev/shm
tmpfs           2.0G   35M  1.9G   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           396M   12K  396M   1% /run/user/120
tmpfs           396M     0  396M   0% /run/user/1000

All mount point have a lot of free space
How can I resolve this problem

I use “df -i”
this command is check Inode (file index)
no space means no idenx

% df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sdb1 640000 115018 524982 100% /
.
.
.

When I use deepstream-app config, enable gie-kitti-output-dir
It’s create a lot .txt file, and they are only 0KB
So I need to remove this log directory, and it work

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=1
gie-kitti-output-dir=./log_gie/
kitti-track-output-dir=./log/

Looks like the problem fixed by remove the log?

Yes, i remove deepstream gie log

[application]
gie-kitti-output-dir=./log_gie/ ← remove this directory

Some comments for people running into this in the future…

The ext4 file system is based on nodes. If you run out of total space it is obvious the disk is filled, but in the case of running out of inodes it may not be obvious. What you have are a lot of small files. Each file requires at least one inode even if the file is empty. A larger block size is efficient if the files are larger, but a smaller block size is more efficient if you know ahead of time you have a lot of smaller files. To see block size you can do something like this:

blockdev --getbsz /dev/mmcblk0p1

For the SD card, when you manually format it from another Linux system with mkfs.ext4 you can specify a smaller block size, e.g., 512 bytes (versus 4096…powers of 2).