Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know I can run dmesg to look at boot errors. However, my system is failing to boot right now. It hangs indefinitely while trying to initialize hard drives. However, I can boot up into safe mode.

When I boot up in safe mode and look at dmesg it does not contain old boot messages. It just contains the boot messages from the current boot-up into safe mode.

How do I save the dmesg log (or any log for that matter) during the failed boot process so that I can view it when I log in to diagnose via save mode?

share|improve this question

You need to enable boot logging by opening a terminal and typing the following:

$ sudo gedit /etc/default/bootlogd

The text editor will open, and the following will be show:

#Run bootlogd at startup ?



Now, everytime you restart, /var/log/boot will be created, and it will contain a log of all your boot messages. You need to be root to open it, so you can easily open it up again with sudo.

share|improve this answer
I tried your suggestion... but /var/log/boot was empty? – dinkelk Aug 9 '13 at 12:31
@dinkelk maybe I missed some detail take a look here: – vfbsilva Aug 9 '13 at 13:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.