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 2nd March 2018
Prevet Prevet is offline
Shell Scout
 
Join Date: Oct 2017
Posts: 84
Default Relinking to create unique kernel... failed!

I installed Windows 7 on a second hard drive on my system. Since then when I try to boot OpenBSD normally, it sits at the boot prompt until I press enter and then it restarts the machine bringing me back to the boot prompt. The only way I can get OpenBSD to start is to boot bsd.sp.

Also when I run syspatch I get the message "Relinking to create unique kernel... failed!"

What should I do to fix this?
Reply With Quote
  #2   (View Single Post)  
Old 2nd March 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Unfortunately, there is not enough information in your post to determine what the problem might be.

"Sits at the boot prompt" could be due to a provisioning in /etc/boot.conf. "Restarts the machine" might produce an error message you have not seen or have not reported. Failure to relink the kernel might be insufficient space in the filesystem containing /usr/share.
Reply With Quote
  #3   (View Single Post)  
Old 2nd March 2018
Prevet Prevet is offline
Shell Scout
 
Join Date: Oct 2017
Posts: 84
Default

Thanks for your help jggimi.

I don't have a boot.conf file.

When it restarts the screen goes black like it has crashed. I will try rebooting again and watch it carefully to see if any messages show up.

When I get it to boot from bsd.sp a warning I always see is / was not unmounted properly.

How do I determine the available space for user share? What should I delete from there to free up space?

Something else I noticed is there is no bsd.mp file. So perhaps it is trying to load it and it crashes because it isn't there?

-rwx------ 2 root wheel 12.5M Feb 22 01:09 bsd
-rwx------ 2 root wheel 12.5M Feb 22 01:09 bsd.booted
-rwx------ 1 root wheel 12.5M Nov 26 10:33 bsd.sp
-rwx------ 1 root wheel 12.6M Feb 21 23:42 obsd

Also I am wondering if I should copy the obsd file over the bsd file. Perhaps the bsd file was corrupted.


Edit:
I could not read the message when the screen goes black when I try to boot bsd, it is too fast.

I just tried booting from obsd and it works, I have multiprocessors working again. So I assume if I copy that over the bsd file it will load okay. Now I just have to figure out what is causing the relinking error.

Last edited by Prevet; 2nd March 2018 at 01:32 PM.
Reply With Quote
  #4   (View Single Post)  
Old 2nd March 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by Prevet View Post
I don't have a boot.conf file.
The default for architectures that have a boot> prompt is to wait 5 seconds for any keyboard input. If there is no keyboard input, the bootloader will then attempt to load the /bsd kernel from the the "a" partition.
Quote:
When it restarts the screen goes black like it has crashed. I will try rebooting again and watch it carefully to see if any messages show up.
Depending on the hardware, the dmesg(8) buffer may not be cleared on reboot. A failure message, if recorded in the buffer, might appear in the buffer after successfully booting /bsd.sp.
Quote:
When I get it to boot from bsd.sp a warning I always see is / was not unmounted properly.
That will occur whenever the previous mount of the filesystem was not cleanly unmounted.
Quote:
How do I determine the available space for user share?
The directory is /usr/share/. Usually, this will be a directory within the /usr/ filesystem. The df(1) command will show the current capacities of all mounted filesystems. $ df -h will show the space in easy-to-understand KB/MB/GB/TB format.
Quote:
What should I delete from there to free up space?
If this is actually the problem, you can delete the contents of /usr/share/compile/.
Quote:

Something else I noticed is there is no bsd.mp file. So perhaps it is trying to load it and it crashes because it isn't there?
No, during installation on a multi-CPU system, the installer saves the GENERIC kernel as "bsd.sp", and the GENERIC.MP kernel as "bsd" so your root directory would not contain a /bsd.mp file.
Quote:
Also I am wondering if I should copy the obsd file over the bsd file. Perhaps the bsd file was corrupted.
You can just select it by name at the boot> prompt to test it, and if that solves your immediate problem, you can then copy it.
Reply With Quote
  #5   (View Single Post)  
Old 2nd March 2018
Prevet Prevet is offline
Shell Scout
 
Join Date: Oct 2017
Posts: 84
Default

Thanks jggimi. The /obsd file also made the improper dismount message go away.

I just noticed a message telling me to read a file called relink.log.

Quote:
/usr/share/compile/GENERIC.MP/relink.log
sha256: /var/db/kernel.SHA256: no properly formatted checksum lines found
sha256: /bsd does not exist in /var/db/kernel.SHA256
Do I need to do anything concerning it? Or should I delete the contents of the compile directory, copy /obsd across to /bsd and run syspatch?
Reply With Quote
  #6   (View Single Post)  
Old 3rd March 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Is /usr, or a related filesystem full?
Reply With Quote
  #7   (View Single Post)  
Old 4th March 2018
Prevet Prevet is offline
Shell Scout
 
Join Date: Oct 2017
Posts: 84
Default

Quote:
Originally Posted by jggimi View Post
Is /usr, or a related filesystem full?
It doesn't look like it is full, though /usr only has 2G maximum and has used up 1G..

55% /usr
19% /usr/X11R6
29% /usr/local
0% /usr/obj
0% /usr/src
Reply With Quote
  #8   (View Single Post)  
Old 4th March 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

It looks to me like there was a problem during kernel relinking. It is merely a guess on my part, but it appears you will be able to recover by using the /obsd kernel.
Reply With Quote
  #9   (View Single Post)  
Old 4th March 2018
TronDD TronDD is offline
Spam Deminer
 
Join Date: Sep 2014
Posts: 304
Default

You either don't have /var/db/kernel.SHA256 or, because you were copying kernels around, it's out of sync.

Relinking won't happen if it doesn't find the expected kernel so a sha256 sum is kept to check against.

Recreate the file as root:
Code:
sha256 /bsd > /var/db/kernel.SHA256
Reply With Quote
Old 31st May 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

The source is not used to relink, but the object modules are, and these are included in the base fileset.

The script that runs kernel relinking is /usr/libexec/reorder_kernel. Within the -current version of this script, this test outcome and explanation is not in the -release version of the script. But it may be helpful to understanding the problem.

In this script, the variable $SHA256 was previously set to /var/db/kernel.SHA256:
Code:
if ! sha256 -C $SHA256 /bsd; then
         cat <<__EOF

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 $SHA256 /bsd
__EOF
        # Trigger ERR trap
        false
fi
Try issuing the sha256(1) command with the -h option, rather than piping the output to the file.

Last edited by jggimi; 31st May 2018 at 10:15 AM. Reason: clarity, one typo
Reply With Quote
Old 31st May 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

I will guess that you did not understand the use of the variable $SHA256 inside that script, and have replaced your /bsd kernel with a hash file.

To recover:

  1. Boot /bsd.booted or /bsd.sp
  2. # cp /bsd.booted /bsd
  3. # sha256 -h /var/db/kernel.SHA256 /bsd
  4. # reboot
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
Create OpenBSD guest for Linux KVM (Kernel-based Virtual Machine) with 'virt-install' J65nko Guides 4 11th December 2014 04:30 AM
issue with /tmp .. resizing failed .. how to nuke it and create a new one ? daemonfowl OpenBSD General 8 20th May 2012 08:44 PM
why does it fail to create drawable ? daemonfowl OpenBSD General 4 11th May 2012 03:33 PM
g4u -> create just one boot floppy ccc NetBSD General 4 19th June 2011 04:46 PM
Create ISO from Dump Files revzalot OpenBSD Installation and Upgrading 3 2nd December 2010 08:49 PM


All times are GMT. The time now is 07:14 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