Disable clearing of boot messages
From ArchWiki
Article summary |
---|
Preventing the boot sequence printout from dissapearing. |
Language |
English |
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.
Contents |
Using flow control
This is basic management that applies to most shells:
- Press Ctrl+S to pause the output
- And Ctrl+Q to resume it
Flexible /etc/rc.local solution
For a more permanent change, add one of the following to the bottom of /etc/rc.local:
- Wait for a keypress before clearing the screen:
read -n1
- Wait for at most 5 seconds or until a keypress occurs:
read -t5 -n1
Delete the first escape code of /etc/issue
The offending escape code: ^[c. Consider that in addition to not clearing the screen after booting, this will stop the screen from being cleared after logging out from regular sessions.
In some cases the whole first line will need to be deleted, as there is more than one instructions, i.e. one clears the screen and the other one places the cursor at the top.
If using the default agetty, it is possible to skip displaying /etc/issue altogether. In /etc/inittab, add the "-i" option for the first virtual console:
c1:2345:respawn:/sbin/agetty -i -8 38400 tty1 linux c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux
Restoring /etc/issue
The characters can't be just typed again into the file; the literal escape character needs to be placed and the way of doing so is editor dependent. In vim:
i (insert) ctrl-v (insert literal character) ESC (insert escape character) c ESC (exit insert mode) ZZ (Save and Exit)
In emacs:
C-q ESC (to insert literal escape)