From 7e2341c230a3afdc6e500ece0522bd7a018ea4d9 Mon Sep 17 00:00:00 2001 From: Luc Date: Tue, 8 Oct 2024 18:15:52 +0200 Subject: [PATCH] Added an update-protocol section to alpine-server-setup. --- .../post-install/update-protocol.md | 52 +++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 53 insertions(+) create mode 100644 docs/alpine-server-setup/post-install/update-protocol.md diff --git a/docs/alpine-server-setup/post-install/update-protocol.md b/docs/alpine-server-setup/post-install/update-protocol.md new file mode 100644 index 0000000..855d95e --- /dev/null +++ b/docs/alpine-server-setup/post-install/update-protocol.md @@ -0,0 +1,52 @@ +# Update protocol + +ZFS opens up new methods to safely update the system. These methods are described in this section in combination with general practises to maintain ZFS filesystems. + +## Pre-update + +To be able to rollback the system after a system update one may create a snapshot of the root filesystem. + +``` +# zfs snapshot tank/root/alpine@previous +``` + +> Tip: `zfs destroy` can be used to remove snapshots and `zfs list -t snapshot` can be used to list them. + +## Update + +Perform a system update. + +``` +# apk upgrade +# reboot +``` + +If the system does not behave accordingly after reboot, one may rollback to the previous snapshot and further investigate from there. + +``` +# zfs rollback -r tank/root/alpine@previous +``` + +## Post-update + +To maintain the performance of the SSDs in the system, perform a trim on the zfs-pool. + +``` +# zpool trim --secure --wait tank +``` + +> Some devices may not support the option `--secure`, remove it then, if necessary. + +Thereafter, perform a scrub on the zfs-pool which checks and repairs the data in the pool. + +``` +# zpool scrub tank +``` + +This may take a while, the progress can be checked with: + +``` +# zpool status tank +``` + +> A ZFS scrub only repairs if mirror or a zraid mode is used in the pool. \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 7e98742..79b3a91 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -79,6 +79,7 @@ nav: - 'Logging': alpine-server-setup/post-install/logging.md - 'Swap': alpine-server-setup/post-install/swap.md - 'Users': alpine-server-setup/post-install/users.md + - 'Update protocol': alpine-server-setup/post-install/update-protocol.md - 'Containers': alpine-server-setup/post-install/containers.md - 'Void-desktop setup':