On 2020-10-30, Amelia A Lewis <amyz...@talsever.com> wrote:
> It won't start the boot, but displays "No active partition". Checking 
> online, this message seems to indicate a failed upgrade, with the 
> bootloader load incomplete, and (because I was distracted, and running 
> three updates in a state of fatigue), it's actually likely that what I 
> did was to Ctrl-B D out of tmux before it returned from kernel 
> relinking, and then hit doas reboot unthinkingly. Anyway, that's my 
> guess.

If rebooting during relinking does cause some problem I don't think it
would manifest itself like that. (I've done this multiple times - there's
no indication that relinking is still taking place and can take
surprisingly long on systems with poor disk io - and *touch wood*
when issuing rdboot it has been ok so far - though I have been less
lucky with power failures during relinking).

"No active partition" sounds like no MBR partition is marked as active.

I would boot the installer, shell, "fdisk sd0" and see how it looks, or
possonly the MBR partition table is not written correctly or has been
somehow overwritten.

There should be an OpenBSD partition (and maybe some EFI partition if you
use that, I don't use EFI enough to remember..) and one should be
flagged with a * indicating that it's active.

If the partition is there but without a *, edit with "fdisk -e sd0' and use
the "flag" command to set the relevant partition active, e.g. "flag 3".

If some partition information is shown but it doesn't look like it does on
a working OpenBSD system then maybe someone has an idea if you post it here.

If *no* partition is listed there and you are sure that you used a default
"use whole disk for openbsd" when installing then fdisk -i sd0 (if you used
MBR) or fdisk -gi sd0 (if GPT) may help. This writes a new default MBR
partition table with OpenBSD spanning the whole disk but leaves other
information (including the OpenBSD "disklabel" partition table) intact.

> Is there a straightforward way to install kernel and bootloader without 
> requiring a system reinstall? Can I 'upgrade' with an install cd or usb 
> stick from (broken) 6.8+sp3 to 6.8, and then syspatch it up to date?

An 'upgrade' install to the same version would do that but would not mark
the MBR partition as active. I don't think it will fix this problem.

> I'm trying to avoid full reinstall because that seems likely to wipe 
> out existing configuration. I figure my fallback is create install 
> stick/cd (from the other local 6.8, which was successfully updated), 
> boot from that, pull backups of all the configuration so I don't have 
> to reconfigure all the services (and double-check sizes and locations 
> of disk slices on the boot drive, and store that somewhere safe, then 
> reinstall and copy stuff back (it's all backed up, in fact, but it's 
> not backed up recently enough for confidence). So ... faster way to fix 
> my screwup, when I've probably borked my kernel and the bootloader, 
> somehow?

If you need to recover files then I would try doing an install to a USB
stick and boot from that, to give a more full environment than the install
kernel with which to investigate/copy files/etc. Alternatively move the
drive to a working machine as an additional drive and see if you can mount
from there.

That is a couple of steps on though. Check fdisk first.

Reply via email to