LVM에서 드라이브를 제거하기 전에 서버에 디스크 오류가 발생하여 교체했습니다.
서버에는 4 개의 물리적 드라이브 (PV)가 있으며 각각 고유 한 볼륨 그룹 (VG)이 있습니다. 각 VG에는 2 개 이상의 논리 볼륨 (LV)이 있습니다. 이제 LVM은 누락 된 드라이브에 대해 불평하고 있습니다. 따라서 시스템에서 제거해야하는 것보다 고아가 된 두 개의 LV가있는 VG (vg04)가 있습니다.
문제는 LVM 명령을 실행할 때마다 다음과 같은 ‘읽기 실패’오류가 발생한다는 것입니다.
# lvscan
/dev/vg04/swap: read failed after 0 of 4096 at 4294901760: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4294959104: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4096: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903864832: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903922176: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 4096: Input/output error
# vgreduce vg04 --removemissing --force
/dev/vg04/swap: read failed after 0 of 4096 at 4294901760: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4294959104: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4096: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903864832: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903922176: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 4096: Input/output error
Volume group "vg04" not found
# vgchange -a n /dev/vg04
/dev/vg04/swap: read failed after 0 of 4096 at 4294901760: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4294959104: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4096: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903864832: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903922176: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 4096: Input/output error
Volume group "vg04" not found
# lvchange -a n /dev/vg04/vz
/dev/vg04/swap: read failed after 0 of 4096 at 4294901760: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4294959104: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/swap: read failed after 0 of 4096 at 4096: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903864832: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 995903922176: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 0: Input/output error
/dev/vg04/vz: read failed after 0 of 4096 at 4096: Input/output error
Volume group "vg04" not found
Skipping volume group vg04
누락 된 VG 및 LV는 중요하지 않으므로 제거하기 만하면됩니다.
보시다시피, 우리는 지금까지의 모든 제안을 운없이 시도했습니다.
‘lvm dumpconfig’의 출력은 http://pastebin.com/MHiBzrLJ 에서 확인할 수 있습니다 .
답변
해결책은 dmsetup을 실행하는 것이 었습니다.이 경우에는 두 명령
dmsetup remove vg04-vz
dmsetup remove vg04-swap
이 작업을 수행하기 전에 ‘dmsetup info’명령을 사용하여 두 LV의 ‘open count’가 모두 0인지 확인했습니다.
경고 : dmsetup은 디스크에 심각한 혼란을 초래할 수 있으므로 나중에이 정보를 사용하는 사람은 매뉴얼 페이지를 읽으십시오.
답변
VMware 디스크를 제거한 후 비슷한 경험을했습니다 /dev/sdb
.
사용 lsscsi
중인 장치를 판별하고 (프로그램을 설치해야 할 수도 있음) 판별 한 후 다음을 실행하십시오 lsscsi
.
# lsscsi
[1:0:0:0] cd/dvd NECVMWar VMware IDE CDR10 1.00 /dev/sr0
[2:0:0:0] disk VMware Virtual disk 1.0 /dev/sda
[2:0:1:0] disk VMware Virtual disk 1.0 /dev/sdb <== the removed physical disk
[2:0:2:0] disk VMware Virtual disk 1.0 /dev/sdc
이제 삭제 파일을 작성하십시오.
# echo 1 > /sys/class/scsi_device/2\:0\:1\:0/device/delete
장치가 즉시 사라졌습니다.
답변
vgchange -an / dev / vg04
논리 볼륨이 여전히 활성화되어 있으면
lvchange -a n /dev/vg04/swap
lvchange -a n dev/vg04/vz
기타