Docs / Backup & Recovery / Creating and Restoring Server Snapshots

Creating and Restoring Server Snapshots

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 114 views · 2 min read

What Are Snapshots?

A snapshot captures the complete state of your server at a specific point in time — the filesystem, configuration, and all data. Unlike backups, snapshots are typically faster to create and stored alongside the server.

When to Use Snapshots

  • Before major system updates
  • Before installing new software
  • Before making significant configuration changes
  • Before deploying new application versions

LVM Snapshots (Manual)

# Check your logical volumes
lvs

# Create a snapshot (10 GB for changes)
lvcreate --size 10G --snapshot --name snap_root /dev/vg0/root

# Mount the snapshot (read-only)
mkdir /mnt/snapshot
mount -o ro /dev/vg0/snap_root /mnt/snapshot

# Restore from snapshot (WARNING: destructive)
umount /mnt/snapshot
lvconvert --merge /dev/vg0/snap_root
# Reboot required for root volume

Filesystem Snapshots with Btrfs

# Create a snapshot
btrfs subvolume snapshot /home /home/.snapshots/2026-02-25

# Create a read-only snapshot
btrfs subvolume snapshot -r /home /home/.snapshots/2026-02-25-readonly

# List snapshots
btrfs subvolume list /home

# Restore from snapshot
btrfs subvolume delete /home
btrfs subvolume snapshot /home/.snapshots/2026-02-25 /home

Best Practices

  • Snapshots are not a replacement for off-server backups
  • Delete old snapshots promptly — they consume disk space
  • Stop or quiesce databases before snapshotting for consistency
  • Label snapshots with date and reason (e.g., "pre-upgrade-php82")
  • Test restoring from snapshots periodically

Snapshot vs Backup

FeatureSnapshotBackup
SpeedInstant to secondsMinutes to hours
StorageSame server/diskSeparate location
Disaster recoveryNo (same hardware)Yes (offsite)
GranularityFull system stateFiles/databases

Was this article helpful?