Search This Blog

2012-10-19

Verbose Boot on FreeBSD

If you're wondering why your system got stuck at the following prompt:
Hit [Enter] to boot immediately, or 1 2 3 for command prompt.

It might be a good idea to see what is actually preventing it from continuing boot on its own.

The way in which you can do this is by hitting the keys 1, 2, 3 in that order to get a prompt

Once you get the 'OK' prompt you can type the commands you wish to run:


Type '?' for a list of commands, 'help' for more detailed help.
OK

We will be setting booting to verbose and then attempting to boot the kernel manually to see what is actually causing the error.

Run the following commands (where OK is the prompt - you do not have to acutally type 'OK')


OK set boot_verbose
OK boot

In this case we have clock calibration issues which are usually due to a drained CMOS battery.

Output:


GDB: no debug ports present
KDB: debugger backends: ddb
KDB: current backend: ddb

Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 6.3-RELEASE-p3 #136: Thu Oct 13 15:05:01 UTC 2011
Preloaded elf kernel "/boot/kernel/kernel" at 0xa0d09000.
Preloaded elf module "/boot/kernel/if_vlan.ko" at 0xa0d091c4.
Preloaded elf module "/boot/kernel/watchdog.ko" at 0xa0d09270.
Calibrating clock(s) ... failed, using default i8254 clock of 1193182 Hz
CLK_USE_I8254_CALIBRATION not specified - using default frequency
Timecounter "i8254" frequency 1193182 Hz quality 0
Calibrating TSC clock ... TSC clock: 3600142209 Hz
CPU: Intel(R) Xeon(TM) CPU 3.60GHz (3600.14-MHz 686-class CPU)


Swap the CMOS battery in this case and the error disappears.
I'm not entirely clear on why a bad CMOS battery skews the clocks but we've found the root cause and learnt how to debug freebsd kernel boot.

No comments:

Post a Comment