After searching more this is what I did. I am posting this if anyone needs this.
sudo systemctl stop rsyslog and sudo systemctl disable rsyslog don't work anymore. Rsyslog is deprecated in new OS. Now it uses systemd journaled https://raspberrypi.stackexchange.com/a/109429/166605. Now check if
/var/log/journal and
/run/log/journal exist. If then runl andNow modify this to your liking
and
Storage=volatile
RuntimeMaxUse=64M
If you want to keep some logs,. For my case, it is just https://forum.zorin.com/t/quieting-driv ... ty/30313/2
Storage=none
Now it's time for logrotate to be modified. Check logrotate timer
Then change it to your liking.
sudo nano /etc/logrotate.conf to modify .
For me, it is:
# create new (empty) log files after rotating old ones
nocreate
# system-specific logs may also be configured here.
nocreateolddir
Now need to force logrotate
Now again, run this to see if any changes happen.
If not, then https://unix.stackexchange.com/a/620432
If you have followed the steps to set Storage=volatile and systemd-journald logs are still being written to disk, there might be a few reasons for this. Here are some additional steps to ensure logs are not stored on disk.
Check for any runtime directory logs and ensure that no runtime directory logs are being stored:
Check for any persistent directory logs and verify if any persistent logs exist in the following directory:If this directory exists and contains logs, you can safely delete its contents:
l
Verify the status of systemd-journald to ensure the configuration has been applied:
Ensure other logging services are not writing to disk:
Other logging services (e.g., rsyslog or syslog-ng) might still be writing logs to disk. Check if these services are running:If they are running and you want to disable them:
sudo systemctl stop rsyslogRestart the system:
Ensure there are no syntax errors in the journald configuration file:
After this [ code] journalctl --disk-usage[/code] returned 0MB.
sudo systemctl stop rsyslog and sudo systemctl disable rsyslog don't work anymore. Rsyslog is deprecated in new OS. Now it uses systemd journaled https://raspberrypi.stackexchange.com/a/109429/166605. Now check if
/var/log/journal and
/run/log/journal exist. If then run
Code:
du -sh /var/log/journa
Code:
du -sh /run/log/journal
Code:
sudo nano /etc/systemd/journald.conf
Storage=volatile
RuntimeMaxUse=64M
If you want to keep some logs,. For my case, it is just https://forum.zorin.com/t/quieting-driv ... ty/30313/2
Storage=none
Now it's time for logrotate to be modified. Check logrotate timer
Code:
systemctl status logrotate.timer
sudo nano /etc/logrotate.conf to modify .
For me, it is:
# create new (empty) log files after rotating old ones
nocreate
# system-specific logs may also be configured here.
nocreateolddir
Now need to force logrotate
Code:
sudo logrotate -vf /etc/logrotate.conf
Now again, run this to see if any changes happen.
Code:
du -sh /var/log/journal anddu -sh /run/log/journaljournalctl --disk-usage
Code:
sudo systemctl restart systemd-journaldsudo journalctl --vacuum-size=10Msudo journalctl --vacuum-time=10min
If you have followed the steps to set Storage=volatile and systemd-journald logs are still being written to disk, there might be a few reasons for this. Here are some additional steps to ensure logs are not stored on disk.
Check for any runtime directory logs and ensure that no runtime directory logs are being stored:
Code:
sudo ls /run/log/journal
Code:
sudo ls /var/log/journal
Code:
sudo rm -rf /var/log/journa
Verify the status of systemd-journald to ensure the configuration has been applied:
Code:
sudo systemctl status systemd-journald
Ensure other logging services are not writing to disk:
Other logging services (e.g., rsyslog or syslog-ng) might still be writing logs to disk. Check if these services are running:
Code:
sudo systemctl status rsyslog sudo systemctl status syslog-ng
sudo systemctl stop rsyslog
Code:
sudo systemctl disable rsyslog sudo systemctl stop syslog-ng sudo systemctl disable syslog-ng
Code:
sudo reboot
Code:
sudo systemd-analyze verify /etc/systemd/journald.conf
Statistics: Posted by sohojmanush — Sat Aug 03, 2024 1:07 pm