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

@@ -65,8 +65,8 @@ sudo ./enhanced_simple_backup.sh vg-to-borg internal-vg /path/to/borg/repo --pas
```
**Key Difference:**
- **LV → Borg**: Stores the raw snapshot as `{lv_name}.img` in Borg
- **VG → Borg**: Stores all LVs as separate `.img` files (`root.img`, `home.img`, etc.)
- **LV → Borg**: Stores one snapshot as `{lv_name}.img` in a single archive
- **VG → Borg**: Creates separate archives for each LV (space-efficient, processes one LV at a time)
## Files