linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Magic Sysrq key option ... What is the option to record the boot logs to my hard disk before i issue a reboot command ?
@ 2018-11-19 15:21 AIAMUZZ
  2018-11-19 18:48 ` Theodore Y. Ts'o
  0 siblings, 1 reply; 5+ messages in thread
From: AIAMUZZ @ 2018-11-19 15:21 UTC (permalink / raw)
  To: linux-kernel

Hi,

I have this nagging and frustrating boot freeze i often face on my
Deepin OS boot ... Deepin OS i think uses 'journalctl' to record logs
on its system.

'journalctl' however seems to record boot logs ONLY for successful
boots ... boot logs for instances of boot freezes/hangs that are
issued with a ... 'Ctrl+Alt+Del' ... key combination or the ... Magic
Sysrq 'b' ... key combination to get out of the frozen/hung machine
state are just not aved in the 'journalctl' log ...


Is there any option using Magic Sysrq that will enable me to record
the failed/frozen/hung boot information to a file for troubleshooting
before i reboot the system using the option 'b' ?


If not ... Isn't it a good idea to have such an option added to Magic
Sysrq options, that can save/record the boot/system logs upto that
point, until just before we restart the machines ?

It would really help to have such an option ... an option to record
and save the machine state(logs) before we reboot the system using the
'b' option of Magic Sysrq !!!

thanks for looking

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Magic Sysrq key option ... What is the option to record the boot logs to my hard disk before i issue a reboot command ?
  2018-11-19 15:21 Magic Sysrq key option ... What is the option to record the boot logs to my hard disk before i issue a reboot command ? AIAMUZZ
@ 2018-11-19 18:48 ` Theodore Y. Ts'o
  2018-11-19 19:31   ` Randy Dunlap
  2019-01-10 10:36   ` Pavel Machek
  0 siblings, 2 replies; 5+ messages in thread
From: Theodore Y. Ts'o @ 2018-11-19 18:48 UTC (permalink / raw)
  To: AIAMUZZ; +Cc: linux-kernel

On Mon, Nov 19, 2018 at 08:51:17PM +0530, AIAMUZZ wrote:
> Hi,
> 
> I have this nagging and frustrating boot freeze i often face on my
> Deepin OS boot ... Deepin OS i think uses 'journalctl' to record logs
> on its system.
> 
> 'journalctl' however seems to record boot logs ONLY for successful
> boots ... boot logs for instances of boot freezes/hangs that are
> issued with a ... 'Ctrl+Alt+Del' ... key combination or the ... Magic
> Sysrq 'b' ... key combination to get out of the frozen/hung machine
> state are just not aved in the 'journalctl' log ...
> 
> Is there any option using Magic Sysrq that will enable me to record
> the failed/frozen/hung boot information to a file for troubleshooting
> before i reboot the system using the option 'b' ?
> 
> If not ... Isn't it a good idea to have such an option added to Magic
> Sysrq options, that can save/record the boot/system logs upto that
> point, until just before we restart the machines ?

This is a hard problem to solve, because there's no place to store the
information, at least not in the general case.  The problem is on an
unsuccessful boot, the root file system may not have been mounted yet.
Heck, the storage devices might not have been probed at all!

