How easy/hard are updates/upgrades?
Matthew Dillon
dillon at backplane.com
Mon Jan 23 10:00:44 PST 2023
Generally I maintain /usr/src on just my home server and NFS mount it on
satellite machines with the 'bg,intr' flags in the fstab entry. But
otherwise when I upgrade satellite machines I almost always just compile
the base system on the machine in question directly. It isn't usually time
critical and building from sources does not really interfere with the
normal operation of the machine while the build is going on. It's
basically just:
cd /usr/src
make build-all
(if successful)
make install-all
And then reboot. Fairly painless when upgrading within the same release.
When upgrading across releases you generally want to also upgrade all
packages to the new release, which is 'pkg upgrade -f'. That can involve a
little extra work to re-vet all system functions that you rely on. And
its easiest to maintain /usr/src via the git repo. 'cd /usr; make' displays
options for installing the repo and bootstrapping the pkg system (if
necessary). Git repos are easy to keep updated, you just 'git pull' to
sync sources within a release branch.
DragonFly's build system does not run mergemaster, ever, and we do not
recommend that anyone use mergemaster on DragonFly. It was one of the
first things I removed when we forked long ago. The utility is still in
the base system, but it is no longer used or recommended. The make
install step will not overwrite user configurable files in /etc. It will
overwrite default files (e.g. in /etc/defaults) which users are not
supposed to modify manually anyway. 'install-all' also runs the make
upgrade step but this is a much tamer version of upgrade than what FreeBSD
does. make upgrade basically just goes through and removes old cruft that
is no longer used by the system, plus a number of other scripted checks to
fix specific issues that we've come across when upgrading in the past (e.g.
it deals with the situation when base libraries were moved around, for
example). And that's it. It is non-invasive.
One really useful feature that the DragonFly bootloader has (and FreeBSD
too) is the ability to boot an older kernel. The make install or make
install-all step cycles the current kernel from /boot/kernel to
/boot/kernel.old before replacing /boot/kernel. Generally speaking, after
you do an upgrade, you also want to manually 'cpdup /boot/kernel.old
/boot/kernel.bak' to create a second backup of your known-working old
kernel. DragonFly never touches or replaces /boot/kernel.bak itself. The
installer menu automatically picks up when /boot/kernel.bak is available
and offers the 'b' option to boot it. These older kernels are stripped to
save space in /boot (which is why you typically don't cpdup /boot/kernel,
because the main kernel on /boot is not stripped).
The boot loader also offers a number of emergency boot options including a
MFS based (loaded by the boot loader itself) boot in case the main root
partition somehow becomes corrupted and is unmountable. The installer USB
image has the full system on a stick, all utilities are available, and the
MFS image has most utilities available for diagnosing and probing a broken
system.
The easiest way to maintain an off-machine backup of your various system is
to use cpdup. I typically set up a dedicated backup machine which has a
ton of storage, no running services, and some scripts to cpdup all the
remote machine's main filesystems to the backup machine daily. cpdup uses
ssh when a remote machine specification is used. HAMMER2 has a
snapshotting feature too, but nothing beats having a dedicated backup box.
-Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20230123/9f10f3aa/attachment-0002.htm>
More information about the Users
mailing list