🛡️ Snapper & Btrfs unter Void Linux

🛡️ Snapper & Btrfs on Void Linux

Dein Zeitreise-Button fürs System

Was ist Snapper?

What is Snapper?

Snapper arbeitet bei dir zusammen mit Btrfs-Subvolumes. Heißt: Wenn Updates, Experimente oder „ich probier mal schnell was“ schiefgehen → Rollback, fertig.

Snapper works together with Btrfs subvolumes. That means: if updates, experiments, or “let me quickly try something” go wrong → rollback, done.

🚀 Die wichtigsten Snapper-Befehle

🚀 The most important Snapper commands

Alles läuft über das Terminal (meist mit sudo):

Everything happens in the terminal (usually with sudo):

Befehl Command Was er macht What it does
snapper list Zeigt alle Snapshots inkl. Nummern Shows all snapshots including their numbers
snapper create -d "Vor dem Update" Erstellt manuell einen Snapshot Creates a snapshot manually
snapper delete <Nr> Löscht einen Snapshot Deletes a snapshot
snapper status <Nr1>..<Nr2> Zeigt Dateiänderungen zwischen zwei Snapshots Shows file changes between two snapshots
👉 Pro-Tipp: 👉 Pro tip: Vor großen Updates immer kurz: Before big updates, quickly run:
sudo snapper create -d "Vor xbps-install -Su"

🔄 System zurücksetzen (Rollback)

🔄 Reset your system (Rollback)

Wenn dein System zickt oder gar nicht mehr booten will:

If your system acts up or won’t boot anymore:

1️⃣ Snapshot booten

1️⃣ Boot a snapshot

  • Rechner neu starten
  • Im GRUB-Menü → „Void Linux Snapshots"
  • Einen passenden Zeitpunkt auswählen
  • Reboot your machine
  • In the GRUB menu → “Void Linux Snapshots”
  • Select a suitable point in time

➡️ Das System startet read-only (nur zum Prüfen).

➡️ The system boots read-only (for checking only).

2️⃣ Checken

2️⃣ Check

  • Einloggen
  • Testen, ob alles wieder okay ist
  • Log in
  • Test whether everything is okay again
⚠️ Keine Dateien speichern möglich ⚠️ You can’t save files – das ist Absicht! — that’s intentional!

3️⃣ Rollback ausführen

3️⃣ Perform the rollback

Wenn der Snapshot passt:

If the snapshot looks good:

sudo snapper rollback

Snapper:

Snapper will:

  • erstellt ein neues beschreibbares Subvolume
  • setzt es automatisch als neuen Standard
  • create a new writable subvolume
  • set it automatically as the new default

4️⃣ Neustart

4️⃣ Reboot

sudo reboot

🎉 Fertig! Du bist wieder in einem ganz normalen System – nur eben auf dem alten, funktionierenden Stand.

🎉 Done! You’re back in a normal system — just at the older, working state.

⏱️ Snapshot-Häufigkeit anpassen

⏱️ Adjust snapshot frequency

Standard: 1 Snapshot pro Stunde

Default: 1 snapshot per hour

Wenn dir das zu viel / zu wenig ist:

If that’s too much / too little for you:

Config öffnen

Open config

sudo nano /etc/snapper/configs/root

Wichtige Optionen

Important options

Automatische Snapshots

Automatic snapshots

TIMELINE_CREATE="yes"   # auf "no" setzen = aus
TIMELINE_CREATE="yes"   # set to "no" = disable

Wie viele behalten werden

How many are kept

TIMELINE_LIMIT_HOURLY="10"
TIMELINE_LIMIT_DAILY="10"
TIMELINE_LIMIT_MONTHLY="10"
📌 Änderungen sind sofort aktiv
📌 Changes take effect immediately
Speichern mit Strg+O, raus mit Strg+X Save with Ctrl+O, exit with Ctrl+X

📂 Einzelne Dateien wiederherstellen

📂 Restore individual files

Du brauchst kein komplettes Rollback, wenn nur eine Datei weg ist.

You don’t need a full rollback if only one file is missing.

1️⃣ Snapshot finden

1️⃣ Find a snapshot

snapper list

2️⃣ Datei zurückkopieren

2️⃣ Copy the file back

Snapshots liegen hier:

Snapshots are located here:

/.snapshots/<Nummer>/snapshot/
/.snapshots/<number>/snapshot/

Beispiel:

Example:

cp /.snapshots/10/snapshot/home/void/meine_datei.txt /home/void/
cp /.snapshots/10/snapshot/home/void/my_file.txt /home/void/
💡 Funktioniert auch für ganze Ordner. 💡 Works for entire folders too.

💾 Speicherplatz – wichtig zu wissen

💾 Disk space — good to know

👉 Überblick behalten mit: 👉 Keep an overview with:
snapper list

🧠 Kurz gesagt

🧠 In short