Skip to contentSkip to conversation

Increasing dmesg buffer size?

DISCUSSION Jordan Breeding 5 participants 5 messages Oct 1, 2001 – Oct 2, 2001

lore
Share & tools
lore
#0 lore raw

What kernel parameter do I need to modify in the source to allow a larger dmesg buffer? I have a lot of boot messages and I currently loose about 10-20 lines immediately and they can not even be seen in /var/log/dmesg because that file gets dumped after those lines are already gone. Thanks to anyone who can help.

Jordan Breeding

#1 lore raw
Quoted 6 lines · Jordan Breeding

What kernel parameter do I need to modify in the source to allow a larger dmesg buffer? I have a lot of boot messages and I currently loose about 10-20 lines immediately and they can not even be seen in /var/log/dmesg because that file gets dumped after those lines are already gone. Thanks to anyone who can help.

Does dmesg wrap around before klogd can grab the info? Check /var/log/kern.log (in debian, your filename may vary...) to see...

Mike

#2 lore raw
In reply to Jordan Breeding
Quoted 6 lines · Jordan Breeding

What kernel parameter do I need to modify in the source to allow a larger dmesg buffer? I have a lot of boot messages and I currently loose about 10-20 lines immediately and they can not even be seen in /var/log/dmesg because that file gets dumped after those lines are already gone. Thanks to anyone who can help.

That would be a #define of LOG_BUF_LEN in linux/kernel/printk.c.

Be sure to keep it a power of 2.

There have been several patch files for this on the kernel mailing list, but it's easy enough to DIY.

~Randy

#3 lore raw
In reply to Jordan Breeding
Quoted 6 lines

What kernel parameter do I need to modify in the source to allow a larger dmesg buffer? I have a lot of boot messages and I currently loose about 10-20 lines immediately and they can not even be seen in /var/log/dmesg because that file gets dumped after those lines are already gone. Thanks to anyone who can help.

No command line paramter. Go into linux/kernel/printk.c and increase the value of LOG_BUF_LEN. It must be a power of two.

#4 lore raw
In reply to Jordan Breeding
Quoted 3 lines · Jordan Breeding

What kernel parameter do I need to modify in the source to allow a larger dmesg buffer? I have a lot of boot messages and I currently

Note the -s flag.

rgds,
tim.

DMESG(8) DMESG(8)

NAME
dmesg - print or control the kernel ring buffer

SYNOPSIS
dmesg [ -c ] [ -n level ] [ -s bufsize ]

--