Where Linux places the messages of boot?

39

9

I want to find place to where Linux writes all boot messages. You know:

facility one    [STARTED]
facility two    [STARTED]
facility three  [FAILED]

I searched with

find . -print0 | xargs -0 grep -i "words from boot messages"

in /var/log/, but found nothing.

I have CentOS 5.5.
For example at boot time I had: "Determining IP information for eth0... failed; no link present. Check cable?"
I don't care about error specificaly, but I can't find any log that holds this error.

dmesg | grep "no link present" returns nothing too.

Rodnower

Posted 2010-08-15T20:14:09.653

Reputation: 1 739

1did you run the find command with root permissions? find will print all files you can list, but grep can only check the files you can read & some log files might be owned by root withput read permissions for other users. Also, at least GNU grep supports th -l option to print the names of files with matches instead of matched lines. This can be very usefule looking for files that contain certain text. So try su -c 'find /var/log -print0 | xargs -0 grep -l -i "words from boot messages"' or sudo find /varlog -print0 | xargs -0 sudo grep -l -i "words from boot messages" – mschilli – 2015-02-15T08:33:06.040

Nowadays with systemd here is the answer.

– Pablo A – 2018-12-24T02:22:36.133

Answers

24

Most of the boot messages are put in a buffer, that you can access using the command dmesg. On most Linux distributions, that output is also stored in

/var/log/dmesg.log

That you can view with

tail -n 100 /var/log/dmesg.log

Luc Stepniewski

Posted 2010-08-15T20:14:09.653

Reputation: 361

1For example, I had at boot time: "Determining IP information for eth0... failed; no link present Check cable?" I don't care about this error specificaly, but when I do: dmesg | grep "no link present" I get nothing... Actually I get VERY MUCH lines with grep "eth0", but not with concrete error. So is there way to find concrete boot errors description or no? (Thank you for reply to the point) – Rodnower – 2010-08-15T20:43:04.843

No /var/log/dmesg.log on Lubuntu 18.04 – Marco Sulla – 2019-05-02T19:03:14.177

Try using Nano's ^w (whereis) command, essentially a Find command. Or grep with a relaxed regexp. If you are really worried about a specific command's output, you could go in it's init.d file and change the offending command's STDOUT or STDERR logging. – Mat Carlson – 2014-03-20T22:12:38.873

16

Every exceptional entry during boot is placed in /var/log/syslog Could also be in /var/log/boot.msg

BloodPhilia

Posted 2010-08-15T20:14:09.653

Reputation: 27 374

1/var/log/boot.msg is the correct one on linux mint – MaxV – 2015-12-01T23:20:25.583

may also contain non-exceptional entries. – Abdull – 2016-03-15T15:40:50.630

I have CentOS 5.5 and I have no syslog in /var/log/ – Rodnower – 2010-08-15T20:22:40.467

boot.log (generally boot.log(x) where x is positive integer or nothing) is empty. – Rodnower – 2010-08-15T20:51:06.783

1Try /var/log/messages – pjc50 – 2011-11-17T16:42:20.150

8

This solution surely works on Debian systems, but maybe can be useful anyway.

In order to store all the messages shown during the boot you have to start a service called bootlogd, after the next reboot you can read the messages in /var/log/boot.

cYrus

Posted 2010-08-15T20:14:09.653

Reputation: 18 102

On debian wheezy, I get root@wheezy:/home/jrx# service bootlogd start bootlogd: unrecognized service – Jérôme Radix – 2015-04-09T07:46:11.673

4@JérômeRadix maybe you should install it first? – behrooz – 2015-07-16T14:56:19.720

3

Type dmesg > ~/dmesg.log to copy all the boot messages into your own copy. You can add the date and time if you want to keep multiple copies and you could even automate it within a login script.

G5MacPower

Posted 2010-08-15T20:14:09.653

Reputation: 31