You are here: Home / Upgrade OpenBSD

Upgrade OpenBSD

As needed, upgrading installed versions of OpenBSD in-place...

Remember: Upgrades are only supported from one release to the release immediately following it.

Next, boot from the install kernel, bsd.rd: use bootable install media, or place the 6.2 version of bsd.rd in the root of your filesystem and instruct the boot loader to boot this kernel. Once this kernel is booted, choose the (U)pgrade option and follow the prompts. Apply the configuration changes and finish up by upgrading the packages: pkg_add -u.

Alternatively, you can use the manual upgrade process.

You may wish to check the errata page or upgrade to the stable branch to get any post-release fixes.

 

The ramdisk kernel (bsd.rd)

The bsd.rd ramdisk kernel is a live OpenBSD environment that runs entirely in memory. It contains the install script and a small number of utilities needed to perform a complete installation. These utilities can also be useful for disaster recovery. The installation media automatically boots into bsd.rd and starts the install script for you.

If you have a running OpenBSD system, bsd.rd is all you need to reinstall or upgrade to a newer version. To do so, download and verify the new bsd.rd, place it on an existing filesystem and boot from it. The general method of booting bsd.rd is to change your boot kernel from /bsd to /bsd.rd through whatever means used on your platform.

For example, booting from bsd.rd on an amd64 system:

Using drive 0, partition 3.
Loading......
probing: pc0 com0 com1 mem[638K 1918M a20=on]
disk: hd0+ hd1+
>> OpenBSD/amd64 BOOT 3.33
boot> boot hd0a:/bsd.rd

This will boot the kernel named bsd.rd from the a partition of the first recognized hard disk. The OpenBSD boot loaders are documented in the architecture-specific boot(8) man pages.

 

Before Update/upgrade:

Before rebooting into the install kernel

  • clean out /usr/share/man. To remove all outdated manuals, issue rm -rf /usr/share/man.

     

  • ksh plaintext history file. The ksh(1) history file (used when $HISTFILE is set) changed from a binary file format to plaintext. If you wish to retain your current ksh history, create a plaintext version of it before upgrading:
      $ fc -ln 1 | cut -f2- > ~/ksh_hist.txt 
    After the upgrade, you can use ksh_hist.txt as your history file.

    If you mount HOME via NFS, ensure that machines running 6.2 use a different HISTFILE than machines running 6.1 or earlier.

     

  • breaking change for nvme(4) users with GPT. If you are booting from an nvme(4) drive with a GPT disk layout, you are affected by an off-by-one in the driver with the consequence that the sector count in your partition table may be incorrect. The only way to fix this is to re-initialize the partition table. Backup your data to another disk before you upgrade. In the new bsd.rd, drop to a shell and re-initialize the GPT:
      # fdisk -iy -g -b 960 sdN 
    Then do a fresh install and restore the data from the backup.

 

Doesn't affect this install on dev5-obsd

fdisk -v wd0
Primary GPT:
        Not Found

Secondary GPT:
        Not Found

MBR:
Disk: wd0       geometry: 38913/255/63 [625142448 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
*3: A6      0   1   2 -  38912 254  63 [          64:   625137281 ] OpenBSD

 

 

  • resize /usr/obj. If you build your own releases on the amd64 or i386 platforms, you need to make sure that you have at least 3G available on /usr/obj.

     

Doesn't affect this install on dev5-obsd

 

  • adjust group ownership of existing at(1) jobs. The cron(8) daemon requires at(1) files in the spool to be owned by group crontab.
      # chgrp -R crontab /var/cron/atjobs 

 

 

 

 

6.1 to 6.2

 

cd (to be in /root user direct,not / )

wget https://mirror.vdms.io/pub/OpenBSD/6.2/amd64/bsd.rd

or bsd.mp for multiprocessor machine

 mv bsd.rd bsd62.rd                                                                                          
# cp bsd62.rd /

cd /

mv bsd.rd bsd61.rd
# cp bsd62.rd bsd.rd

Then reboot and it will load the new bsd62.rd install kernel

At boot prompt, enter bsd62.rd then <enter>

When prompted (it should list 6.2), select (U)pgrade

Select appropriate disk (wd0)

Location of sets: [http]

Przy: [none]

Http server:  (whatever mirror you want to use can eaccept suggested, just make sure it is online and has same dir strcuture)

Accept default dir strucgof of server proposed make sure matches your platform type.

upgrade all pacakges as desired.

 

reboot when prompted.

 Watch for errors during bootup, messages usually guide you on what to fix.

May need to run sysmerge if custom config files, for example ssh in /etc/ssh/sshd_config

 Finalize upgrade of packages: 

pkg_add -u.

 

sync config files with sysmerge

 

upgrade/update ports:

# cd /usr/ports
# cvs -d anoncvs@server.openbsd.org:/cvs update -Pd -rOPENBSD_6_4

need to change server name specifically:

 

cvs -d anoncvs@cdn.openbsd.org:/cvs update -Pd -rOPENBSD_6_4

if first time:
cvs -d anoncvs@anoncvs.spacehopper.org:/cvs checkout -P src
 

 

 

 

 

6.2 go 6.3

 

login/su to root

make sure in /root dir not /

wget https://mirror.vdms.io/pub/OpenBSD/6.3/amd64/bsd.mp (for multiprocessor system, or bsd.rd for single processor)

Hmm, right after upgrade from 6.1 to 6.2 getting error with trying to use wget:

 wget --help
/usr/local/bin/wget[1]: syntax error: `^Z^Y^F444' unexpected

 

 

 

 

 

Upgrade 6.2 to 6.3

 

https://www.openbsd.org/faq/upgrade63.html

 

 

 

 

 

 

 

 

 

 

 

Filed under:
Navigation