Solved freebsd-update: Cannot identify running kernel.

Ofloo

Well-Known Member

Reaction score: 12
Messages: 312

Tried but doesn't seem to work.

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

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,286
Messages: 33,826

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.
 
OP
Ofloo

Ofloo

Well-Known Member

Reaction score: 12
Messages: 312

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

EDIT:

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.

Code:
        # Figure out what directory contains the running kernel
        BOOTFILE=`sysctl -n kern.bootfile`
        KERNELDIR=${BOOTFILE%/kernel} 
        if ! [ -d ${KERNELDIR} ]; then
                echo "Cannot identify running kernel"
                exit 1
        fi
So recreating that directory ln -s /unenc/boot in / fixed the issue.


And after upgrade surprise:

Code:
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

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