Traditional server backups often cause performance degradation, file corruption, or downtime, especially when backing up live databases and active applications.
This guide demonstrates how to build a zero-downtime backup system using LVM snapshots combined with rsync, allowing you to back up live production servers safely without stopping services.
This method is widely used in enterprises but rarely documented clearly online.
No service interruption
Consistent filesystem state
Safe database backups
Works on physical & virtual servers
No proprietary software required

Any Linux distribution (Ubuntu, Debian, RHEL, AlmaLinux, Rocky, SUSE)
LVM-based storage
Root or sudo access
Check LVM availability:
lsblk
vgs
lvs
Identify volume group and logical volumes:
lsblk -f
Example output:
/dev/mapper/vg0-root
/dev/mapper/vg0-home
Check free space in volume group:
vgs
You must have free VG space for snapshots.
Create snapshot of root filesystem:
lvcreate \
--size 5G \
--snapshot \
--name root_snap \
/dev/vg0/root
--size 5G → Snapshot size (adjust based on write activity)
--snapshot → Create snapshot mode
root_snap → Snapshot name
Create mount point:
mkdir -p /mnt/root_snap
Mount snapshot:
mount -o ro /dev/vg0/root_snap /mnt/root_snap
Verify:
df -h | grep root_snap
Create backup directory:
mkdir -p /backup/server01
Run rsync:
rsync -aAXHv \
--numeric-ids \
--delete \
/mnt/root_snap/ \
/backup/server01/
-a → Archive mode
-A → Preserve ACLs
-X → Preserve extended attributes
-H → Preserve hard links
--numeric-ids → UID/GID consistency
--delete → Sync exact state
For MySQL/MariaDB:
mysqldump --single-transaction \
--routines --events \
--all-databases > /backup/db.sql
This ensures transaction-consistent backups without locking tables.
After backup completes:
umount /mnt/root_snap
Remove snapshot:
lvremove -y /dev/vg0/root_snap
⚠️ Never leave snapshots active for long periods.
Create backup script:
nano /usr/local/bin/lvm_backup.sh
Script:
#!/bin/bash
SNAP_NAME=root_snap
VG=vg0
LV=root
SNAP_SIZE=5G
MOUNT=/mnt/root_snap
BACKUP=/backup/server01
lvcreate -L $SNAP_SIZE -s -n $SNAP_NAME /dev/$VG/$LV
mount -o ro /dev/$VG/$SNAP_NAME $MOUNT
rsync -aAXHv --delete $MOUNT/ $BACKUP/
umount $MOUNT
lvremove -y /dev/$VG/$SNAP_NAME
Make executable:
chmod +x /usr/local/bin/lvm_backup.sh
crontab -e
Add:
0 2 * * * /usr/local/bin/lvm_backup.sh >> /var/log/lvm_backup.log 2>&1
Runs daily at 2 AM.
Boot from rescue/live OS.
Mount target disk:
mount /dev/vg0/root /mnt/restore
Restore data:
rsync -aAXHv /backup/server01/ /mnt/restore/
Reinstall bootloader if required.
Monitor snapshot usage (lvs)
Size snapshots generously
Store backups on separate disk/server
Test restore procedures regularly
Combine with off-site replication
Snapshot too small → backup failure
Leaving snapshots active → disk fills up
Backing up live FS without snapshot → corruption
Using LVM snapshots with rsync, you can create zero-downtime, production-grade backups without expensive software or service disruption.
This approach is battle-tested in enterprise environments but rarely explained in a complete, practical guide.