Update FreeBSD
Prepare
Backup
TODO: freebsd-update takes snapshots automatically
so it is not needed when upgrading host. But maybe it makes sense
for jails.
zfs snapshotMake backup of /etc
cp -a /etc/ tmp/etcUpgrade current release
Check system integrity
freebsd-update IDS > fu-ids.txtTODO: Check that generic kernel exists
[ -f /boot/GENERIC ] || echo 'There is no generic kernel.'Update the system
freebsd-update fetch
freebsd-update installWhen kernel was changed
shutdown -r +30sUgrade to newer release
It is probably good idea to update the current relase to latest bits before upgrade. I mean system and packages.
freebsd-update -r 15.1-RELEASE upgradeInstall new kernel and boot it.
freebsd-update install
shutdown -r +30sUpgrade system and installed packages.
freebsd-update install
pkg-static upgrade -fFor sure reboot once again.
shutdown -r +30sUpgrading jails
It seems freebsd-update grabs the current system
version from uname and because we update jails after the
host was updated it gets latest version from kernel and don’t want
to update. It is neccessary to tell it what is real jail release
version via --currently-running option. It is probably
needed for ugrade and fetch subcommands as
described on Wiki: Unadulterated
Jails, the Simple Way
jail_name=''
freebsd-update -b "/usr/jail/${jail_name}" -r 15.1-RELEASE --currently-running 15.0-RELEASE-p10 upgrade
freebsd-update -b "/usr/jail/${jail_name}" install # Install kernel
# Reboot is not needed here because new kernel is already running.
freebsd-update -b "/usr/jail/${jail_name}" install # Install user space
pkg -j "${jail_name}" upgrade -f
service jail restart "${jail_name}"Before you’ll continue with another jail, verify that everything works, especially services like DNS and LDAP.
From inside or outside
Where are the downloaded files saved to? /var/db/freebsd-update/
When updating jail from host and from inside, does it differs? It seems when updating from host it doesn’t download all the stuff again.
Upgrade zpool
zpool upgrade zrootUpgrade boot loader
cd /boot/efi/efi/boot
cp -p /boot/loader.efi .
mv bootx64.efi boot64-old.efi && mv loader.efi bootx64.efi
cd /boot/efi/efi/freebsd/
cp -p /boot/loader.efi .Miscellanous notes
mergemaster -i -U -D /usr/jail/<jail_name>