DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 28th April 2021
cortez_h cortez_h is offline
New User
 
Join Date: Apr 2021
Posts: 5
Default Power outage during OpenBSD upgrade from 6.7 to 6.8

Hello,
i'm looking for help with a specific problem I encountered due to power outage during OpenBSD upgrade from 6.7 to 6.8

At the very beginning I need to point out that I'm have somewhat limited experience with Linux/Unix but managed to install the system, set up the neccesary httpd/ftp and ssh for the purpose I needed, and kept the system upgraded and patched without problems so far. Now I'm not confident what to do at the moment.

The system has been installed for over a year on an ancient hardware running 6.7 version just fine.

I followed the upgrade using sysupgrade command.
The /usr had over 1,3 GB free space, I've checked that before.
The upgrade packages were downloaded, and the script started the unpacking and upgrade processs.

After reboot, at some point, presumably during unpacking some userland - the system shut down probably due to power outage.

After recoupling the power it booted into 6.8 as it says:


Quote:
cortez@ttyp0:~$ uname -a
OpenBSD satellite.home 6.8 GENERIC#427 i386

however it fails relinking the kernel

Quote:
cortez@ttyp0:~$ cat /usr/share/relink/kernel/GENERIC/relink.log
(SHA256) /bsd: FAILED

Failed to verify /bsd's checksum, therefore a randomly linked kernel (KARL)
is not being built. KARL can be re-enabled for next boot by issuing as root:

sha256 -h /var/db/kernel.SHA256 /bsd
/home/_sysupgrade is rather empty

Quote:
cortez@ttyp0:~$ ls -l /home/_sysupgrade/
total 0
-rw-r--r-- 1 root wheel 0 Apr 27 09:10 SHA256.sig

It seems that no data that was previously downloaded is present on the hdd, as the amount of freespace on /usr is almost without change to what was before running the sysupgrade

Quote:
cortez@ttyp0:~$ df -h /usr
Filesystem Size Used Avail Capacity Mounted on
/dev/wd0d 2.9G 1.0G 1.7G 38% /usr

However veryfying else seems to work fine which means at least that I can boot up, login and main services such as networking, httpd, ftp, sshd, and ntpd work as before.

Now I'm unsure in what exactly state the system is, which means I'm unsure if it upgraded correctly as there was forced break during the process.

So my question is - what should I do to make sure that the system upgraded or not?
Where can I check any logs of what the sysupdate has done and where it stopped?
How to sanitize the situation? I wouldn't like to mess up more so before I start to do anything, I'd like to kindly ask for your assistance and some help.
Thank you in advance.
Reply With Quote
  #2   (View Single Post)  
Old 28th April 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Hello, and welcome!

During boot up, the kernel gets relinked so that with the next boot, module locations shift randomly, which prevent several classes of attacks.
Quote:
A unique kernel is linked such that the startup assembly code is kept in the same place, followed by randomly-sized gapping, followed by all the other .o files randomly re-organized. As a result the distances between functions and variables are entirely new. An info leak of a pointer will not disclose other pointers or objects. This may also help reduce gadgets on variable-sized architectures, because polymorphism in the instruction stream is damaged by nested offsets changing.
The OS will stop further relinking if the relinking chain is ever broken, such as a reboot or power failure during the relinking process. The repair is simple, as was noted in the error message you posted above:
Code:
 # sha256 -h /var/db/kernel.SHA256 /bsd

Last edited by jggimi; 28th April 2021 at 08:49 AM. Reason: typo
Reply With Quote
  #3   (View Single Post)  
Old 28th April 2021
cortez_h cortez_h is offline
New User
 
Join Date: Apr 2021
Posts: 5
Default

Should that be enough? Is there any way to check if there arn't any files missing or corrupted?
And what about sysmerge? Should I use this command?
Reply With Quote
  #4   (View Single Post)  
Old 28th April 2021
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 305
Default

Check root's mailbox. The upgrade process should email you a bunch of messages if it completed.
Reply With Quote
  #5   (View Single Post)  
Old 28th April 2021
cortez_h cortez_h is offline
New User
 
Join Date: Apr 2021
Posts: 5
Default

Unfortunately the root mailbox has not been touched since installation of the system
Quote:
root@ttyp0:~# ls -l ./mbox
-rw------- 1 root wheel 4765 Jul 22 2020 ./mbox
No mail in other superuser account.
Reply With Quote
  #6   (View Single Post)  
Old 28th April 2021
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 305
Default

The mailbox is /var/mail/root

I would rerun the upgrade by booting the bsd.rd and doing it the old fashioned way. If the install didn't finish, who knows what userland files are old. Installboot wouldn't have been run, etc.
Reply With Quote
  #7   (View Single Post)  
Old 29th April 2021
cortez_h cortez_h is offline
New User
 
Join Date: Apr 2021
Posts: 5
Default

/var/mail/root is nonexistent
Quote:
root@ttyp0:/var/mail# ls -l
total 68
-rw------- 1 cortez cortez 33442 Apr 29 02:37 cortez
So, If I understand correctly, your suggestion is to rerun the upgrade again
running the interactive upgrade as described here: https://www.openbsd.org/faq/upgrade68.html

Which if I get it correctly means that I should manually download bsd.rd, then boot it and follow the upgrade path.

Sounds reasonable
Reply With Quote
  #8   (View Single Post)  
Old 29th April 2021
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 305
Default

Yes. Someone correct me if I am wrong, but I think sysupgrade will believe you are already upgraded and won't run again so you'll have to do it with the bsd.rd

I suppose you can try sysupgrade again but we're right on the edge of the 6.9 release and I suppose it's possible that it might try to upgrade you to 6.9 unexpectedly.
Reply With Quote
  #9   (View Single Post)  
Old 2nd May 2021
cortez_h cortez_h is offline
New User
 
Join Date: Apr 2021
Posts: 5
Default

Thank you.
I've gone through the process as advised, and it went smoothly from the beginning to the end.
It has als sent me the e-mails about the sysmerge and fristrun so I suppose it's ok now.
Thank you.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem after upgrade from OpenBSD 6.1 to 6.2 Trihex OpenBSD Installation and Upgrading 4 17th October 2017 10:31 AM
Soft power button doesn't power down ffonz OpenBSD General 4 11th May 2015 02:55 PM
Upgrade from Openbsd 4.6 to Opbsd 4.7 Ultiny OpenBSD Installation and Upgrading 4 21st May 2010 11:07 PM


All times are GMT. The time now is 05:53 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick