3

I have raspbian running on my raspberry PI. When I switch it on, boot messages crawl on the screen. I believe it would be beneficial to read them in order to get an idea about how the system starts. Hence I would like to know whether it is possible (and how) to redirect them to a file in order to read them thoroughly afterwards. Do I have to make a script that runs at startup?

4

Install the bootlogd package. Bootlogd is a daemon that will record all boot messages to /var/log/boot. Install the package with:

sudo apt-get install bootlogd

Then enable it by creating a new file called bootlogd in /etc/default/:

sudo vim /etc/default/bootlogd

And add the follwing to the file:

BOOTLOGD_ENABLE=yes

Save and exit. Now all boot messages will be put in /var/log/boot file, you can view them by using less like this:

less /var/log/boot
2

I have raspbian […]

Then you can use the old Debian /etc/init.d/bootlogs that saves the last up to 0.5MiB of kernel messages to /var/log/dmesg at startup. And of course, as mentioned in another answer, the old bootlogd from the same source, which only captures kernel messages that are at or above the kernel's console minimum log priority level.

And you can use one of the several Debian kernel log daemons or system log daemons (busybox-syslogd, dsyslog, klogd, inetutils-syslogd, sysklogd, socklog-run, syslog-ng, or rsyslog), which push kernel log messages to … wherever the package that you have has been configured to push kernel log messages. But these don't all capture kernel messages.

Or you can use systemd, which takes everything that it can get its mitts on — application syslog() calls, dæmon output, kernel log buffer — mixes it all together and pushes it to its journal, which you can read with:

journalctl -b -x
.

0

Try to execute command

dmesg

And you will get them. If you want to save the message redirect the output to file

dmesg >out_file
  • 1
    dmesg only prints kernel ring buffer. – PersianGulf May 16 '15 at 8:44
  • 1
    If it's based on Debian the messages will already be saved to /var/log/kern.log – roaima May 16 '15 at 9:39

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.