packetmischief.ca

OpenBSD Software RAID Administration: Upgrading OpenBSD


Upgrading

This is the process for upgrading OpenBSD on a RAIDframe-enabled machine.

Checklist:

Boot the install media. Perform a clean install on wd0 (not an upgrade). At a minimum, install the baseXX.tgz and etcXX.tgz disksets along with bsd. When the installation is complete, copy the RAID-enabled kernel to /.

Reboot the system. At the boot> prompt, type "boot -a". As per the boot(8) manpage:

-a   Causes the kernel to ask for the root device to use.

When the kernel prompts for the root device, enter wd0a. Now the sytem will come up with wd0a mounted as root and with a kernel booted that's capable of seeing the raid0 device.

Now upgrade the installation on the RAID volume. Begin by formatting the disklabels on the volume, save for /home. After, mount them all under /mnt.

# newfs raid0a
# newfs raid0d
# newfs raid0f
# newfs raid0g
# mkdir -p /mnt/usr /mnt/var /mnt/tmp /mnt/home
# mount /dev/raid0a /mnt
# mount /dev/raid0d /mnt/usr
# mount /dev/raid0e /mnt/home
# mount /dev/raid0f /mnt/var
# mount /dev/raid0g /mnt/tmp

Extract the OpenBSD disksets to /mnt. If you took a full backup of /etc before beginning, it's not necessary to extract the etcXX.tgz diskset at this time.

# tar zxvpf baseXX.tgz -C /mnt
# tar zxvpf manXX.tgz -C /mnt
... more disksets as necessary ...

Run MAKEDEV on the RAID volume and copy the RAID-enabled kernel onto the RAID volume.

# cd /mnt/dev
# cp /dev/MAKEDEV .
# ./MAKEDEV all
# cp /bsd.raid /mnt

Finally, restore any and all backups taken before the install. If /etc was not part of your backups, at this point you should edit certain key files, such as /mnt/etc/myname, /mnt/etc/mygate, /mnt/etc/hostname.*, /mnt/etc/rc.conf.local, etc.

Reboot the system. Boot the RAID-enabled kernel in single-user mode. Mount all filesystems read-write.

# mount -uw /
# mount -a

Install the mergemaster package (plus any dependancies) from the install media or from an FTP mirror. Extract the etcXX.tgz diskset to a temporary directory and run mergemaster on it to update the files in /etc with their newer versions.

# mkdir /tmp/etc && tar zxpf etcXX.tgz -C /tmp/etc
# mergemaster -rt /tmp/etc
... follow mergemaster prompts ...

Now, some final clean-up work.

Disclaimer

I make no guarantees about the accuracy or fitness of information within this article. The information within is accurate and true to the best of my knowledge. I will not be held responsible for data loss or system downtime.