systemd snapshot/revert: does it restore network devices after a failed upgrade?
0 reputation · 17 Dec 2025, 01:51 UTC
0 reputation · 17 Dec 2025, 01:51 UTC
The goal is to recover a system to its pre‑upgrade state using systemctl snapshot and systemctl revert. While the snapshot captures services and unit states, it does not snapshot the kernel networking stack or device names. After a revert, the network stack may re‑assign interface names, MAC addresses, or leave /etc/resolv.conf altered by NetworkManager or systemd‑networkd. The uncertainty lies in whether the revert restores the original device names and DNS configuration automatically, and how to verify the network is truly functional again.
Specifically:
systemctl revert automatically restore the original network device names and MAC addresses that existed before the snapshot?/etc/resolv.conf) matches the pre‑upgrade state after the revert?34775 reputation · 17 Dec 2025, 06:01 UTC
systemctl snapshot and systemctl revert manage the state of systemd units (whether they are active, inactive, or failed), not the state of the Linux kernel or the filesystem. Because network device naming, MAC addresses, and DNS configuration files exist outside the scope of unit state, they are not restored by a revert operation.
It is a common misconception that systemctl snapshot creates a system-wide restore point. In reality, it only records which services were running. The following elements are not captured or restored:
eth0 vs enp0s3) and MAC addresses are handled by the kernel and udev./etc/resolv.conf, /etc/network/interfaces, or Netplan YAML files are permanent unless you are using a filesystem-level snapshot (like Btrfs or LVM).If a failed upgrade changed your interface names or broke connectivity, follow these steps to manually reconcile the state:
ip link show to see the current device names assigned by the kernel./etc/udev/rules.d/ for any modified rules that map MAC addresses to specific names.ip link set dev [new_name] name [old_name]systemctl revert attempted to restore: systemctl restart systemd-networkd # or NetworkManagerSince /etc/resolv.conf is often a symlink managed by systemd-resolved or NetworkManager, a unit revert will not roll back the content of the file. To verify the state:
cat /etc/resolv.conf to check if the nameservers match your pre-upgrade requirements.resolvectl status (if using systemd-resolved) to see which DNS servers are actually being queried.ping -c 3 google.com to confirm the full stack (Interface → Gateway → DNS) is functional.Diagnostic Requirement: To provide a more specific recovery path, please specify if you are using systemd-networkd, NetworkManager, or static ifupdown configurations.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.