What is LVM?
●LVM (Logical Volume Manager) is a
storage management technology in Linux.
● Key Features:
○ Create flexible disk layouts
○ Resize partitions without reboot
○ Use multiple disks as one storage unit
4.
Disaster Recovery inLVM
● A process of restoring lost or corrupted LVM-based data
● Example Scenarios:
○ Accidental deletion of logical volumes
○ Filesystem corruption
○ Disk failure
● Goal: Bring the system back to a working state quickly
5.
Why Do WeNeed LVM Recovery?
● Real-world Needs:
○ Business continuity
○ Minimize downtime
○ Avoid data loss
● Common Situations:
○ Admin error (e.g., lvremove)
○ Power outage or crash
○ Logical volume corruption
6.
How Can WeRecover LVM Data?
Two Main Recovery Approaches:
1. Logical Volume Recreation +
Backup Restoration
2. Snapshot-Based Recovery (if
snapshot was created
beforehand)
7.
Role of Backupsin Recovery
● Backups = Insurance for your data
● Without backup: Recovery becomes difficult or impossible.
● Backups help:
○ Restore deleted data
○ Rebuild from known-good state
○ Recover from corruption
8.
LVM Snapshot
● Asnapshot is a read-only or read-write copy of a logical volume at a point in
time.
● Think of it as a photo of your volume’s data — great for backup or testing.
● Useful for:
○ Quick backup
○ Safe updates
○ Testing without affecting original data
9.
Benefits of LVMBackups
● Peace of mind during system updates or changes
● Faster disaster recovery
● Preserve file permissions and structure
● Minimal data loss
● Support for automation (cron, scripts)
10.
Methods to BackupLVM Data
1. Full File Backup (Recommended):
● tar czvf backup.tar.gz /mountpoint
● Archives entire LV contents
2. Snapshot + Copy:
● Create snapshot: lvcreate -s
● Mount snapshot and back up data
11.
Best Practices forLVM Backups
● Automate regular backups
● Store backups on external or remote systems
● Test restore process periodically
● Document recovery steps clearly
12.
Use Case Example
●Scenario: Developer deletes the wrong LV by mistake.
● Without Backup: Lost critical files, long recovery time.
● With Backup:
○ Recreate LV structure
○ Restore with tar
○ Back online in minutes