On 5/10/25 14:45, Lloyd wrote:
I've run across this a few times, where I've improperly shut down
a VM (tapped the wrong button for power off vs ACPI shutdown) and
    ^^ well, an alarm bell just went off in my head. :)

this lead to an unbootable image with the message before boot:

booting hd0a:/bsd: hd0a:/bsd: Inappropriate file type or format
failed(79). will try /bsd
boot>

To recover, I usually boot into bsd.rd and fsck the filesystems,
but in most cases the cause is a corrupted /bsd. Indeed, the last
encounter with this, /bsd had a size of only a few dozen kilobytes.

To fix, I rm /bsd && cp /bsd.booted /bsd - reboot, re-calculate
the checksum and I'm on my way again. I'd like to understand why
this is happening. Is this plain unlucky FFS corruption or did I
trigger the power-off during the kernel reorder sequence and it
had only partially written out the file to disk?

the kernel replacement should be "atomic" -- basically this:
   mv -f newbsd bsd
(from -- in my case -- /usr/share/relink/kernel/GENERIC.MP/Makefile)

so no..that shouldn't be the cause.  I believe something is actively
CORRUPTING your file system, not just "stuff didn't finish getting
written".
Since I have encountered this more than once now, is there a way
to increase the resiliency?  The host is on UPS power, so the
cause is almost always user error (accidental power off). Could
disabling kernel relinking in the image improve the situation?

wild guess: you have a "single partition" model, rather than the
suggested, so rather than the root file system being fairly quiet
during normal operation, you have a lot of overall filesystem
churn taking place. (I'm not a FS person...so I may be full of
****).

Also ... I'd be suspicious of your VM system being involved.  You
didn't name it...but on real HW with modest file systems when I'm
being lazy, I just yank power cords often, and lately, my power
hasn't been very reliable, and I don't think I've ever seen the
kernel itself be corrupted by an unexpected outage (which is
quite painful on multi-TB file systems).  So I suspect you and I
are doing something different (I'm running mostly physical HW and
using a multiple partition layout based closely on the ideals of
the default install).
Nick.

Reply via email to