fix: Solve space issues in VG→Borg backups

Problem: VG→Borg was creating temp files for all LVs simultaneously,
causing 'no space left' errors when LVs are large.

Solution: Process LVs sequentially instead of simultaneously:
1. Create snapshot for one LV
2. Stream it directly to Borg (no temp files)
3. Remove snapshot immediately
4. Move to next LV

Changes:
- VG→Borg now creates separate archives per LV instead of one big archive
- Each LV gets its own archive: vg_internal-vg_lv_root_20241009_123456
- No temporary files needed - direct streaming
- Space-efficient: only one snapshot exists at a time
- More robust: failure of one LV doesn't affect others

Benefits:
- No more space issues regardless of LV sizes
- Faster cleanup between LVs
- Individual LV recovery possible
- Better error isolation
- Still preserves block-level backup benefits
This commit is contained in:
root
2025-10-09 00:51:15 +02:00
parent aee3d5019c
commit c86fee78cb
4 changed files with 64 additions and 73 deletions

View File

@@ -80,7 +80,7 @@ echo " → Stores raw snapshot as 'root.img' in Borg repo"
echo ""
echo "5. Entire VG to Borg Repository (all LVs as block devices):"
echo " sudo ./enhanced_simple_backup.sh vg-to-borg internal-vg /path/to/borg/repo --encryption repokey"
echo " → Stores each LV as separate .img files (root.img, home.img, etc.)"
echo " → Creates separate archives for each LV (space-efficient, one LV at a time)"
echo ""
echo "=== GUI VERSION ==="
echo " sudo python3 simple_backup_gui.py"
@@ -91,7 +91,8 @@ echo "- lv-to-lv: Updates existing backup LV"
echo "- lv-to-raw: Creates fresh backup, overwrites target device"
echo "- vg-to-raw: Clones entire VG including LVM metadata"
echo "- lv-to-borg/vg-to-borg: Creates block-level backups in Borg (preserves exact LV state)"
echo "- LV→Borg stores snapshot as single .img file, VG→Borg stores each LV as separate .img"
echo "- LV→Borg: Single archive with one .img file, VG→Borg: Separate archives per LV"
echo "- VG→Borg processes one LV at a time to avoid space issues"
echo "- Borg backups are deduplicated, compressed, and encrypted"
echo "- Borg backups require: sudo apt install borgbackup"
echo "- Make sure target devices are unmounted before backup"