Introduction Block-level storage migration that does not ensure I/O quiescence can result in filesystem corruption and data loss. This is especially problematic for databases and active file systems.

Symptoms - Filesystem check errors after migration - Database refusing to start after storage migration - File corruption detected on migrated storage - Inconsistent file sizes or timestamps - Application reporting data integrity errors

Common Causes - File system active during block-level copy - Database writes continuing during snapshot - LVM snapshot not consistent - Block-level copy tool bug - Target storage block size mismatch

Step-by-Step Fix 1. **Run filesystem check on migrated storage': ```bash # ext4 e2fsck -n /dev/mapper/migrated-vol # XFS xfs_repair -n /dev/mapper/migrated-vol ```

  1. 1.**For databases, run integrity checks':
  2. 2.```bash
  3. 3.# PostgreSQL
  4. 4.pg_checksums --check -D /var/lib/postgresql/data
  5. 5.# MySQL
  6. 6.mysqlcheck --all-databases --check
  7. 7.`
  8. 8.**Use snapshot-based migration for consistency':
  9. 9.```bash
  10. 10.# LVM snapshot
  11. 11.lvcreate --size 10G --snapshot --name snap /dev/vg/lv
  12. 12.# Copy from snapshot (consistent point-in-time)
  13. 13.dd if=/dev/vg/snap of=/dev/new-storage bs=4M status=progress
  14. 14.`

Prevention - Quiesce I/O before block-level copy - Use application-consistent snapshots - Verify data integrity before switching to new storage - Test migration process in staging - Maintain backup of source storage until verified