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 volumeFilesystem 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 /homeBest 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
| Feature | Snapshot | Backup |
|---|---|---|
| Speed | Instant to seconds | Minutes to hours |
| Storage | Same server/disk | Separate location |
| Disaster recovery | No (same hardware) | Yes (offsite) |
| Granularity | Full system state | Files/databases |