Difference between revisions of "Disable clearing of boot messages"

From ArchWiki
Jump to: navigation, search
m (Have boot messages stay on tty1: better formatting)
(Undo revision 432159 by Michalzuber (talk) - false - this will show the messages only until the prompt appears)
 
(11 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 
[[Category:Boot process]]
 
[[Category:Boot process]]
[[es:Disable Clearing of Boot Messages]]
+
[[es:Disable clearing of boot messages]]
 
[[fr:Messages au demarrage]]
 
[[fr:Messages au demarrage]]
{{Article summary start|Summary}}
+
[[ja:ブートメッセージのクリアの無効化]]
{{Article summary text|Preventing the boot sequence printout from disappearing.}}
+
{{Related articles start}}
{{Article summary heading|Related}}
+
{{Related|Arch boot process}}
{{Article summary wiki|Arch Boot Process}}
+
{{Related articles end}}
{{Article summary end}}
+
 
+
 
After the boot process, the screen is cleared and the login prompt appears, leaving users unable to read init output and error messages. This default behavior may be modified using methods outlined in this article.
 
After the boot process, the screen is cleared and the login prompt appears, leaving users unable to read init output and error messages. This default behavior may be modified using methods outlined in this article.
  
Line 21: Line 19:
 
== Have boot messages stay on tty1 ==
 
== Have boot messages stay on tty1 ==
  
By default, arch has the {{ic|getty@tty1}} service enabled. The service file already passes {{ic|--noclear}}, which stops agetty from clearing the screen. However [[systemd]] clears the screen before starting it. To disable this behavior edit your getty service file and set
+
By default, arch has the {{ic|getty@tty1}} service enabled. The service file already passes {{ic|--noclear}}, which stops agetty from clearing the screen. However [[systemd]] clears the screen before starting it. To disable this behavior, create a drop-in directory {{ic|/etc/systemd/system/getty@tty1.service.d/}} and create a {{ic|noclear.conf}} file in it:
{{hc|1=/etc/systemd/system/getty.target.wants/getty@tty1.service|2=TTYVTDisallocate=no}}
+
{{hc|1=/etc/systemd/system/getty@tty1.service.d/noclear.conf|2=
 +
[Service]
 +
TTYVTDisallocate=no
 +
}}
 +
 
 +
This overrides only {{ic|TTYVTDisallocate}} for agetty on TTY1 and let the global service file {{ic|/usr/lib/systemd/system/getty@.service}} untouched. This is the recommended way to [[Systemd#Editing provided units|edit systemd unit files]].
  
 
Late KMS starting may still cause the first few boot messages to clear. If this is the case, try enabling [[KMS#Early KMS start|early KMS start]].
 
Late KMS starting may still cause the first few boot messages to clear. If this is the case, try enabling [[KMS#Early KMS start|early KMS start]].
  
There will probably be too many boot messages to view on one screen. Use Shift+PgUp/PgDown to scroll. If there are too many boot messages you still might not be able to see all of them by scrolling. Try increasing the size of your [[Scrollback buffer|scrollback buffer]].
+
There will probably be too many boot messages to view on one screen. Use Shift+PgUp/PgDown to scroll. If there are too many boot messages you still might not be able to see all of them by scrolling. Try increasing the size of your [[scrollback buffer]].
  
 
=== Disable clearing in /etc/issue ===
 
=== Disable clearing in /etc/issue ===

Latest revision as of 07:02, 22 April 2016

Related articles

After the boot process, the screen is cleared and the login prompt appears, leaving users unable to read init output and error messages. This default behavior may be modified using methods outlined in this article.

Note that regardless of the chosen option, kernel messages can be displayed for inspection after booting by using dmesg or all logs from the current boot with journalctl -b.

Using flow control

This is basic management that applies to most terminal emulators, including virtual consoles (vc):

  • Press Ctrl+S to pause the output
  • And Ctrl+Q to resume it
Note: This pauses not only the output, but also programs which try to print to the terminal, since they'll block on the write() calls for as long as the output is paused. If your init appears frozen, make sure the system console is not paused.

Have boot messages stay on tty1

By default, arch has the getty@tty1 service enabled. The service file already passes --noclear, which stops agetty from clearing the screen. However systemd clears the screen before starting it. To disable this behavior, create a drop-in directory /etc/systemd/system/getty@tty1.service.d/ and create a noclear.conf file in it:

/etc/systemd/system/getty@tty1.service.d/noclear.conf
[Service]
TTYVTDisallocate=no

This overrides only TTYVTDisallocate for agetty on TTY1 and let the global service file /usr/lib/systemd/system/getty@.service untouched. This is the recommended way to edit systemd unit files.

Late KMS starting may still cause the first few boot messages to clear. If this is the case, try enabling early KMS start.

There will probably be too many boot messages to view on one screen. Use Shift+PgUp/PgDown to scroll. If there are too many boot messages you still might not be able to see all of them by scrolling. Try increasing the size of your scrollback buffer.

Disable clearing in /etc/issue

If you have an old /etc/issue that has the "clear TTY" escape sequences, remove them.

# sed -i $'s/\e\[H//; s/\e\[2J//' /etc/issue