LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-23-2009, 01:29 PM   #1
10110111
Member
 
Registered: Jun 2008
Location: St.-Petersburg, Russia
Distribution: (B)LFS, Ubuntu, SliTaz
Posts: 403

Rep: Reputation: 51
How to write kernel log directly to a file without user action?


I have some crashes on Easy Peasy resume from standby after installing some package updates, these crashes logs are hard to copy from screen to paper by hand, and if i try to do this, the screen gets blank by power management (yes, surprisingly, this does work even after a crash).
How can i make kernel log appear not on the console, but in a file instead, and have this file 'sync'ed after each new line is written?
 
Old 04-23-2009, 01:59 PM   #2
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 88
I would think something like this:

Code:
locate log | grep kernel
will show you that the kernel log may already be stored in /var/log/kernel.log or somewhere like that.
 
Old 04-23-2009, 02:14 PM   #3
10110111
Member
 
Registered: Jun 2008
Location: St.-Petersburg, Russia
Distribution: (B)LFS, Ubuntu, SliTaz
Posts: 403

Original Poster
Rep: Reputation: 51
Yes, there exists /var/log/kern.log, but there's no its backup, so it's overwritten after startup, while i need the log from previous, crashed, session.
 
Old 04-23-2009, 07:46 PM   #4
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 88
Ok, here's an idea. When your system crashes:
1. reboot it using a liveCD,
2. mount the hard disk of the crashed system,
3. copy the kern.log file.
 
Old 04-23-2009, 07:47 PM   #5
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 88
Another idea, dunno if it'll work for you:
http://www.faqs.org/docs/Linux-HOWTO...ash-HOWTO.html
 
Old 04-23-2009, 08:29 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,756

Rep: Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973Reputation: 3973
Sounds like your syslog or logrotate needs some configuring.
In _really_ dire circumstances, you could force a sync to disk using the magic sysrq, but you shouldn't be that bad. If the power management is still running, syslog should be.

Try a liveCD as suggested.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
After log roll, Postfix cannot write to log file, Ubuntu 8.04 mboudro Linux - Server 6 09-17-2010 03:10 AM
getting syslog to write to other file than /var/log/messages c_mitulescu Linux - Enterprise 6 04-02-2008 10:17 AM
Write Error Log to Text File jamez15 Linux - General 3 07-02-2006 07:32 PM
write errors to log file, instead of /dev/null c_r2005 Linux - General 2 07-30-2005 08:34 AM
Does Linux write what happens at boot to a file ? I can't find anything in var/log . lostboy Linux - General 8 05-07-2003 02:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:26 AM.

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