我的根分区在使用过程中会自动填满。我有一个单独的根分区,大小为 105GB。
这是我第二次遇到 Ubuntu 20.04LTS 的这个问题。上次发生这种情况时,重启后我无法再登录。
磁盘分析器显示 var/log 目录已满。但检查目录中的大文件却没有发现任何内容。
更新 1:
以下是 的部分输出ls -lh /var/log
。这部分看起来不寻常,因为它显示某些内容占用了 87G 的存储空间。
total 87G
...
-rw-r----- 1 syslog adm 2.6M Jul 19 07:29 kern.log.1
-rw-r----- 1 syslog adm 420K Jul 12 08:38 kern.log.2.gz
-rw-r----- 1 syslog adm 258K Jul 5 12:19 kern.log.3.gz
-rw-rw-r-- 1 root utmp 286K Jul 2 09:15 lastlog
drwxr-xr-x 2 root root 4.0K Sep 5 2019 openvpn
drwx------ 2 root root 4.0K Apr 23 08:32 private
drwx------ 2 speech-dispatcher root 4.0K Jan 19 19:26 speech-dispatcher
-rw-r----- 1 syslog adm 87G Jul 19 14:53 syslog
-rw-r----- 1 syslog adm 1.5M Jul 19 07:29 syslog.1
-rw-r----- 1 syslog adm 387K Jul 18 07:27 syslog.2.gz
-rw-r----- 1 syslog adm 581K Jul 17 06:35 syslog.3.gz
-rw-r----- 1 syslog adm 200K Jul 16 04:49 syslog.4.gz
-rw-r----- 1 syslog adm 403K Jul 15 07:18 syslog.5.gz
-rw-r----- 1 syslog adm 423K Jul 14 09:41 syslog.6.gz
-rw-r----- 1 syslog adm 123K Jul 13 07:29 syslog.7.gz
-rw------- 1 root root 0 Apr 23 08:33 ubuntu-advantage.log
drwxr-x--- 2 root adm 4.0K Jul 2 01:21 unattended-upgrades
...
罪魁祸首似乎很明显(syslog)。删除文件安全吗?解决 syslog 大小大幅增加的永久解决方案是什么?
更新 2:
tail -f /var/log/syslog
按要求输出。
Jul 19 15:23:22 tobi-HP-Z400-Workstation wpa_supplicant[813]: wlx20e9170ef6cd: CTRL-EVENT-SIGNAL-CHANGE above=0 signal=-73 noise=9999 txrate=21700
Jul 19 15:23:27 tobi-HP-Z400-Workstation wpa_supplicant[813]: wlx20e9170ef6cd: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-67 noise=9999 txrate=19500
Jul 19 15:24:36 tobi-HP-Z400-Workstation wpa_supplicant[813]: wlx20e9170ef6cd: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-61 noise=9999 txrate=21700
...
Jul 19 15:25:45 tobi-HP-Z400-Workstation wpa_supplicant[813]: wlx20e9170ef6cd: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-55 noise=9999 txrate=28900
...
Jul 19 15:30:01 tobi-HP-Z400-Workstation CRON[18883]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
Jul 19 15:30:19 tobi-HP-Z400-Workstation wpa_supplicant[813]: wlx20e9170ef6cd: CTRL-EVENT-SIGNAL-CHANGE above=0 signal=-75 noise=9999 txrate=19500
Jul 19 15:30:24 tobi-HP-Z400-Workstation wpa_supplicant[813]: wlx20e9170ef6cd: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-63 noise=9999 txrate=19500
Jul 19 15:30:25 tobi-HP-Z400-Workstation wpa_supplicant[813]: wlx20e9170ef6cd: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-59 noise=9999 txrate=19500
Jul 19 15:31:00 tobi-HP-Z400-Workstation wpa_supplicant[813]: wlx20e9170ef6cd: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-55 noise=9999 txrate=19500
Jul 19 15:31:40 tobi-HP-Z400-Workstation wpa_supplicant[813]: wlx20e9170ef6cd: CTRL-EVENT-SIGNAL-CHANGE above=0 signal=-77 noise=9999 txrate=21700
Jul 19 15:31:45 tobi-HP-Z400-Workstation wpa_supplicant[813]: wlx20e9170ef6cd: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-59 noise=9999 txrate=21700
Jul 19 15:31:45 tobi-HP-Z400-Workstation wpa_supplicant[813]: message repeated 2 times: [ wlx20e9170ef6cd: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-59 noise=9999 txrate=21700]
Jul 19 15:33:01 tobi-HP-Z400-Workstation wpa_supplicant[813]: wlx20e9170ef6cd: WPA: Group rekeying completed with 0c:72:d9:3c:3b:62 [GTK=TKIP]
Jul 19 15:33:13 tobi-HP-Z400-Workstation systemd[1]: Started Run anacron jobs.
Jul 19 15:33:14 tobi-HP-Z400-Workstation anacron[18959]: Anacron 2.3 started on 2020-07-19
Jul 19 15:33:14 tobi-HP-Z400-Workstation anacron[18959]: Normal exit (0 jobs run)
Jul 19 15:33:14 tobi-HP-Z400-Workstation systemd[1]: anacron.service: Succeeded.