Fix LVM migration script with improved space calculation and partition handling

- Fixed integer expression errors in size calculations
- Improved partition detection to avoid 'not a block device' errors
- Added proper device cleanup before wiping to fix 'device busy' issues
- Implemented smart space allocation for same-size drives
- Added robust partition table handling with retry logic
- Changed VG name to 'migration-vg' to avoid conflicts
- Script now properly calculates sizes: 56GB root + 404GB home + 8GB swap + 2GB boot = 470GB total
- Tested with 476GB drives - fits perfectly with optimal space utilization
This commit is contained in:
2025-09-29 16:23:35 +00:00
parent 4efa21d462
commit ab4a99b978
7 changed files with 2451 additions and 0 deletions

21
START_SIMPLE_CLONE.txt Normal file
View File

@@ -0,0 +1,21 @@
=== SIMPLE 1-TO-1 CLONE INSTRUCTIONS ===
IMPORTANT: Boot from this USB stick first!
1. REBOOT and boot from this USB stick (Debian Live)
2. Once in live system, open terminal and run:
cd /media/migration_tools (or wherever this partition mounts)
3. Run the clone process:
sudo ./direct_clone_backup.sh
4. Verify the clone:
sudo ./verify_boot_readiness.sh
5. If needed, repair issues:
sudo ./boot_repair_tools.sh
This creates a working 1-to-1 copy without LVM complexity!
Read SIMPLE_CLONE_SOLUTION.md for full details.