3

I would like to observe my Linux system while getting suspended. Reading out the dmesg does not work, because my system stops logging until the device resumes. But that's exactly the problem, my device does not return and the log is gone therefore.

There is an option to stop putting consoles into standby, it's called no_console_suspend. That's nice, the only problem is: most modern laptops do not have a serial port.

How can I connect a serial console to those devices?

I thought about using an USB to serial adapter, unfortunately I guess that wouldn't work because USB is pretty sure suspended.

Any ideas?

3
  • 1
    M.2 serial card? You should see something on the console though.
    – Bib
    Dec 2, 2021 at 20:10
  • Not a bad idea, unfortunately my model does only have 1 m.2 slot (sdd)
    – flood
    Dec 2, 2021 at 20:45
  • Some motherboards have a header (pins to connect to). Perhaps the manufacturer has provided documentation (or can be contacted)? Also, check the BIOS setup for hints? Once found, the console also needs to be activated via Linux command line options during boot. Perhaps this will also work for a USB console.
    – Ned64
    Dec 3, 2021 at 9:16

1 Answer 1

2

According to these (old but hopefully valid) docs:

https://www.kernel.org/doc/html/latest/admin-guide/serial-console.html

a USB serial device can be used as the Linux Serial Console if this is compiled into your kernel. From there:

console=device,options
device:         tty0 for the foreground virtual console
                ttyX for any other virtual console
                ttySx for a serial port
                lp0 for the first parallel port
                ttyUSB0 for the first USB serial device

Also from there:

(You can also use a network device as a console. See Documentation/networking/netconsole.rst for information on that.)

This may actually be easier if you have an Ethernet port and a second machine.

You can get the current Linux commandline options by

cat /proc/cmdline

and change them in your GRUB/boot config file, or (easier) during boot for one boot process only.

2
  • the usb bus is deactivated while supend, isn't it?
    – flood
    Dec 4, 2021 at 14:11
  • @flood I am not sure. I mean we are telling the kernel not to suspend the console. Have you tried using a network console? (I suppose network should then not be configured for anything else,)
    – Ned64
    Dec 4, 2021 at 16:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .