What to record before changing a server

A short baseline helps explain what changed after configuration.

Measuring tools in their case and a closed notebook: the starting state before work begins.
Measuring tools in their case and a closed notebook: the starting state before work begins.

You can finish configuring a server with a working system and still lose track of what changed. A service no longer starts, but nobody knows whether it was already broken. The disk is full, yet its initial usage was never recorded. Without a baseline, investigation becomes an exercise in reconstructing events from memory.

The next step needs a short technical record for comparing before and after. Collecting everything is unhelpful: a complete environment dump may contain secrets and creates unnecessary work. The intended change determines the observations you need.

Connect observations to a machine and a time

First establish that you have the correct VPS. SSH key verification establishes trust in the endpoint; the baseline describes that endpoint’s system. Record the date and time, observation method, OS version, running kernel, and boot context. A hostname helps orientation but does not replace identity verification.

State the scope too: “before updating system packages” and “before changing SSH” require different evidence. For SSH, current settings, privilege escalation, and recovery access are particularly important. For updates, record package sources, installed versions, service health, and free space.

Collect enough to compare

Area Baseline observation Why revisit it
OS and kernel System version and actually running kernel Distinguish installing a new kernel from running it
Packages Versions and configured sources Establish what changed and where it came from
Services Active and failed units Detect a new failure after the change
Network Expected listeners and access rules Find a new or missing entry point
Storage Filesystems, free bytes, and inodes Assess changes in consumption and headroom
Configuration Copies of the specific files being changed Compare and prepare a return path

On Debian with systemd, an initial review might include these read-only commands. They are examples for an authorised environment, not observations collected from a particular host.

cat /etc/os-release
uname -r
dpkg-query -W
systemctl --failed
journalctl -b -p warning --no-pager
df -h
df -i

The journalctl manual documents selecting the current boot with -b. The warning filter shows warnings and higher-priority messages, not the entire journal. An empty selection does not prove there are no problems. An ordinary user may also lack access to some messages.

Separate observation from explanation

Suppose one service has already failed before an update. Preserve that fact and separately state whether its cause is known. The same failure afterwards is not automatically caused by the new packages. A second failed service, however, needs its own investigation.

A useful record says: “expected result — observed result — time — method — next action”. If there is no evidence, write “not checked”. An empty cell or a failed command does not mean zero problems.

Comparisons need consistent boundaries. Record a restart between observations; otherwise logs from separate boots may appear to describe one continuous observation.

Select evidence for the particular change

Suppose the next step changes SSH configuration. A general package list provides context, but copies of the relevant configuration files, their includes, and effective service settings matter more for comparison. Separately record whether fresh administrator login works and the console has been checked. One open session answers neither question.

For a system update, establish which services and user scenarios must remain functional. A hypothetical journal should serve an article, while its background process should complete a control task. Successful baseline checks provide a comparison point. If the scenario already failed beforehand, the later result needs its own decision rather than an unsupported explanation of cause.

Define when an observation becomes stale. A new service can invalidate a listener inventory, another package operation can change versions, and a different boot changes journal context. A date alone does not make an old record sufficient. Its usefulness depends on whether the subject of the check remains unchanged.

Do not confuse difference with cause

Even a good before-and-after record primarily establishes a difference. If an update, reboot, and new application deployment occurred between observations, one overall result does not identify the culprit. Investigation needs an event sequence and narrower checks.

Avoid making several unrelated changes simply because the console is already open. Each understandable intermediate state narrows the search. Where actions are inseparable, record them as one planned transition rather than pretending their individual effects were measured separately.

The record must be usable after a failure. Check its availability independently of the server it describes. A baseline stored only on an inaccessible disk does little to help reconstruct the necessary actions when they matter.

E-01 in practice before the first changes

Before making the first changes, I recorded the initial state of the E-01 training server. The purpose was to establish a specific point of comparison before installing services and changing configuration.

I worked over SSH using a previously independently verified ED25519 host key. During this run, I did not install or update packages or change server settings. I saved the commands and their responses separately so that later results can be compared with this initial record.

The system I found after logging in

I first read the hostname and observation time. I then checked the installed OS description and running kernel: the image name selected during purchase had not yet supplied this information from the machine itself.

hostname
date --iso-8601=seconds
cat /etc/os-release
uname -r

hostname returned article-solution200-demo. I selected two lines from the cat /etc/os-release response:

PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
DEBIAN_VERSION_FULL=13.7

uname -r separately reported the running kernel:

6.12.111+deb13-amd64

The initial record therefore describes Debian 13.7 trixie with kernel 6.12.111+deb13-amd64. I have not yet checked the Secure Boot state in this run.

Memory and disk as reported by the system

I used several separate checks for resources:

lscpu
free -h
free -b
swapon --show --bytes
lsblk -b -o NAME,SIZE,TYPE,MOUNTPOINTS
df -hT
df -i