If your hardware has a place to store dmesg output across reboots (via
one of the CONFIG_PSTORE_* kernel configuration options) then this
would be an easy problem --- in fact, it would be the default even
with out needing a magic sysrq to request it.  The problem is that
most x86 devices do not have hardware capable of supporting
CONFIG_PSTORE.  If you have a custom BIOS which doesn't clear memory
across a warm reset, that would make things easy.  Unless, unless you
are a big cloud company using custom hardware and/or a custom BIOS,
life is much more difficult.  :-(

One alternative solution you can use is to simply use a serial
console, and have a another computer monitoring the output from the
serial console.  This will allow you to see all of the kernel messages
during early bootup and afterwards.  So this is also useful for when
your X server dies and your system mysteriously reboot; either
CONFIG_PSTORE_* hardware or using a serial console might allow you to
see the kernel oops message which took out your desktop machine.  (Or
in the case of servers, you can cross connect your servers' serial
ports so that one server is monitoring another server's serial
consoles.)

Cheers,

					- Ted

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Magic Sysrq key option ... What is the option to record the boot logs to my hard disk before i issue a reboot command ?
  2018-11-19 18:48 ` Theodore Y. Ts'o
@ 2018-11-19 19:31   ` Randy Dunlap
  2018-11-19 23:46     ` Theodore Y. Ts'o
  2019-01-10 10:36   ` Pavel Machek
  1 sibling, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2018-11-19 19:31 UTC (permalink / raw)
  To: Theodore Y. Ts'o, AIAMUZZ, linux-kernel

On 11/19/18 10:48 AM, Theodore Y. Ts'o wrote:
> On Mon, Nov 19, 2018 at 08:51:17PM +0530, AIAMUZZ wrote:
>> Hi,
>>
>> I have this nagging and frustrating boot freeze i often face on my
>> Deepin OS boot ... Deepin OS i think uses 'journalctl' to record logs
>> on its system.
>>
>> 'journalctl' however seems to record boot logs ONLY for successful
>> boots ... boot logs for instances of boot freezes/hangs that are
>> issued with a ... 'Ctrl+Alt+Del' ... key combination or the ... Magic
>> Sysrq 'b' ... key combination to get out of the frozen/hung machine
>> state are just not aved in the 'journalctl' log ...
>>
>> Is there any option using Magic Sysrq that will enable me to record
>> the failed/frozen/hung boot information to a file for troubleshooting
>> before i reboot the system using the option 'b' ?
>>
>> If not ... Isn't it a good idea to have such an option added to Magic
>> Sysrq options, that can save/record the boot/system logs upto that
>> point, until just before we restart the machines ?
> 
> This is a hard problem to solve, because there's no place to store the
> information, at least not in the general case.  The problem is on an
> unsuccessful boot, the root file system may not have been mounted yet.
> Heck, the storage devices might not have been probed at all!
> 
> If your hardware has a place to store dmesg output across reboots (via
> one of the CONFIG_PSTORE_* kernel configuration options) then this
> would be an easy problem --- in fact, it would be the default even
> with out needing a magic sysrq to request it.  The problem is that
> most x86 devices do not have hardware capable of supporting
> CONFIG_PSTORE.  If you have a custom BIOS which doesn't clear memory
> across a warm reset, that would make things easy.  Unless, unless you
> are a big cloud company using custom hardware and/or a custom BIOS,
> life is much more difficult.  :-(
> 
> One alternative solution you can use is to simply use a serial
> console, and have a another computer monitoring the output from the
> serial console.  This will allow you to see all of the kernel messages
> during early bootup and afterwards.  So this is also useful for when
> your X server dies and your system mysteriously reboot; either
> CONFIG_PSTORE_* hardware or using a serial console might allow you to
> see the kernel oops message which took out your desktop machine.  (Or
> in the case of servers, you can cross connect your servers' serial
> ports so that one server is monitoring another server's serial
> consoles.)
> 
> Cheers,

Yes, all of that.
Having some kind of pstore on x86 would be wonderful.

kexec/kdump used to be an option also.  I haven't tried it lately.

-- 
~Randy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Magic Sysrq key option ... What is the option to record the boot logs to my hard disk before i issue a reboot command ?
  2018-11-19 19:31   ` Randy Dunlap
@ 2018-11-19 23:46     ` Theodore Y. Ts'o
  0 siblings, 0 replies; 5+ messages in thread
From: Theodore Y. Ts'o @ 2018-11-19 23:46 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: AIAMUZZ, linux-kernel

On Mon, Nov 19, 2018 at 11:31:21AM -0800, Randy Dunlap wrote:
> 
> Yes, all of that.
> Having some kind of pstore on x86 would be wonderful.
> 
> kexec/kdump used to be an option also.  I haven't tried it lately.

Sure, but kexec/kdump won't work to debug a boot failure during early
boot.  You need to be able to get the root file system mounted at the
very least, and usually kexec/kdump doesn't get set up until the init
scripts are running.

Fortunately, usually only kernel developers need to debug early boot
failures, and most of us can usually use serial consoles (for those of
us who can't just cheat and use VM's.  :-)

       	     	  	    	       - Ted

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Magic Sysrq key option ... What is the option to record the boot logs to my hard disk before i issue a reboot command ?
  2018-11-19 18:48 ` Theodore Y. Ts'o
  2018-11-19 19:31   ` Randy Dunlap
@ 2019-01-10 10:36   ` Pavel Machek
  1 sibling, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2019-01-10 10:36 UTC (permalink / raw)
  To: Theodore Y. Ts'o, AIAMUZZ, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2706 bytes --]

On Mon 2018-11-19 13:48:03, Theodore Y. Ts'o wrote:
> On Mon, Nov 19, 2018 at 08:51:17PM +0530, AIAMUZZ wrote:
> > Hi,
> > 
> > I have this nagging and frustrating boot freeze i often face on my
> > Deepin OS boot ... Deepin OS i think uses 'journalctl' to record logs
> > on its system.
> > 
> > 'journalctl' however seems to record boot logs ONLY for successful
> > boots ... boot logs for instances of boot freezes/hangs that are
> > issued with a ... 'Ctrl+Alt+Del' ... key combination or the ... Magic
> > Sysrq 'b' ... key combination to get out of the frozen/hung machine
> > state are just not aved in the 'journalctl' log ...
> > 
> > Is there any option using Magic Sysrq that will enable me to record
> > the failed/frozen/hung boot information to a file for troubleshooting
> > before i reboot the system using the option 'b' ?
> > 
> > If not ... Isn't it a good idea to have such an option added to Magic
> > Sysrq options, that can save/record the boot/system logs upto that
> > point, until just before we restart the machines ?
> 
> This is a hard problem to solve, because there's no place to store the
> information, at least not in the general case.  The problem is on an
> unsuccessful boot, the root file system may not have been mounted yet.
> Heck, the storage devices might not have been probed at all!
> 
> If your hardware has a place to store dmesg output across reboots (via
> one of the CONFIG_PSTORE_* kernel configuration options) then this
> would be an easy problem --- in fact, it would be the default even
> with out needing a magic sysrq to request it.  The problem is that
> most x86 devices do not have hardware capable of supporting
> CONFIG_PSTORE.  If you have a custom BIOS which doesn't clear memory
> across a warm reset, that would make things easy.  Unless, unless you
> are a big cloud company using custom hardware and/or a custom BIOS,
> life is much more difficult.  :-(
> 
> One alternative solution you can use is to simply use a serial
> console, and have a another computer monitoring the output from the
> serial console.  This will allow you to see all of the kernel

Serial ports are not very common these days :-(.

Ethernets are, and we have netconsole, maybe that can be used?

(Actually, I wish we had sysrq key "configure netconsole up and
re-send the dmesg buffer". Could be enabled all the time, and would
eliminate frustration of looking at blinking capslock LED and thinking
"I wish I knew what is in the buffer at the moment"....) 

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-10 10:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 15:21 Magic Sysrq key option ... What is the option to record the boot logs to my hard disk before i issue a reboot command ? AIAMUZZ
2018-11-19 18:48 ` Theodore Y. Ts'o
2018-11-19 19:31   ` Randy Dunlap
2018-11-19 23:46     ` Theodore Y. Ts'o
2019-01-10 10:36   ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).