At some point, you might want to upgrade your NetBSD base system, be it due to a Security Advisory or just because you want to try the coming release.
Although, this is covered on Chapter 4 of the NetBSD-guide, I'm writing here a short walk through of the process as I usually do it.
You can either use sysinst
or sysupgrade
to do this. Actually, you can do it all manually if you wish but, I won't cover that option here, as this means you know what you are doing and won't be needing to read this 😉
Using sysupgrade
is somewhat limited, quoting the Guide:
NOTE: upgrades across major binary releases might not work properly because of the lack of a reboot between the kernel installation and the unpacking of the sets.
so, I prefer to use sysinst
to do the job. As an example, I'm upgrading my own system (9.0_RC1) using the images from the daily-builds. In fact, I'm upgrading within the same release but, the procedure is in all similar when updating across releases, with the exception that, you might need some adjustments in /etc
afterwards.
HEADS-UP!!!
Any of the following may result in data loss! Back-up all important data before doing this!
Download the most recent image for your system, mine is amd64 and I'm using legacy boot.
Once you have downloaded the image, verify its integrity against the published sums, if the image sum matches, proceed with the unpacking
$ cd Downloads/
$ cksum -a MD5 NetBSD-9.0_RC1-amd64-install.img.gz
MD5 (NetBSD-9.0_RC1-amd64-install.img.gz) = c89aaa14380d065bbba57424cc260a5b
$ gunzip NetBSD-9.0_RC1-amd64-install.img.gz
Attach an usb-device and check for its presence,
$ sysctl hw.disknames
hw.disknames = wd0 sd0
$ dmesg
...
[ 885.151377] sd0 at scsibus0 target 0 lun 0: <Kingston, DataTraveler 3.0, PMAP> disk removable
[ 885.161381] sd0: fabricating a geometry
[ 885.161381] sd0: 14784 MB, 14784 cyl, 64 head, 32 sec, 512 bytes/sect x 30277632 sectors
[ 885.161381] sd0: fabricating a geometry
Copy the unpacked image to your device using dd
and shutdown the system
$ pwd
/home/pin/Downloads
$ doas dd if=NetBSD-9.0_RC1-amd64-install.img of=/dev/rsd0d bs=2m
Password:
725+0 records in
725+0 records out
1520435200 bytes transferred in 66.967 secs (22704245 bytes/sec)
$ doas shutdown -p now
Time to boot from the install image and upgrade your machine!
Once you have booted the install media and picked your keyboard layout, choose option
>b: Upgrade NetBSD on a hard disk
Answer Yes to the next question and choose the target disk.
Proceed with choosing bootblocks
>a: Use BIOS console
followed by choosing the distribution filesets
>a: Full installation
Pick the source
>a: CD-ROM/DVD/install image media
...and let sysinst
do its job 🙂
When prompted Hit enter to continue
Back at the start installation screen choose
>x: Exit Install System
At the bottom of your screen type
#shutdown -p now
Remove the install media, boot-up the machine... et voilà