All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: AIAMUZZ <muzafsh.113@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Magic Sysrq key option ... What is the option to record the boot logs to my hard disk before i issue a reboot command ?
Date: Mon, 19 Nov 2018 13:48:03 -0500	[thread overview]
Message-ID: <20181119184803.GB19377@thunk.org> (raw)
In-Reply-To: <CAC_t1uu7DDwA6do9sXnNhjcY4T=Q5PhmP2JtejSJ+FfpwJkaeg@mail.gmail.com>

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

  reply	other threads:[~2018-11-19 18:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2018-11-19 19:31   ` Randy Dunlap
2018-11-19 23:46     ` Theodore Y. Ts'o
2019-01-10 10:36   ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181119184803.GB19377@thunk.org \
    --to=tytso@mit.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=muzafsh.113@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.