我正在尝试帮助某人在运行 Fedora 20(lvm2-2.0.2.106、linux 3.19.8-100)的旧服务器上恢复 RAID1 镜像 LVM 逻辑卷。镜像中的其中一个磁盘已损坏。 LV 为 systemvg/home。
我们尝试从 RAID1 转换为线性:
lvconvert -m0 systemvg/home
PV qtva6m-iBhc-q3Zt-At1U-FiWH-iZd8-tjpR0u not recognised. Is the device missing?
Cannot change VG systemvg while PVs are missing.
Consider vgreduce --removemissing.
所以我们尝试了:
vgreduce --removemissing systemvg
PV qtva6m-iBhc-q3Zt-At1U-FiWH-iZd8-tjpR0u not recognised. Is the device missing?
PV qtva6m-iBhc-q3Zt-At1U-FiWH-iZd8-tjpR0u not recognised. Is the device missing?
WARNING: Partial LV home needs to be repaired or removed.
WARNING: Partial LV home_rmeta_1 needs to be repaired or removed.
WARNING: Partial LV home_rimage_1 needs to be repaired or removed.
There are still partial LVs in VG systemvg.
To remove them unconditionally use: vgreduce --removemissing --force.
Proceeding to remove empty missing PVs.
这似乎意味着 LV 需要先修理。所以我们尝试了:
lvconvert --repair systemvg/home
PV qtva6m-iBhc-q3Zt-At1U-FiWH-iZd8-tjpR0u not recognised. Is the device missing?
Attempt to replace failed RAID images (requires full device resync)? [y/n]: y
device-mapper: create ioctl on systemvg-home_rmeta_2 failed: Device or resource busy
Failed to suspend systemvg/home before committing changes
Failed to replace faulty devices in systemvg/home.
Device '/dev/sdc' has been left open (1 remaining references).
Device '/dev/sda1' has been left open (1 remaining references).
Internal error: 2 device(s) were left open and have been closed.
我们会尝试vgreduce --removemissing --force
,但与之相关的消息似乎暗示 LV 将“无条件删除”,而这听起来不像我们想要的。
我们怎样才能打破镜像并从健康的磁盘中恢复数据呢?