While working on linux boxes system admin usually get this error “No Space left on device” While df commands shows lot free space on the same partition or device. In my scenario i have Apache based application running on CentOS , i also face the same problem.
Follow the below steps to solve this problem
Step:1 Identify inodes information
To get inodes information of all the flie system , use below command
# df -i
To get inode information for a particular file system , use below command :
# df -i /dev/mapper/my--vg-my--lv
As we can see in the above output that all the inodes of the filesystem (/dev/mapper/my—vg-my–lv) has been consumed that’s why I am getting no space left on the device while lot free space is available.
Note : We can also get inode information of a filesystem using tune2fs command , as show below :
# tune2fs -l /dev/mapper/my--vg-my--lv
Step:2 Identify obsolete or unnecessary files on the file system.
Find all the obsolete or unnecessary files and delete them using rm command. After deleting files then we can create files and directories.
Note : There is no way to increase the number of inodes on a file system once it has been created