背景
系统使用了 Multipath + LVM 给应用提供存储。现在存储方面需要做迁移,要把 LUNs 迁移到其他阵列上。存储层面会通过做 Mirror 的方式,在新的位置创造出数据一致的 LUNs.
这种情况下,Linux 操作系统层面需要做哪些操作来配合? 应用可以down,但是系统不允许重启。
步骤
因为不能重启,为了尽可能减少风险,需要首先从文件系统,LVM, multipath 层面进行清理原有磁盘,存储层面迁移后,再重新扫描新的磁盘、multipath、LVM.
1. Record the current information for future reference.
a. The WWID of the LUNs. (should be different after migration)
b. The UUID of the PVs. (should be unchanged after migration)
c. Backup the LVM related metadata.
2. Stop the application and umount all related filesystems.
make sure no related LV are mounted.
3. Deactivate the VG.
4. Export VG, so the VG is unregistered in the system.
5. Remove multipath devices (mpath*).
a. Check the existing mpath device by multipath -l command. We might see devices like
b. Flush the device. For example,
6. Remove underlaying paths (sd*).
Make sure all the related paths (sd*) are deleted, so we won't be confused by the upcoming new paths.
7. Disconnect the LUNs. (in storage side or hardware side)
8. Perform the migration in storage side.
9. Connect the new LUNs. (in storage side or hardware side)
10. Rescan the new disks.
11. Rescan the multipath device.
See if you can see the new LUNs as before.
The number of LUNs should be the same (eg. 20), but the WWID should be different.
12. Rescan VG and import VG.
# vgimport datavg
13. Activate VG.
You should see the PV by
14. Mount the filesystem back.