大 /var/log/journal

大 /var/log/journal

我的 ubuntu 20.04 出了点问题,我的 /vat/log/journal 增长到了 195G。当我执行命令时,$tail -f /var/log/syslog我看到一个重复的日志,我想这是我的问题。

Sep 20 19:45:11 fanapsoft vboxdrv.sh[6730]: Invalid password
Sep 20 19:45:11 fanapsoft vboxdrv.sh[6730]: The Secure Boot key you've entered is not 
valid. The password used must be
Sep 20 19:45:11 fanapsoft vboxdrv.sh[6730]: between 8 and 16 characters.
Sep 20 19:45:11 fanapsoft vboxdrv.sh[6730]: Enter a password for Secure Boot. It will 
be asked again after a reboot.
Sep 20 19:45:11 fanapsoft vboxdrv.sh[6730]: Enter the same password again to verify 
you have typed it correctly.
Sep 20 19:45:11 fanapsoft vboxdrv.sh[6730]: Invalid password
Sep 20 19:45:11 fanapsoft vboxdrv.sh[6730]: The Secure Boot key you've entered is not 
valid. The password used must be
Sep 20 19:45:11 fanapsoft vboxdrv.sh[6730]: between 8 and 16 characters.
Sep 20 19:45:11 fanapsoft vboxdrv.sh[6730]: Enter a password for Secure Boot. It will 
be asked again after a reboot.
Sep 20 19:45:11 fanapsoft vboxdrv.sh[6730]: Enter the same password again to verify 
you have typed it correctly.

我不知道为什么会出现这个问题。我记得上次我升级 ubuntu 时它想为下次重启设置密码,但重启后它没有获取密码。现在我无法清除 /var/log/journal,当我运行时什么也没$ sudo rm -rf /var/log/journal/*发生。

答案1

/etc/systemd/journald.conf有一个设置来限制大小/var/log/journal/*

SystemMaxUse={n}M

{n}最大尺寸是多少?

$ sudo rm -rf /var/log/journal/* 什么都没发生。

这是正确的。rm仅当发生错误时才报告。

不过,你需要重启守护进程才能使它生效(或重新启动)。sudo systemctl restart systemd-journald.service

相关内容