Operating System - HP-UX
1833461 Members
3174 Online
110052 Solutions
New Discussion

Re: dmesg --> how clear the messages

 
Ferdinand_2
Advisor

dmesg --> how clear the messages

Hi there,

I am trying to clear my dmesg from an old D380 running 11.00

I have cleared both /var/adm/messages and msgbuf with >

I have done dmesg -c ( It only fills the msgbuf again )

# /usr/sbin/dmesg - >>/var/adm/messages
# /usr/sbin/dmesg >>/var/adm/messages
# /usr/sbin/dmesg >/var/adm/messages

I even tried
# echo "OK" > /dev/kmem

I have read ( and tried the thread copied underneath )

Nothing worked and I can't reboot this machine.

Any tips?

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x46a093e260b0d611abdb0090277a778c,00.html
cd /pub more beer
8 REPLIES 8
twang
Honored Contributor

Re: dmesg --> how clear the messages

I don't think that dmesg can be cleared. It is a cyclic buffer stored in memory of a fixed size and is cleared at system boot only.
Stefan Farrelly
Honored Contributor

Re: dmesg --> how clear the messages

You cant, sorry. All you can do it reboot, or stop whatever is causing errors to go to dmesg (apart from the boot messages - and you cant stop those either).
Im from Palmerston North, New Zealand, but somehow ended up in London...
Pete Randall
Outstanding Contributor

Re: dmesg --> how clear the messages

The dmesg log should have no effect on your ability to reboot the machine.

When you say "Nothing worked and I can't reboot this machine", what exactly seems to be the problem? Do you get error messages? Does the reboot hang? Does the shutdown hang? Can you be more specific?


Pete


Pete
Ferdinand_2
Advisor

Re: dmesg --> how clear the messages

This machine has had troubles with its disks. They have been replaced by HP but the problems persist.

HP asked me to re-seat all connections. I did. But it took 5 reboots for the machine to work.
I don't wanna do that again. It has to work for just 6 more weeks, then it is going to be fased-out.

But if you check the machine with all the tools nothing is wrong.
Everything synced, see the txt attach.

So I'd like the machine to go down feeling happy. With an empty dmesg.
cd /pub more beer
Cheryl Griffin
Honored Contributor

Re: dmesg --> how clear the messages

The dmesg messages all point to this one disk:
0x038000 --> /dev/dsk/c3t8d0

Test it with dd to see if it still has a problem:

Test the disk with dd.
# dd if=/dev/dsk/c3t8d0 of=/dev/null bs=64 count=1000
If successful, the results of this command will look similar to:
100+0 records in
100+0 records out

Look for any of the following:
* IO errors
* the number of blocks read in do not match was is read out
* the command hangs or immediately produces an error

# diskinfo /dev/rdsk/c3t8d0
Look for any of the following which indicate a HW problem:
* the command produces an error
* disk size reports zero or is incorrect

See if you have additional errors in /var/adm/syslog/syslog.log

It still looks like a HW problem so far even though they may have replaced the disk.
"Downtime is a Crime."
Pete Randall
Outstanding Contributor

Re: dmesg --> how clear the messages

Ferdinand,

Once again, the contents of dmesg will not affect your ability to reboot. As Cheryl points out, you seem to still have issues with one disk. Use her "dd" suggestion to exercise that disk and see if it fails. It may well have to be replaced again.


Pete


Pete
Ferdinand_2
Advisor

Re: dmesg --> how clear the messages

No problems with these commands. Like last time.

(mowdb016)/var/adm # dd if=/dev/rdsk/c3t8d0 of=/dev/null bs=4096k &
(mowdb016)/var/adm # 2170+1 records in
2170+1 records out

# diskinfo /dev/rdsk/c3t8d0
SCSI describe of /dev/rdsk/c3t8d0:
vendor: SEAGATE
product id: ST39173WC
type: direct access
size: 8891556 Kbytes
bytes per sector: 512

Thanks 4 all your help.

cd /pub more beer
Bill Hassell
Honored Contributor

Re: dmesg --> how clear the messages

dmesg is an in-core buffer kept by the kernel and will always report everything when you run it *UNLESS* you use the - option (I know, it's hard to see). This option is designed to keep a cumulative log and an example using cron is available in /usr/newconfig, but it looks like this:

00,10,20,30,40,50 * * * * /usr/sbin/dmesg - >> /var/adm/messages

Be sure you use the - flag. This makes dmesg scan the buffer for new info and if none is found, nothing is reported. Actually, I prefer /var/adm/dmesg.log since it makes more sense but other Unices seem to use the 'messages' filename...must be some legacy thingy.


Bill Hassell, sysadmin