Viewing Linux Boot Messages
either during bootup or in log files
Booting the computer --- and
no longer caring about its messages.
! Note !
I may try some things to get a better view
of boot messages on my Linux system(s).
A few more notes and lists may be added,
if/when I re-visit this page in the future.
(to showing various boot messages --- and the Grub2 boot menu)
In 2015, I was still using the Ubuntu 9.10 Linux operating system (the 2009 October release, 'Karmic Koala') --- with the Grub 2 boot system --- on my main desktop computer.
Using the 'right-SHIFT' key, which is supposed to cause the Grub2 menu to show up during bootup (according to https://help.ubuntu.com/community/Grub2), DID NOT WORK (for me) --- on my desktop system (which is running Ubuntu 9.10 --- with NO dual-boot to MS Windows).
Since I am running no other operating system on this computer, Grub2 defaults to not showing the Grub2 menu (as documented in the section https://help.ubuntu.com/community/Grub2/Setup#Specific_Entries). Instead, the bootup process proceeds immediately into the kernel bootup sequence --- although the documentation says that the (right) SHIFT key should allow for showing the Grub2 menu, even in the case of running just one operating system.
Although I am running just one operating system (Linux), my Grub2 menu will show several versions of the Linux kernel --- which were installed in several Ubuntu software update sessions.
Partial success :
In case this is of any help to other Linux Grub2 users, here is what I did to get the boot messages (kernel and 'init.d' messages) to show --- AND allow for bringing up the Grub2 menu with the right-SHIFT key:
I logged in and opened a gnome-terminal window and used the following commands.
sudo cp grub grub_ORIG
sudo gedit grub
In the 'grub' file, I changed the line
I also changed the line
AND I changed the commented line
I saved the '/etc/default/grub' file --- along with a backup to the file '/etc/default/grub_2015apr24' --- using the 'gedit' text editor's save-file options.
Then I made a backup of the '/boot/grub/grub.cfg' file with the following commands.
sudo cp grub.cfg grub.cfg_ORIG
Then I ran the command 'update-grub'. This put appropriate changes in the file '/boot/grub/grub.cfg'. I could see the changed lines by using the command
diff grub.cfg grub.cfg_ORIG
Then I shutdown and booted up again.
Now, after some BIOS boot messages, I can hold down RIGHT-SHIFT (in a 6 second interval of time?) and the Grub2 menu shows up (for up to 10 seconds).
At the Grub2 menu, I can press Enter to go into the default Linux boot up. Boot messages now show --- instead of about 20 seconds of looking at a small Ubuntu logo in the middle of the screen --- until an Ubuntu login-screen appears.
This 20-seconds of boot messages is on a desktop system with a 4-core AMD Athlon X4 630 processor chip. On my lower-powered netbook computers, the boot messages may show a little more slowly, for a total of about 40 seconds.
By the way, on my Ubuntu 9.10 machines, 'grub-install -v' shows
grub-install (GNU GRUB 1.97~beta4)
This was an early version of Grub2.
Similar boot results can be expected in a 'Debian' or 'Linux Mint' Grub2 bootup (for Linux releases in the 2009 to 2015 time frame). That is, the above changes to the '/etc/default/grub' file and running 'update-grub' should
The 'right-SHIFT' key may work for some Linux-Grub2 users, to show the Grub2 menu, without 'grub.cfg' changes like those above.
I found that on my Acer netbook computers, the 'right-SHIFT' key DID cause the Grub2 menu of Ubuntu 9.10 to display --- with NO 'grub.cfg' changes. The difference may be that the netbook computers are using an Intel video/graphics controller, while my desktop is using an AMD video/graphics controller.
So some Linux-Grub2 users (perhaps AMD and/or Nvidia graphics users) may need to change the statement
to something like
(or comment this statement) in order to enable the right-SHIFT key to show the Grub2 menu.
AND, for essentially all Linux-Grub2 users, changing the line
should cause the kernel and 'init.d' scripts' boot messages to be displayed. However, the boot messages 'zip by' --- a lot of them disappear at the top of the screen. Hence I say that I had 'partial success'.
Right-SHIFT works in certain cases : (reiterating what was said above)
I indicated that I changed the Grub2 statement 'GRUB_HIDDEN_TIMEOUT=' from zero to non-zero in order to be able to use the right-SHIFT key to get boot messages to show.
I found out that, on my Acer netbook computer, I did not need to change 'GRUB_HIDDEN_TIMEOUT=0' for the right-SHIFT key to force boot messages to show.
The Acer netbook uses an Intel Atom chip and Intel video graphics (with associated video configuration files and driver software), while my desktop computer uses an AMD chip and ATI Catalyst video graphics (with associated video configuration files and driver software).
It appears that, depending on the type of video graphics that Grub2 users have, the right-SHIFT key may or may-not work for you --- to get boot messages to show on screen.
Changing the text size for kernel and 'init.d' boot messages :
I pointed out above that I was able to set the Grub2 variable 'GRUB_GFXMODE' to control the text size that Grub2 uses, for example, in showing the Grub2 boot menu and the Grub2 edit-prompt.
in the '/etc/default/grub' file --- followed by using the 'sudo update-grub' command --- worked nicely for my monitor.
However, the 'GRUB_GFXMODE' parameter does not affect the size of the text used for messages coming from the kernel and from various bootup scripts in the '/etc/init.d' directory.
Some forums have suggested the following for early versions of Grub2 --- but this did not work for me.
In the file '/etc/grub.d/00_header', try a 'set gfxpayload' statement like
Then run 'update-grub' to put the 'gfxpayload' statement in the '/boot/grub/grub.cfg' file.
No luck for me. I may continue to do web searches on keywords such as kernel boot messages text size and init.d boot messages text size to find a method of reducing the text-height of the boot messages coming from the kernel and from the 'init.d' scripts.
The GNU GRUB Manual 2.00 says that if the 'gfxpayload' variable is set, "it controls the video mode in which the Linux kernel starts up, replacing the 'vga=' boot option".
The GRUB manual goes on to say that 'gfxpayload' "may be set to 'text' to force the Linux kernel to boot in normal text mode, 'keep' to preserve the graphics mode set using 'gfxmode', or any of the permitted values for 'gfxmode' to set a particular graphics mode (see 'gfxmode')."
may still work in early versions of Grub2.
I may try this in my early version of Grub2 and report back here on the results.
I put the line
into the '/etc/default/grub' file and ran 'update-grub'. Now I get nice, smaller-sized text for the kernel messages and the messages coming from the 'init.d' scripts.
For reference, here is a 'VGA Resolution and Color Depth Reference Chart' from a www.pendrivelinux.com page, in case that page goes dead.
I probably could have used some other values associated with 1024x768 resolution --- such as 773 or 792. And since my monitor and graphics card supports 1280×1024, I probably could have used values such as 775, 794, or 795 -- which may have given an even smaller font.
I *AM* getting a 'vga=791 is deprecated' message line, near the start of the boot messages --- as indicated in this 2009 Ubuntu forum post. But I can live with that.
If the 'deprecated' message gets annoying, I may try to eliminate it by use of a 'gfxpayload=' statement, as suggested in the 'deprecated' message that is mentioned in the 2009 Ubuntu forum post. But it is not totally clear to me where the 'gfxpayload=' should be placed.
vga=792 is deprecated.
does not make it clear what 'before linux command' means.
I tried 'set gfxpayload=1280x1024' once already, as mentioned above --- in '/etc/grub.d/00_header', followed by the 'update-grub' command. But it did not work for me.
Perhaps using the line
--- as mentioned in the 2009 Ubuntu forum post above --- would work. That may be my next attempt, if the 'deprecated' message becomes really annoying to me. In the 2009 Ubuntu forum post, 'Ubuntist' claimed that all was 'sweetness and light' after he used that form.
By the way, adding a 'GRUB_GFXPAYLOAD_LINUX=1024x768' statement to the '/etc/default/grub' file does not seem to work for me --- with my early version of Grub2. (I think that is one of the things I tried that did not work.) Using 'GRUB_GFXPAYLOAD_LINUX=' supposedly is the recommended way, with later versions of Grub2.
For later versions of Grub2, the environment variable setting statement
may be used in the '/etc/default/grub' file to cause the 'gfxpayload' variable to be set to one of the several values mentioned in the Gnu 'GRUB Manual 2.00' pages on gfxpayload and gfxmode --- namely, 'text', 'keep', or a 'gfxmode' value such as 'auto' or 'widthxheight' or 'widthxheightxdepth'.
Slowing-down Fast-moving Boot Messages (and looking in log files) :
In response to a 2004 forum question at linux.questions.org, someone said:
"You can stop the 'init.d' messages scrolling by hitting 'Ctrl-s'. They continue again with 'Ctrl-q'.
Also 'shift-pgup' and 'shift-pgdown' should scroll the contents of the screen in the console.
Logs of the individual services go to '/var/log/syslog' in Debian Linux and (if I recall correctly) '/var/log/messages' in RedHat Linux."
I may try these key-combinations on my desktop Ubuntu 9.10 system --- which is installed on a home-built PC with an AMD motherboard with an AMD/ATI video/graphics controller. Hopefully, the AMD video/graphics system will respond to these key combinations, as described above.
I plan to report the results here.
Some people have pointed out that the messages from the 'init.d' scripts could be slowed down by putting 'sleep' statements in the 'init.d' scripts. Those statements could be activated/deactivated via some parameter, like a script argument or an environment variable.
Note that the 2004 forum post above suggested looking for the boot messages in the files '/var/log/syslog' and '/var/log/messages'.
On my Ubuntu 9.10 system, I have both 'syslog' and 'messages' log files. In fact, I can see the following files in /var/log:
Here is a full list of the files in /var/log --- for Ubuntu 9.10 --- along with typical file sizes (in bytes) and with ownership userids.
Unfortunately, not all the bootup messages --- from the 'init.d' scripts (and maybe from the kernel) --- are recorded in the various log files in the directory /var/log.
I have looked for various strings that I have seen in boot messages on the screen and have not been able to find some of those strings in any of the log files in /var/log.
I may continue to do web searches on keywords such as init.d boot messages log file to find if there is a way of finding (most of) the 'init.d' boot messages in log files.
Some people have pointed out that the 'init.d' scripts would probably have to be modified to use the 'tee' command, to direct 'sysout' and 'syserr' messages, from those scripts, both to the screen AND into a log file.
An OLD (not recommended) way of putting boot messages in a log file :
In a 2008 blog post at an Ubuntu blog, the following (not recommended) advice was presented.
"If you want to enable boot logging, open a terminal and type the following:
sudo gedit /etc/default/bootlogd
The text editor will open, and the following will be shown:
# Run bootlogd at startup ?
Change BOOTLOGD_ENABLE to yes.
Now, everytime you restart, file /var/log/boot will be created, and it will contain a log of all your boot messages. You may need to be root to open it. You can easily view it again with sudo and a text viewer program."
Some people at the 'HOWTO: Log Boot Messages' thread at ubuntuforums.org have marveled that 'yes' is not the default in '/etc/default/bootlogd'.
They made comments like:
"I was slightly surprised that this was disabled by default".
For example, Marcos.Rufino said:
"For Christ sake!! I've lost hours trying to figure out where I could read the boot log. I really don't know why the developers disabled this log. Thanks!"
BUT at post#28 in that thread, 'pseudonym' says:
"The info 'dmesg' gives you is not the same as what 'bootlogd' used to give you. Instead, it's essentially the same log info as you find in /var/log/messages or /var/log/syslog --- i.e. kernel messages.
Unfortunately, due to some nasty bugs, bootlog has been disabled in Ubuntu since Feisty. See report 98955 at bugs.launchpad.net for details."
At post#46, 'dougie173' says --- in response to a comment that you can find boot logs in the 'messages', 'messages.1', 'messages.2', ... files in /var/log/ :
"Unfortunately [not all] the console [boot] messages [are] in there.
I need to see the full details as there are some unsavory messages that flash past too quick to see and they are not logged in '/var/log/messages'.
Is there any way to increase the verbosity so that it logs all messages?"
'dougie173' did not get a response to this 'how to increase the verbosity' query.
In post#47, 'petteriIII' says:
"Pressing CTRL-s is supposed to pause the scrolling when booting. In my machine it doesn't operate at all without messing with the speed of core in BIOS (that GHz thing) and even then it is not perfect. But it helps sometimes. It helped me to see what I wanted. Scrolling is continued by pressing CTRL-z."
At post#50, 'pgn674' says:
"It hasn't been mentioned yet, so I'll mention it here. For me at least, when /var/log/boot.log is enabled, it doesn't get everything, just the early messages. To see the later stuff, press Ctrl+Alt+F1 after Ubuntu has finished starting up. To get back to your regular screen, press Alt+F7.
I don't know why it switches from printing to the boot.log file to printing to tty1, but the two together seem to paint a pretty complete startup log."
Bottom line :
As of 2015 May 18, I may continue to look for (better) ways to show and examine Linux boot messages --- especially the messages coming from the 'init.d' scripts. (Most of those messages are probably written to a 'sysout' or 'syserr' file in a 'console', and NOT to a log file.)
For those who are using a Linux distro with the new-in-2015 'systemd' boot system, which is an alternative to the 'init.d' scripts, it will be a 'new ball game'. Perhaps 'systemd' will do a better job of logging important boot messages --- or at least allow the user more (and better) options for pausing or slowing down the display of the boot messages.
Bottom of this
To return to a previously visited web page location, click on the
Back button of your web browser a sufficient number of times.
OR, use the History-list option of your web browser.
Page was created 2015 May 18.