![错误:设备上没有剩余空间:(已删除)/dev/zero](https://linux22.com/image/726239/%E9%94%99%E8%AF%AF%EF%BC%9A%E8%AE%BE%E5%A4%87%E4%B8%8A%E6%B2%A1%E6%9C%89%E5%89%A9%E4%BD%99%E7%A9%BA%E9%97%B4%EF%BC%9A%EF%BC%88%E5%B7%B2%E5%88%A0%E9%99%A4%EF%BC%89%2Fdev%2Fzero.png)
**** 主机管理员在虚拟机管理程序上做了一些更改,但表示没有任何变化。问题不再出在服务器上……****
如果我想重新启动守护进程,我会收到通知:
Error: No space left on device
lsof | grep 已删除:
rewrite-0 11111 11153 nginx mem REG 0,96 598535772 (deleted)/dev/zero (stat: No such file or directory)
rewrite-0 11111 11153 nginx mem REG 0,96 598535778 (deleted)/dev/zero (stat: No such file or directory)
rewrite-0 11111 11153 nginx mem REG 0,96 598535776 (deleted)/dev/zero (stat: No such file or directory)
还有许多其他用于 php-fpm、mysql 的字符串。
这是 VPS Centos。找不到任何解决方案。非常感谢您的帮助!
#### 更新Filesystem Size Used Avail Use% Mounted on
/dev/ploop16716p1 200G 11G 181G 6% /
devtmpfs 3.0G 0 3.0G 0% /dev
tmpfs 3.0G 0 3.0G 0% /dev/shm
tmpfs 3.0G 248K 3.0G 1% /run
tmpfs 3.0G 0 3.0G 0% /sys/fs/cgroup
tmpfs 615M 0 615M 0% /run/user/1000
tmpfs 615M 0 615M 0% /run/user/0
ls -la /dev/zero
crw-rw-rw- 1 root root 1, 5 Aug 21 16:21 /dev/zero
DF-我
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/ploop16716p1 13295616 353527 12942089 3% /
devtmpfs 786432 65 786367 1% /dev
tmpfs 786432 1 786431 1% /dev/shm
tmpfs 786432 221 786211 1% /run
tmpfs 786432 10 786422 1% /sys/fs/cgroup
tmpfs 786432 1 786431 1% /run/user/1000
[root@mail ~]# dd if=/dev/zero of=/file bs=1G count=50
50+0 records in
50+0 records out
53687091200 bytes (54 GB) copied, 168.672 s, 318 MB/s
[root@mail ~]# du -hs /文件
51G /file
[root@mail ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/ploop16716p1 200G 61G 131G 32% /
devtmpfs 3.0G 0 3.0G 0% /dev
tmpfs 3.0G 0 3.0G 0% /dev/shm
tmpfs 3.0G 252K 3.0G 1% /run
tmpfs 3.0G 0 3.0G 0% /sys/fs/cgroup
tmpfs 615M 0 615M 0% /run/user/1000
tmpfs 615M 0 615M 0% /run/user/0
出于任何原因:
代表配额-a:
*** Report for user quotas on device /dev/ploop16716p1
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
root -- 7523364 0 0 251948 0 0
nobody -- 20 0 0 5 0 0
smmsp -- 92 0 0 23 0 0
rpc -- 4 0 0 2 0 0
apache -- 16 0 0 4 0 0
mysql -- 180824 0 0 384 0 0
named -- 12 0 0 3 0 0
user -- 236604 0 0 1081 0 0
clamupdate -- 260460 0 0 5 0 0
dovecot -- 4 0 0 1 0 0
postfix -- 728 0 0 80 0 0
vmail -- 1415436 0 0 14824 0 0
spamd -- 32 0 0 9 0 0
nginx -- 775704 0 0 57129 0 0
amavis -- 4644 0 0 31 0 0
postgrey -- 10340 0 0 9 0 0
opendkim -- 40 0 0 10 0 0
opendmarc -- 212 0 0 3 0 0
redis -- 284 0 0 16 0 0
ossec -- 29108 0 0 1216 0 0
ossecr -- 284 0 0 5 0 0
ossecm -- 4 0 0 1 0 0
#500 -- 97932 0 0 5318 0 0
#1001 -- 7024 0 0 435 0 0
#984 -- 532 0 0 136 0 0
#501 -- 22356 0 0 2645 0 0
我已经联系了托管服务提供商,他们告诉我,他们找不到问题,但日志显示:
Aug 24 07:43:17 mail yum[17224]: Installed: strace-4.12-6.el7.x86_64
Aug 24 07:53:43 mail clamd[1484]: SelfCheck: Database status OK.
Aug 24 07:55:58 mail systemd-tty-ask-password-agent: Error: No space left on device
Aug 24 07:55:58 mail systemctl: Failed to stop systemd-ask-password-plymouth.path: Unit systemd-ask-password-plymouth.path not loaded.
Aug 24 07:55:58 mail systemctl: Failed to stop systemd-ask-password-plymouth.service: Unit systemd-ask-password-plymouth.service not loaded.
之后,守护进程重新启动后就没有任何问题了。大家有什么想法吗,亲爱的社区?
ipcs-a
------ Message Queues --------
key msqid owner perms used-bytes messages
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
------ Semaphore Arrays --------
key semid owner perms nsems
答案1
由于人们为您建议的其他所有方法都失败了,我将尝试一个更奇特的方法——您的系统是否由于某种原因用完了信号量?
如果ipcs -a
显示的列表很长,那么可能值得使用该命令删除最明显的列表(例如,对于只应运行某些已停止的服务的用户而言存在的信号量)ipcrm
。
答案2
目前,使用 sysctl 参数解决问题:fs.inotify.max_user_watches = 10240