Review your favorite Linux distribution.
Go Back > Blogs > sag47
User Name


Rate this Entry

Kernel Panic!

Posted 10-16-2010 at 06:30 PM by sag47
Updated 10-16-2010 at 06:31 PM by sag47
Tags syslog

Everybody dreads it. When you see it, it is difficult to know what to do. Luckily Unix provides utilities which allow us to traverse the filesystem and parse files quickly and effortlessly.

Here's a search command which will search all your log files for keywords such as shutdown, poweroff, and panic.

find /var/log/ -type f -print0 | xargs -0 grep -iH 'shutdown\|poweroff\|panic' | cut -d: -f1 | sort -u
This will allow you to narrow which log files you should be looking at. Once you know which log files you need to look into then you need to grep each one of them to find out which lines the error occurrence shows up within each file. It is best to inspect the files individually. Lets call the file shutdown.err for this example.

grep -iHn 'shutdown\|poweroff\|panic' /var/log/shutdown.err | cut -d: -f2
Lets say that line 498 showed up in the results. You can use vim or the less pager to view the log at line 498 to see what caused the shutdown error.

less +498 /var/log/shutdown.err
vim +498 /var/log/shutdown.err
Based on what error messages you see you can google around to hopefully find a concise accurate solution to your problem.
Posted in Uncategorized
Views 2123 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 10:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration