案例1:提示空间满,但df可以看到很多空间,为什么?
答:可能是节点编号用完
[root@ubuntu1804 ~]#mkdir /boot/test
[root@ubuntu1804 ~]#touch /boot/test/file{1..60742}
[root@ubuntu1804 ~]#df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
udev 115322 470 114852 1% /dev
tmpfs 123138 723 122415 1% /run
/dev/sda1 6111232 109629 6001603 2% /
tmpfs 123138 1 123137 1% /dev/shm
tmpfs 123138 3 123135 1% /run/lock
tmpfs 123138 18 123120 1% /sys/fs/cgroup
/dev/sda3 3055616 19 3055597 1% /data
/dev/sda2 61056 61056 0 100% /boot
tmpfs 123138 10 123128 1% /run/user/0
[root@ubuntu1804 ~]#touch /boot/test/jia
touch: cannot touch ‘/boot/test/jia‘: No space left on device
[root@ubuntu1804 ~]#df -h
Filesystem Size Used Avail Use% Mounted on
udev 451M 0 451M 0% /dev
tmpfs 97M 932K 96M 1% /run
/dev/sda1 92G 2.2G 85G 3% /
tmpfs 482M 0 482M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 482M 0 482M 0% /sys/fs/cgroup
/dev/sda3 46G 53M 44G 1% /data
/dev/sda2 923M 147M 714M 18% /boot
tmpfs 97M 0 97M 0% /run/user/0
```
案例2:提示空间快满了,但df和df -i都可以看到空间很多,为什么?如何解决?
答:可能有程序正在使用,大文件删除后没有释放空间。
使用下列方法删除文件会立刻释放空间:
`cat /dev/null > /boot/bigfile`
或者`> /boot/bigfile`(此方法缺点是有的shell不支持)