lscpu reported one logical CPU. free -h provided a readable memory summary, while free -b supplied byte counts for a precise record. Here is the complete free -h response from that snapshot:

               total        used        free      shared  buff/cache   available
Mem:           1.9Gi       259Mi       1.4Gi       3.7Mi       426Mi       1.6Gi
Swap:             0B          0B          0B

In the free -b response, total RAM usable by the system was 2 031 960 064 bytes, and the available field was 1 759 944 704 bytes. The free documentation defines available as an estimate of memory available to new applications without swapping. This is an initial observation; it does not yet establish the peak needs of future services.

swapon --show --bytes exited with code 0 and printed no lines. Together with the zero Swap row in free, this showed that E-01 had no active swap areas at that moment.

lsblk -b -o NAME,SIZE,TYPE,MOUNTPOINTS reported 21 474 836 480 bytes for the whole /dev/sda device — exactly 20 GiB. df -hT described the mounted filesystems: the root filesystem on /dev/sda1 was ext4, with a displayed size of 20G, 945M used, 18G available, and 5% usage. df -i separately reported 3% inode usage for root.

I kept the plan’s 2 GB RAM and 20 GB SSD as order specifications, alongside the guest OS measurements. Bytes, GiB, whole-disk size, and available filesystem space answer different questions; the next comparison needs the same units and objects.

Zero failed units alongside boot warnings

I next checked which systemd units were in the failed state:

systemctl --failed --no-pager
  UNIT LOAD ACTIVE SUB DESCRIPTION

0 loaded units listed.

The command exited with code 0; the failed-unit list was empty. At the same time, the saved boot-log excerpt contained GPT messages. Here are two selected messages, with date and time prefixes omitted:

localhost kernel: GPT:Primary header thinks Alt. header is not at the end of the disk.
localhost kernel: GPT:Alternate GPT header not at the end of the disk.

These messages concern the partition table during boot. I then ran a separate check of its current state:

/usr/sbin/sfdisk --verify /dev/sda
/dev/sda:
No errors detected.
Header version: 1.0
Using 3 out of 128 partitions.
A total of 0 free sectors is available in 0 segments (the largest is 0 B).

The check returned code 0 and No errors detected. The sfdisk documentation describes --verify as a check of the partition table and partitions. This is a limited finding from the current check, rather than a complete storage diagnosis.

I kept both observations: the warnings at boot and the later successful result. I did not establish the reason for the difference or run partition-repair commands. This record therefore contains no claim that I repaired GPT. Zero failed units does not cancel the log messages either.

What host inspect already checks

After the manual run, I ran the existing CLI command. In the record below, the private profile path has been replaced with <private-profile>:

bin/deploy-cli host inspect --profile mirohost-e01 --env-file <private-profile>

The command exited with code 0. Below is an abbreviated result structure containing selected fields, rather than the complete stdout:

{
  "status": "passed",
  "write_performed": false,
  "events": {
    "hostname": "article-solution200-demo",
    "os_release": "Debian GNU/Linux 13 (trixie)",
    "kernel": "6.12.111+deb13-amd64",
    "failed_units": "0",
    "memory_available_mb": "1673"
  }
}

The OS, hostname, kernel, and failed-unit count matched the manual run. The value memory_available_mb=1673 was collected later; the current implementation reads it through free -m, meaning MiB despite the field-name suffix. Comparing it with the manual measurement requires accounting for both time and units.

status=passed applies to the checked host inspect subset. Full automated baseline collection and server bootstrap are still ahead. The CLI did not write configuration during this run. SSH sessions do leave service records, however, and hostnamectl and timedatectl queries can activate D-Bus services; this inspection should not be described as having no runtime effects at all.

Before the next action, I now have a specific record of the machine, time, versions, resources, failed-unit state, and unresolved GPT warning history. After installing a service or changing access, I will return to the relevant checks and explain the differences from this initial state.

Keep evidence without creating a secret store

Raw logs, configuration, and package inventories can reveal internal structure. Restrict access and define retention. Token values, private keys, and a complete environment-variable dump do not belong in an ordinary technical report.

A configuration copy helps you return to previous settings, but it is not a backup of the whole product. Before a substantial change, separately establish which data it can affect and how that data can be recovered.

A good baseline is shorter than a complete dump and more precise than “everything worked”. It gives the next step a concrete comparison point: which properties must survive, and which differences need explaining.

  1. Observability Five basic Debian checks before installing services
  2. Data & Infrastructure How to share VPS resources between several products
  3. Operations & Security Updating Debian: verification starts before installation
  4. Observability What the network can see: inventory before firewall rules
  5. Architecture From manual commands to a CLI: planning, approving and verifying server changes

A project by the author · Weather Solution200

After reading, a look outside.

Temperature, rain and wind in your city. Check the forecast and plan the hours ahead.

Check the forecast
Next article