Solved freebsd-update: Cannot identify running kernel.


Well-Known Member

Reaction score: 13
Messages: 319

Tried but doesn't seem to work.

# freebsd-update --currently-running 12.1-RELEASE-p2 fetch
src component not installed, skipped
Cannot identify running kernel


Staff member

Reaction score: 9,813
Messages: 34,975

How are you starting FreeBSD? Through GRUB perhaps? If I recall correctly there's a setting you need to add to GRUB or you'll run into problems like this.


Well-Known Member

Reaction score: 13
Messages: 319

No loader="bhyveload" and i've upgraded that system like this before, never had any problems.


This is an full disk encrypted system. So boot is the only part that is unencrypted and is mounted to a separate partition under /unenc/. There used to be a link to /unenc/boot but that link had been removed for some reason.

Since freebsd-update checks if the directory /boot/kernel exists to produce that error it was only normal that it produced that error.

        # Figure out what directory contains the running kernel
        BOOTFILE=`sysctl -n kern.bootfile`
        if ! [ -d ${KERNELDIR} ]; then
                echo "Cannot identify running kernel"
                exit 1

So recreating that directory ln -s /unenc/boot in / fixed the issue.

And after upgrade surprise:

kernel trap 12 with interrupts disabled

Fatal trap 12: page fault while in kernel mode
cpuid = 1; apic id = 01
fault virtual address   = 0x20
fault code              = supervisor read data, page not present
instruction pointer     = 0x20:0xffffffff80c34577
stack pointer           = 0x28:0xfffffe00005b4ec0
frame pointer           = 0x28:0xfffffe00005b4ed0
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = resume, IOPL = 0
current process         = 48524 (fsck_ufs)
trap number             = 12
panic: page fault
cpuid = 1
time = 1586861960
KDB: stack backtrace:
#0 0xffffffff80c1d2f7 at kdb_backtrace+0x67
#1 0xffffffff80bd062d at vpanic+0x19d
#2 0xffffffff80bd0483 at panic+0x43
#3 0xffffffff810a7dcc at trap_fatal+0x39c
#4 0xffffffff810a7e19 at trap_pfault+0x49
#5 0xffffffff810a740f at trap+0x29f
#6 0xffffffff81081bdc at calltrap+0x8
#7 0xffffffff80bb03c9 at __mtx_unlock_sleep+0xb9
#8 0xffffffff80eb2ffd at ffs_alloccg+0x40d
#9 0xffffffff80eb2992 at ffs_alloc+0x2c2
#10 0xffffffff80ebb836 at ffs_balloc_ufs2+0x10a6
#11 0xffffffff80ebe5d7 at ffs_snapshot+0x837
#12 0xffffffff80ee655a at ffs_mount+0x12da
#13 0xffffffff80c97ccb at vfs_domount+0x74b
#14 0xffffffff80c96ed1 at vfs_donmount+0x991
#15 0xffffffff80c96511 at sys_nmount+0x71
#16 0xffffffff810a8984 at amd64_syscall+0x364
#17 0xffffffff81082500 at fast_syscall_common+0x101
Uptime: 3m39s

Rebooted and is still running

 # uptime
 2:14PM  up  1:12, 1 user, load averages: 0.17, 0.63, 1.18