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