linux "No space left on device" disk space solution

 

When sometime, someone set up crontab regular tasks at work rules to save a certain period of a day, suggesting that "No space left on device", this time with df -h to check the disk, found that there is free space. What is the reason and how to troubleshoot? What can cause this to happen

 1.查看磁盘空间 [root@xmh ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 8.0G 3.2G 4.9G 39% / ##可以发现磁盘容量是空闲很多的 devtmpfs 1.7G 0 1.7G 0% /dev tmpfs 1.7G 0 1.7G 0% /dev/shm tmpfs 1.7G 8.7M 1.7G 1% /run tmpfs 1.7G 0 1.7G 0% /sys/fs/cgroup tmpfs 332M 0 332M 0% /run/user/0 2.查看inode空间 [root@xmh ~]# df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sda1 4193792 4193792 0 100% / #但是inode空间已满了 devtmpfs 422466 395 422071 1% /dev tmpfs 424923 1 424922 1% /dev/shm tmpfs 424923 473 424450 1% /run tmpfs 424923 16 424907 1% /sys/fs/cgroup tmpfs 424923 1 424922 1% /run/user/0 提示:当磁盘容量或inode容量任意一个不足时就都会提示No space left on device

3. Solution

#进入100%的目录删除无用的文件即可,比如日志... [root@jason /]# rm -rf /test/

#再次查看inode容量 [root@xmh ~]# df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sda1 4193792 25973 4167819 1% / #inode容量已恢复正常 devtmpfs 422466 395 422071 1% /dev tmpfs 424923 1 424922 1% /dev/shm tmpfs 424923 473 424450 1% /run tmpfs 424923 16 424907 1% /sys/fs/cgroup tmpfs 424923 1 424922 1% /run/user/0



补充两个命令:

Folders ordered by size
du -s * | sort -nr sort but the display is kb

du -sh * | sort -nr not the sort to display g or mb




First we must first explain what is the inode?

inode in linux, each file, regardless of size is how much will correspond to a inode, inode is designed to save a file properties, permissions, and a pointer (pointing to block)

inodex full of what can cause the problem?

First, in linux, there are two concepts that block and inode, block: used to store the actual data, inode: storage file attributes, as long as both of which fill a space, and will lead to error prompted "insufficient disk space"

"No space left on device" insufficient disk space prompt solution

 

Guess you like

Origin www.cnblogs.com/shinima/p/11753932.html