Skip to main content
Topic: I'd like to keep the previous dmesg.log after a reboot. (Read 526 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

I'd like to keep the previous dmesg.log after a reboot.

If the machine crashes, I'd like to be able to read any kernel panic or other issue.
However, after a reboot, only the current one is available.

Is there a way to keep the previous one?

Thanks.

Re: I'd like to keep the previous dmesg.log after a reboot.

Reply #1
Both metalog and syslog-ng can log everything, including dmesg, if configured so. Otherwise, here's a quick'n'dirty hack you can put in rc.local:
Code: [Select]
dmesg -wHT >>/var/log/dmesg-prev.log &

[EDIT reason: added '&']

Re: I'd like to keep the previous dmesg.log after a reboot.

Reply #2
Thanks.

Re: I'd like to keep the previous dmesg.log after a reboot.

Reply #3
This is an option in bootmisc.
Edit /etc/conf.d/bootmisc to set

log_dmesg="yes"
previous_dmesg="yes"