Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

A comprehensive dmesg?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
zwerg
Posts: 117
Joined: 2006-02-17 12:16
Location: Bangkok, Thailand

A comprehensive dmesg?

#1 Post by zwerg »

I'd like to use dmesg to display all of the information that scrolls past when the box boots. As things stand, I get a portion of it.

Is this a matter of buffer sizes? The man page for dmesg mentions that the default buffer size is 16,392, and then says something about the size of the kernel ring buffer. Will it help to double the dmesg buffer? And how, exactly, would that command be entered? So far I've not been able to expand the output of dmesg -- I'm pretty sure I'm not getting the syntax right.

As for increasing the size of the kernel ring buffer, that makes no sense to me. The output that goes to the monitor during boot is what I want, and since it is there but not accessible (via dmesg, yet), I can't imagine that those messages need to come from a larger buffer. CMIIAW, please.

I want to set dmesg to give the fuil story. Or: I'd like to know how to generate a file that contains ALL of what I see whizzing past when I boot. Is there a log that has it all?

Any ideas?

TIA

lacek
Posts: 764
Joined: 2004-03-11 18:49
Location: Budapest, Hungary
Contact:

#2 Post by lacek »

What you're looking for is the /var/log/dmesg file. It should contain all messages.

zwerg
Posts: 117
Joined: 2006-02-17 12:16
Location: Bangkok, Thailand

#3 Post by zwerg »

Well, no, the /var/log/dmesg file actually contains less than the output of the dmesg command. And neither contains everything that whooshes past on the monitor as boot proceeds.

I'm confident that I'm correct, because I created two files, one using the dmesg command, and one a copy of /var/log/dmesg, and viewed them together (in Xemacs with a split screen). Then I went over them, comparing them line by line. The file /var/log/dmesg is missing 27 lines that are present at the end of the file created with the dmesg command. I supose if you try this, YMMV.

OK, let's consider the contents of man dmesg. Can I use the -sbufsize option to force dmesg to give me a complete copy of the data shown on boot? I haven't had any luck so far; every file I create is of identical size. So what's the proper syntax for that option? Or is that not how it's done? How IS it done??

Grifter
Posts: 1554
Joined: 2006-05-04 07:53
Location: Svea Rike

#4 Post by Grifter »

You don't get all the output, but the output you don't get is usually redundant anyway. If you do not have a display manager that starts right after boot, you can always just hit shift-pageup for the last few pages of it. But if you switch VTs (or use a gdm) you will lose the scrollback buffer.
Eagles may soar, but weasels don't get sucked into jet engines...

lacek
Posts: 764
Joined: 2004-03-11 18:49
Location: Budapest, Hungary
Contact:

#5 Post by lacek »

To my knowledge, the size of the kernel ring buffer is hardwired into the kernel (specified by the CONFIG_LOG_BUF_SHIFT config option). It is probably a very bad idea to hold all of the buffer in the memory, because dmesg can continuously grow, consuming more and more memory.
That's why you can't really ask dmesg to print all of the messages, since they aren't kept in the memory.
Take a look at the log files (/var/log/messages for example), perhaps they contain what you are looking for.

zwerg
Posts: 117
Joined: 2006-02-17 12:16
Location: Bangkok, Thailand

#6 Post by zwerg »

Thanks for the replies!

1. I figured the kernel ring buffer was a non-starter. Now I know why it is.

2. No luck with the shift-pageup trick; the text did move up into the boot display, but only a few lines.

3. No relevant messages found in /var/log.

So I'll ask everybody to consider just this aspect of the question:

OK, let's consider the contents of man dmesg. Can I use the -sbufsize option to force dmesg to give me a complete copy of the data shown on boot? I haven't had any luck so far; every file I create is of identical size. So what's the proper syntax for that option? Or is that not how it's done? How IS it done??

In other words, is it the small size of dmesg's buffer that is preventing the output of the dmesg command from being comprehensive?

And above all, am I wasting time trying to do something that can't be done??

Grifter
Posts: 1554
Joined: 2006-05-04 07:53
Location: Svea Rike

#7 Post by Grifter »

I think the errors you get simply don't get logged, trying to expand dmesg seems futile to me, but don't take my word for it. Personally I can scroll up pretty far during bootup, and if you run a framebuffer, you can try to increase the resolution so you can fit even more text on it.
Eagles may soar, but weasels don't get sucked into jet engines...

zwerg
Posts: 117
Joined: 2006-02-17 12:16
Location: Bangkok, Thailand

#8 Post by zwerg »

Grifter:

Thanks for the comments. I confess I don't know what errors you are referring to when you say, "I think the errors you get simply don't get logged," but the frame buffer may be of some help. I'll look into it. A friend here tells me he can't get dmesg to do anything interesting when he tries to increase its buffer, too, so that looks, as you say, futile.

I think I'm trying to push a rope.

Anybody else have any ideas??

TIA

Harold
Posts: 1482
Joined: 2005-01-07 00:15
Been thanked: 3 times

#9 Post by Harold »

During startup, messages scrolling by on the console are initially generated by the kernel, and these get logged into dmesg. Towards the end of startup, the messages are no longer being generated by the kernel, but by the init routine. These don't get logged, and I suspect this is what zwerg is trying to read. The screen can be halted any time during startup by pressing, iirc, the scroll lock key. If it isn't the scroll lock key, then it is one of the keys to either side of it.

zwerg
Posts: 117
Joined: 2006-02-17 12:16
Location: Bangkok, Thailand

#10 Post by zwerg »

That gives me something to work on. Thanks, Harold.

User avatar
Lux
Posts: 474
Joined: 2006-01-25 13:00
Location: Finland

#11 Post by Lux »

Init messages are not logged by default but this can be enabled in /etc/default/bootlogd. Once bootlogd has been enabled, the log can be read in /var/log/boot.
"Hit the philistines three times over the head with the Elisp reference manual."
-- Michael A. Petonic --

zwerg
Posts: 117
Joined: 2006-02-17 12:16
Location: Bangkok, Thailand

#12 Post by zwerg »

1. Default changed from "No" to "Yes" in /etc/default/bootlogd.

2. File (or dir) /var/log/boot not found. No relevant file with "boot" in its name found in /var.

3. Tedious comparision of output of dmesg with the file /var/log/messages shows that neither is an abbreviated version of the other; each includes some data not found in the other.

4. No other relevant files found in /var/log.

5. No way found to halt scrolling during boot process: keys "Print Screen SysRq," "Scroll Lock," "Pause Break" do not do the trick.

6. It appears that the scrolling data on the monitor during boot contain info not yet located in any file.

In the event that anyone wants to discuss the command dmesg and its options, I'll be interested.

Thanks to all who have contributed!

Post Reply