[AIX 운영 체제와 장치 관리 34] LVM 문제 해결 — 디스크 드라이브 진단과 공간 확보, 고장 디스크 교체·재포맷 복구, LVCB 경고, PP 한도 1016, ODM 동기화, vary-on 실패 무시, VGDA 경고
https://archive.horanglab.com/posts/aix-osdev-34
핵심 정리
- 디스크가 의심되면
smit diag→ Current Shell Diagnostics → Diagnostics Routines → System Verification으로 진단합니다. 고장 나는 디스크는 이전(migratepv)으로 데이터를 옮기는 것이 가장 좋습니다. - 재포맷이나 교체 전에는 단일 사본 파일 시스템 백업·마운트 해제·rmfs, 미러 사본 rmlvcopy, hd7 덤프 장치 sysdumpnull, 페이징 공간 rmps, 나머지 LV rmlv,
reducevg -df로 디스크를 뺍니다. reducevg가 안 됐으면 교체 뒤varyonvg -f로 PVREMOVED를 만들고 PVID로 reducevg합니다. - LVCB(논리 볼륨 첫 블록)를 데이터베이스가 덮어쓰면 경고가 나지만 원시 LV에는 치명적이지 않습니다. 다만 importvg 때 JFS 정보와 마운트 지점을 잃을 수 있습니다.
- 디스크당 PP 추적 한도는 1016입니다. mkvg
-s로 PP 크기를 키우거나-t/chvg -t로 1016의 배수를 허용합니다. ODM이 LVM과 어긋나면synclvodm -v VGName을 씁니다. - 쿼럼 없이 강제 vary-on하면 빠진 PV는 removed가 되고 데이터 무결성을 보장하지 않으므로 최후 수단입니다. 수리할 디스크는
chpv -vr로 쿼럼 계산에서 빼고chpv -va로 되돌립니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 6.1 (5.3판과 거의 같음, 교체 절차 단계 정리) |
| 원문 | Operating system and device management — 5.3판 6071쪽 일부, 6.1판 362373쪽 |
| 관련 명령어 | smit diag, skulker, lspv -M, rmlvcopy, sysdumpdev, rmps, reducevg -df, varyonvg -f, extendvg, mklvcopy, syncvg, synclvodm, chpv -vr, chvg -t, mkvg -s |
| 관련 파일 | /etc/filesystems, /var/spool/cron/crontabs/adm, image.data |
LVM에서 흔히 생기는 여러 문제를 해결할 수 있습니다.
디스크 드라이브 문제 해결
다음은 디스크 드라이브 문제를 진단하고 고치는 방법입니다.
디스크 드라이브가 기계적으로 고장 나고 있거나 고장 났다고 의심되면 다음 절차로 디스크 진단을 실행합니다.
- root 권한으로 명령행에서 다음 SMIT 빠른 경로를 입력합니다.
smit diag
- Current Shell Diagnostics를 골라 AIX 진단 도구에 들어갑니다.
- Diagnostics Operating Instructions 화면을 읽은 뒤 Enter를 누릅니다.
- Diagnostics Routines를 고릅니다.
- System Verification을 고릅니다.
- 목록을 내려 시험할 드라이브를 찾아 고릅니다.
- Commit을 고릅니다.
진단 결과로 디스크 상태를 판단할 수 있습니다.
- 디스크 드라이브가 고장 나고 있거나 고장 났다면 가장 중요한 것은 그 디스크의 데이터를 되찾는 것입니다. 고장 나는 디스크의 데이터를 되찾는 데는 이전(migration)이 가장 좋습니다. 이전을 성공적으로 끝낼 수 없을 때 논리 볼륨의 데이터를 복구하거나 복원하는 방법은 다음 절차에 있습니다.
- 드라이브가 고장 나고 있지만 재포맷 없이 고칠 수 있으면 데이터를 잃지 않습니다.
- 디스크 드라이브를 재포맷하거나 바꿔야 하면 가능한 한 백업하고, 바꾸기 전에 볼륨 그룹과 시스템 구성에서 디스크 드라이브를 뺍니다. 단일 사본 파일 시스템의 일부 데이터는 잃을 수 있습니다.
관련 개념
- 디스크 드라이브 공간, 재포맷 없이 디스크 드라이브 복구
관련 작업
- 물리 볼륨 내용 옮기기, 재포맷하거나 교체한 디스크로 복구, 시스템을 켠 채 디스크 고장 복구
디스크 드라이브 공간
디스크 드라이브 공간이 바닥나면 여러 방법으로 해결할 수 있습니다. 원치 않는 파일을 자동으로 찾아 지우거나, 사용자를 특정 디렉터리에서 제한하거나, 다른 디스크 드라이브의 공간을 마운트할 수 있습니다.
이 작업을 하려면 root 사용자, system 그룹, 관리 그룹 권한이 있어야 합니다.
파일 시스템을 자동으로 정리하는 명령
skulker 명령으로 원치 않는 파일을 지워 파일 시스템을 정리합니다.
명령행에서 다음을 입력합니다.
skulker -p
skulker 명령은 파일 시스템에서 낡거나 필요 없는 파일을 주기적으로 지우는 데 씁니다. 대상에는 /tmp 디렉터리의 파일, 지정한 기간보다 오래된 파일, a.out 파일, core 파일, ed.hup 파일이 있습니다.
skulker 명령은 보통 한가한 시간에 cron 명령이 실행하는 계정 절차의 일부로 매일 실행합니다.
관련 개념
- 디스크 넘침 — 디스크 넘침은 너무 많은 파일이 할당된 공간을 채울 때 생깁니다. 불필요한 파일을 많이 만드는 폭주 프로세스가 원인일 수 있습니다.
관련 작업
- 계정 시스템 설정
특정 디렉터리에서 사용자 제한하기
디렉터리 접근을 제한하고 디스크 사용을 감시해 디스크 공간을 확보하고 비어 있게 유지할 수 있습니다.
- 다음을 입력해 사용자를 특정 디렉터리에서 제한합니다.
chmod 755 DirName
이 명령은 소유자(root)에게 읽기·쓰기 권한(원문 그대로)을, 그룹과 기타에게 읽기 전용 권한을 설정합니다. DirName은 제한할 디렉터리의 전체 경로 이름입니다.
2. /var/spool/cron/crontabs/adm 파일에 다음 줄을 더해 개별 사용자의 디스크 사용을 감시합니다.
0 2 * * 4 /usr/sbin/acct/dodisk
이 줄은 매주 목요일(4) 오전 2시(0 2)에 dodisk 명령을 실행합니다. dodisk 명령은 디스크 사용 계정을 시작합니다. 이 명령은 보통 한가한 시간에 cron 명령이 실행하는 계정 절차의 일부로 실행합니다.
관련 작업
- 계정 시스템 설정
다른 디스크 드라이브의 공간 마운트하기
다른 드라이브의 공간을 마운트해 디스크 드라이브 공간을 늘릴 수 있습니다.
다음 방법으로 한 디스크 드라이브의 공간을 다른 곳에 마운트할 수 있습니다.
smit mountfs빠른 경로를 씁니다.- mount 명령을 씁니다. 예:
mount -n nodeA -vnfs /usr/spool /usr/myspool
mount 명령은 파일 시스템을 특정 위치에서 쓸 수 있게 합니다.
관련 참조
- 파일 시스템 유지 보수
재포맷 없이 디스크 드라이브 복구
고장 난 디스크를 고쳐 재포맷 없이 시스템에 다시 넣으면 부팅 때 시스템이 드라이브의 stale 물리 파티션을 자동으로 활성화하고 다시 동기화하게 할 수 있습니다. stale 물리 파티션에는 시스템이 쓸 수 없는 데이터가 들어 있습니다.
stale 물리 파티션이 의심되면 명령행에서 다음을 입력합니다.
lspv -M PhysVolName
PhysVolName은 물리 볼륨 이름입니다. lspv 명령 출력은 물리 볼륨의 모든 파티션을 나열합니다. 다음은 출력 예의 일부입니다.
hdisk16:112 lv01:4:2 stale
hdisk16:113 lv01:5:2 stale
hdisk16:114 lv01:6:2 stale
hdisk16:115 lv01:7:2 stale
hdisk16:116 lv01:8:2 stale
hdisk16:117 lv01:9:2 stale
hdisk16:118 lv01:10:2 stale
첫 열은 물리 파티션, 둘째 열은 논리 파티션입니다. stale 물리 파티션은 셋째 열에 표시됩니다.
관련 작업
- 디스크 드라이브 문제 해결
재포맷하거나 교체한 디스크 드라이브로 복구
고장 난 디스크를 재포맷하거나 바꿔야 할 때 고장 난 디스크 드라이브의 데이터를 복구할 수 있습니다.
주의: 디스크 드라이브를 재포맷하거나 바꾸기 전에 고장 나는 디스크에서 미러링하지 않은 파일 시스템에 대한 참조를 모두 지우고, 볼륨 그룹과 시스템 구성에서 디스크를 뺍니다. 그러지 않으면 ODM과 시스템 구성 데이터베이스에 문제가 생깁니다. 이 필수 단계는 다음 절차의 "고장 난 디스크를 바꾸거나 재포맷하기 전"에 있습니다.
다음 절차는 myvg라는 볼륨 그룹에 디스크 드라이브 hdisk2, hdisk3, hdisk4가 있는 시나리오를 씁니다. 이 시나리오에서 hdisk3이 고장 납니다. hdisk2에는 미러링하지 않은 논리 볼륨 lv01과 mylv 논리 볼륨의 사본이 있습니다. mylv 논리 볼륨은 미러링돼 사본이 셋이며, 각 사본은 자기 디스크에서 물리 파티션 둘을 차지합니다. 고장 나는 hdisk3에는 mylv의 다른 사본과 미러링하지 않은 논리 볼륨 lv00이 있습니다. 마지막으로 hdisk4에는 mylv의 셋째 사본과 lv02라는 논리 볼륨이 있습니다. 원문의 그림이 이 시나리오를 보여 줍니다.
이 절차는 다음 핵심 부분으로 나뉩니다.
- 고장 나는 디스크를 바꾸거나 재포맷하기 전에 데이터를 지키려고 하는 일
- 디스크를 재포맷하거나 바꾸는 절차
- 디스크를 재포맷하거나 바꾼 뒤 데이터를 복구하려고 하는 일
고장 난 디스크를 바꾸거나 재포맷하기 전
- root 권한으로 로그인합니다.
- 고장 나는 드라이브의 논리 볼륨을 잘 모르면 정상 디스크로 고장 나는 디스크의 내용을 봅니다. 예를 들어 hdisk4로 hdisk3을 보려면 명령행에서 다음을 입력합니다.
lspv -M -n hdisk4 hdisk3
lspv 명령은 볼륨 그룹 안 물리 볼륨의 정보를 보여 줍니다. 출력은 다음과 비슷합니다.
hdisk3:1 mylv:1
hdisk3:2 mylv:2
hdisk3:3 lv00:1
hdisk3:4-50
첫 열은 물리 파티션, 둘째 열은 논리 파티션입니다. 4번부터 50번 파티션은 비어 있습니다.
3. 가능하면 고장 나는 장치의 모든 단일 사본 논리 볼륨을 백업합니다. 방법은 사용자 파일이나 파일 시스템 백업을 봅니다.
4. 단일 사본 파일 시스템이 있으면 디스크에서 마운트 해제합니다(lspv 명령 출력으로 단일 사본 파일 시스템을 알 수 있습니다. 단일 사본 파일 시스템은 출력에서 논리 파티션과 물리 파티션 수가 같습니다). 미러링한 파일 시스템은 마운트 해제하지 않아도 됩니다. 이 시나리오에서 고장 나는 디스크 hdisk3의 lv00이 단일 사본 파일 시스템입니다. 마운트 해제하려면 다음을 입력합니다.
unmount /dev/lv00
파일 시스템 이름을 모르면, /etc/filesystems 파일이 고장 난 디스크에만 있는 것이 아니라면 명령행에서 mount를 입력해 마운트된 모든 파일 시스템을 나열하고 논리 볼륨과 연결된 이름을 찾습니다. /etc/filesystems 파일에 grep 명령을 써서 논리 볼륨과 연결된 파일 시스템 이름만 나열할 수도 있습니다. 예:
grep lv00 /etc/filesystems
출력은 다음 예와 비슷합니다.
dev = /dev/lv00
log = /dev/loglv00
참고
- 마운트 해제하려는 파일 시스템을 쓰고 있으면 unmount 명령은 실패합니다. unmount 명령은 파일 시스템의 파일이 하나도 열려 있지 않고 어떤 사용자의 현재 디렉터리도 그 장치에 없을 때만 실행됩니다.
- unmount 명령의 다른 이름은 umount입니다. 두 이름은 바꿔 쓸 수 있습니다.
- rmfs 명령을 입력해 고장 난 물리 볼륨의 모든 단일 사본 파일 시스템을 지웁니다.
rmfs / FSname
고장 나는 디스크의 모든 미러 논리 볼륨(사본)을 지웁니다.
참고: rootvg 볼륨 그룹의 물리 볼륨에서
hd5와hd7논리 볼륨에는 rmlvcopy를 쓸 수 없습니다. 이 논리 볼륨은 사본이 하나뿐이므로 시스템이 지우지 못하게 합니다. rmlvcopy 명령은 각 논리 파티션에서 사본을 지웁니다. 예를 들어 다음을 입력합니다.
rmlvcopy mylv 2 hdisk3
hdisk3의 사본을 지우면 mylv 논리 볼륨에 속한 각 논리 파티션의 사본 수가 셋에서 둘(hdisk4에 하나, hdisk2에 하나)로 줄어듭니다.
7. 고장 나는 디스크가 루트 볼륨 그룹에 속하고 논리 볼륨 hd7이 있었으면, 명령행에서 다음을 입력해 1차 덤프 장치(hd7)를 지웁니다.
sysdumpdev -P -p /dev/sysdumpnull
sysdumpdev 명령은 실행 중인 시스템의 1차나 2차 덤프 장치 위치를 바꿉니다. 재부팅하면 덤프 장치는 원래 위치로 돌아갑니다.
참고: DVD 장치로 덤프하도록 고를 수 있습니다. DVD를 덤프 장치로 구성하는 방법은 sysdumpdev를 봅니다. 8. 다음 명령으로 디스크의 페이징 공간을 지웁니다.
rmps PSname
PSname은 지울 페이징 공간 이름이며, 실제로는 페이징 공간이 있는 논리 볼륨 이름입니다. rmps 명령이 실패하면 smit chps 빠른 경로로 1차 페이징 공간을 비활성화하고 재부팅한 뒤 이 절차를 계속해야 합니다. 활성 페이징 공간이 있으면 10단계의 reducevg 명령이 실패할 수 있습니다.
9. rmlv 명령으로 파일 시스템이 없는 논리 볼륨처럼 볼륨 그룹의 다른 논리 볼륨을 지웁니다. 예를 들어 다음을 입력합니다.
rmlv -f lv00
- reducevg 명령으로 고장 난 디스크를 볼륨 그룹에서 뺍니다. 예를 들어 다음을 입력합니다.
reducevg -df myvg hdisk3
reducevg 명령을 실행할 수 없거나 실패하면 드라이브를 재포맷하거나 바꾼 뒤 13단계 절차로 VGDA/ODM 정보를 정리할 수 있습니다.
고장 난 디스크를 바꾸거나 재포맷하기
- 다음 단계는 디스크를 재포맷할지 바꿀지, 어떤 하드웨어를 쓰는지에 따라 다릅니다.
- 디스크 드라이브를 재포맷하려면 다음 절차를 씁니다.
- root 권한으로 명령행에서 다음 SMIT 빠른 경로를 입력합니다.
- 디스크 드라이브를 재포맷하려면 다음 절차를 씁니다.
smit diag
Current Shell Diagnostics를 골라 AIX 진단 도구에 들어갑니다. c. Diagnostics Operating Instructions 화면을 읽은 뒤 Enter를 누릅니다. d. Task Selection을 고릅니다. e. 작업 목록을 내려 Format Media를 찾아 고릅니다. f. 재포맷할 디스크를 고릅니다. 재포맷을 확인하면 디스크의 모든 내용이 지워집니다.
디스크를 재포맷한 뒤 12단계로 갑니다.
- 시스템이 핫 스왑 디스크를 지원하면 "시스템을 켠 채 디스크 고장 복구" 절차를 쓴 뒤 13단계로 갑니다.
- 시스템이 핫 스왑 디스크를 지원하지 않으면 다음을 합니다.
smit rmvdsk빠른 경로로 이전 드라이브 전원을 끕니다. KEEP definition in database 필드를No로 바꿉니다. 다음 수준 시스템 지원에 연락해 디스크 드라이브를 바꿉니다.
고장 난 디스크를 바꾸거나 재포맷한 뒤
- "디스크 구성"과 "쓸 수 있는 디스크를 물리 볼륨으로 만들기"의 지침을 따릅니다.
- 디스크를 포맷하기 전에 이전 볼륨 그룹에서 reducevg 명령을 쓸 수 없었다면(10단계) 다음 절차로 VGDA/ODM 정보를 정리할 수 있습니다.
- 볼륨 그룹이 재포맷한 디스크 하나로만 이루어졌으면 다음을 입력합니다.
exportvg VGName
VGName은 볼륨 그룹 이름입니다. b. 볼륨 그룹에 디스크가 둘 이상이면 명령행에서 다음을 입력합니다.
varyonvg VGName
시스템은 빠졌거나 쓸 수 없는 디스크에 관한 메시지를 보여 주며 새(또는 재포맷한) 디스크가 나열됩니다. varyonvg 메시지에 나오는 새 디스크의 물리 볼륨 식별자(PVID)를 적어 둡니다. 빠진 디스크 이름과 PVNOTFND 레이블 사이의 16문자 문자열입니다. 예:
hdisk3 00083772caa7896e PVNOTFND
다음을 입력합니다.
varyonvg -f VGName
이제 빠진 디스크가 PVREMOVED 레이블로 나옵니다. 예:
hdisk3 00083772caa7896e PVREMOVED
그런 다음 다음 명령을 입력합니다.
reducevg -df VGName PVID
PVID는 물리 볼륨 식별자(이 시나리오에서는 00083772caa7896e)입니다. 14. extendvg 명령으로 새 디스크 드라이브를 볼륨 그룹에 더합니다. 예를 들어 다음을 입력합니다.
extendvg myvg hdisk3
- mklv 명령으로 새(또는 재포맷한) 디스크 드라이브에 단일 사본 논리 볼륨을 다시 만듭니다. 예를 들어 다음을 입력합니다.
mklv -y lv00 myvg 1 hdisk3
이 예는 hdisk3 드라이브에 lv00 논리 볼륨을 다시 만듭니다. 1은 이 논리 볼륨을 미러링하지 않는다는 뜻입니다.
16. crfs 명령으로 논리 볼륨에 파일 시스템을 다시 만듭니다. 예를 들어 다음을 입력합니다.
crfs -v jfs -d lv00 -m /dev/lv00
- 백업 매체에서 단일 사본 파일 시스템 데이터를 복원하려면 백업 이미지에서 사용자 파일 복원을 봅니다.
- mklvcopy 명령으로 논리 볼륨의 미러 사본을 다시 만듭니다. 예를 들어 다음을 입력합니다.
mklvcopy mylv 3 hdisk3
이 예는 hdisk3에 mylv 논리 볼륨의 셋째 미러 파티션을 만듭니다. 19. syncvg 명령으로 새 미러를 다른 미러(이 예에서는 hdisk2와 hdisk4)의 데이터와 동기화합니다. 예를 들어 다음을 입력합니다.
syncvg -p hdisk3
이로써 모든 미러 파일 시스템이 복원돼 최신 상태가 돼야 합니다. 단일 사본 파일 시스템을 백업할 수 있었다면 그것도 쓸 준비가 됐습니다. 이제 시스템을 평소처럼 쓸 수 있어야 합니다.
관련 작업
- 디스크 드라이브 문제 해결
고장 난 디스크 드라이브 복구 예
고장 난 디스크 드라이브에서 복구하려면 들어온 길을 되짚어 나갑니다. 곧 볼륨 그룹을 만든 단계를 나열하고 거꾸로 갑니다.
다음 예는 이 기법을 보여 줍니다. 미러 논리 볼륨을 어떻게 만들었고, 디스크가 고장 났을 때 한 단계씩 되짚어 어떻게 바꿨는지 보여 줍니다.
참고: 다음 예는 특정 사례를 보여 줄 뿐입니다. 일반 복구 절차의 원형으로 삼으려는 것이 아닙니다.
- 시스템 관리자 Jane이 다음을 입력해 hdisk1에 workvg라는 볼륨 그룹을 만들었습니다.
mkvg -y workvg hdisk1
- 그런 다음 다음을 입력해 이 볼륨 그룹에 디스크 둘을 더했습니다.
extendvg workvg hdisk2
extendvg workvg hdisk3
- Jane은 사본이 셋인 40MB 논리 볼륨을 만들었습니다. 각 사본은 workvg 볼륨 그룹을 이루는 세 디스크에 하나씩 있습니다. 다음 명령을 썼습니다.
mklv -y testlv workvg 10
mklvcopy testlv 3
Jane이 미러 workvg 볼륨 그룹을 만든 뒤 hdisk2가 고장 났습니다. 그래서 다음 단계로 복구했습니다.
- 다음을 입력해 hdisk2에서 논리 볼륨 사본을 지웠습니다.
rmlvcopy testlv 2 hdisk2
- ODM과 VGDA가 갱신되도록 다음을 입력해 hdisk2를 시스템에서 떼어 냈습니다.
reducevg workvg hdisk2
- 교체를 준비하려고 다음을 입력해 hdisk2를 시스템 구성에서 지웠습니다.
rmdev -l hdisk2 -d
- 다음을 입력해 시스템을 종료했습니다.
shutdown -F
- 디스크를 바꿨습니다. 새 디스크의 SCSI ID는 이전 hdisk2와 달랐습니다.
- 시스템을 재부팅했습니다. 새 디스크이므로(시스템은 이 디스크에 새 PVID가 있음을 봅니다) 시스템은 첫 빈 hdisk 이름을 고릅니다. 3단계에서
-d플래그를 썼으므로 hdisk2라는 이름이 풀려 시스템은 새 디스크 이름으로 hdisk2를 골랐습니다.-d플래그를 쓰지 않았다면 hdisk4가 새 이름이 됐을 것입니다. - Jane은 다음을 입력해 이 디스크를 workvg 볼륨 그룹에 더했습니다.
extendvg workvg hdisk2
- 다음을 입력해 논리 볼륨의 미러 사본을 만들었습니다(원문은 둘이라 적음).
mklvcopy testlv 3
논리 볼륨 관리자는 셋째 논리 볼륨 사본을 새 hdisk2에 자동으로 놓았습니다.
시스템을 켠 채 디스크 고장 복구
핫 제거 기능으로 디스크 고장에서 복구할 수 있습니다.
핫 제거 기능을 쓰는 복구 절차는 대부분 "재포맷 없이 디스크 드라이브 복구"(원문 그대로)와 같으며 다음이 다릅니다.
- 디스크의 파일 시스템을 마운트 해제하려면 "JFS나 JFS2 마운트" 절차를 씁니다.
- 볼륨 그룹과 운영 체제에서 디스크를 빼려면 "데이터가 없는 디스크 제거" 절차를 씁니다.
- 고장 난 디스크를 새것으로 바꿀 때 시스템을 종료할 필요가 없습니다. 다음 절차를 차례로 씁니다. a. 논리 볼륨 저장소 b. 디스크 구성 c. "재포맷하거나 교체한 디스크 드라이브로 복구"의 13단계부터 계속
관련 작업
- 디스크 드라이브 문제 해결
볼륨 그룹이 디스크 하나로 이루어졌을 때 디스크 바꾸기
볼륨 그룹의 일부로 고장 나고 있는 디스크에 접근할 수 있으면 다음 절차를 씁니다.
- 물리 볼륨 내용 옮기기
디스크가 고장 나 접근할 수 없으면 다음 단계를 따릅니다.
- 볼륨 그룹을 내보냅니다.
- 드라이브를 바꿉니다.
- 있는 백업 매체에서 데이터를 다시 만듭니다.
물리·논리 볼륨 오류
물리·논리 볼륨에서 흔히 생기는 여러 오류를 해결할 수 있습니다.
핫 스폿 문제
논리 볼륨에 접근할 때 성능이 떨어지면 디스크 I/O가 너무 많은 핫 스폿이 논리 볼륨에 있을 수 있습니다.
자세한 내용은 논리 볼륨의 핫 스폿 관리와 핫 스폿 보고 켜기와 구성을 봅니다.
LVCB 경고
LVCB에 잘못된 정보가 있으면 경고가 납니다.
논리 볼륨 제어 블록(LVCB)은 논리 볼륨의 첫 블록입니다. LVCB 크기는 볼륨 그룹 안 물리 볼륨의 블록 크기입니다. 이 영역에는 논리 볼륨 생성 날짜, 미러 사본 정보, JFS의 가능한 마운트 지점 같은 중요한 정보가 있습니다. LVM 알고리즘의 일부로 일부 LVM 명령은 LVCB를 갱신해야 합니다. 이전 LVCB를 읽어 유효한지 분석합니다. 정보가 유효한 LVCB 정보이면 LVCB를 갱신합니다. 유효하지 않으면 LVCB를 갱신하지 않으며 다음 메시지가 나올 수 있습니다.
Warning, cannot write lv control block data.
이 메시지는 대개 데이터베이스 프로그램이 JFS를 거치지 않고 원시 논리 볼륨을 저장 매체로 쓸 때 나옵니다. 이때 데이터베이스 정보가 말 그대로 LVCB를 덮어씁니다. 원시 논리 볼륨에는 치명적이지 않습니다. LVCB를 덮어쓴 뒤에도 사용자는 다음을 할 수 있습니다.
- 논리 볼륨 늘리기
- 논리 볼륨의 미러 사본 만들기
- 논리 볼륨 지우기
- 논리 볼륨을 마운트할 저널 파일 시스템 만들기
LVCB를 지우는 데는 제한이 있습니다. LVCB가 지워진 논리 볼륨은 다른 시스템으로 잘 가져오지 못할 수 있습니다. 가져오는 동안 LVM importvg 명령은 볼륨 그룹에 정의된 모든 논리 볼륨의 LVCB를 훑어 논리 볼륨 정보를 얻습니다. LVCB가 없어도 가져온 볼륨 그룹은 이 볼륨 그룹에 접근하는 새 시스템에 논리 볼륨을 정의하며 사용자는 원시 논리 볼륨에 접근할 수 있습니다. 그러나 보통 다음 일이 생깁니다.
- JFS 정보를 잃고 연결된 마운트 지점이 새 시스템으로 넘어가지 않습니다. 이때는 새 마운트 지점을 만들어야 하며 파일 시스템에 저장된 이전 데이터를 쓸 수 있다는 보장이 없습니다.
- 논리 볼륨에 관한 일부 JFS 아닌 정보를 찾을 수 없습니다. 그러면 시스템은 기본 논리 볼륨 정보로 ODM 정보를 채웁니다. 그래서 lslv 명령의 일부 출력이 실제 논리 볼륨과 맞지 않을 수 있습니다. 원래 디스크에 논리 볼륨 사본이 아직 있으면 그 정보가 ODM 데이터베이스에 올바르게 반영되지 않습니다. rmlvcopy와 mklvcopy 명령으로 논리 볼륨 사본을 다시 만들고 ODM을 동기화합니다.
물리 파티션 한도
LVM 설계에서 각 논리 파티션은 물리 파티션(PP) 하나에 대응합니다. 각 물리 파티션은 여러 디스크 섹터에 대응합니다. LVM 설계상 LVM이 디스크마다 추적할 수 있는 물리 파티션 수는 1016개로 제한됩니다. 대부분 디스크는 1016개 추적 파티션을 다 쓰지 않습니다.
이 한도를 넘으면 다음과 비슷한 메시지가 나올 수 있습니다.
0516-1162 extendvg: Warning, The Physical Partition Size of PPsize requires the
creation of TotalPPs partitions for PVname . The limitation for volume group
VGname is LIMIT physical partitions per physical volume. Use chvg command
with -t option to attempt to change the maximum Physical Partitions per
Physical volume for this volume group.
| 항목 | 뜻 |
|---|---|
| PPsize | 1MB부터 1GB까지 2의 거듭제곱 |
| Total PPs | PPsize일 때 이 디스크의 총 물리 파티션 수 |
| PVname | 물리 볼륨 이름(예: hdisk3) |
| VGname | 볼륨 그룹 이름 |
| LIMIT | 1016이나 1016의 배수 |
이 한도는 다음 경우에 적용됩니다.
- mkvg 명령으로 볼륨 그룹을 만들 때 볼륨 그룹 안 디스크의 물리 파티션 수가 1016을 넘게 지정한 경우. 이 한도를 피하려면 물리 파티션 크기 1, 2, 4(기본), 8, 16, 32, 64, 128, 256, 512, 1024MB 가운데 골라
mkvg -s명령으로 볼륨 그룹을 만듭니다. 아니면 디스크당 1016의 배수 파티션을 허용하는 알맞은 인수를 써서mkvg -t명령으로 볼륨 그룹을 만듭니다. - extendvg 명령으로 기존 볼륨 그룹에 디스크를 더할 때 새 디스크가 1016 한도를 넘긴 경우. 해결하려면
chvg -t명령으로 기존 볼륨 그룹이 디스크당 1016의 배수 파티션을 갖도록 바꿉니다. 아니면 새 디스크를 받아들일 만큼 큰 파티션 크기로 볼륨 그룹을 다시 만들거나, 새 디스크용으로 더 큰 물리 크기의 독립 볼륨 그룹을 만들 수 있습니다.
파티션 한도와 rootvg
설치 코드가 rootvg 드라이브가 4GB보다 크다고 감지하면 디스크 전체 용량을 1016개 트랙에 대응시킬 수 있을 때까지 mkvg -s 값을 바꿉니다. 이 설치 변경은 rootvg에 더하는 다른 모든 디스크도 크기와 관계없이 그 물리 파티션 크기로 정의된다는 뜻이기도 합니다.
파티션 한도와 RAID 시스템
RAID(redundant array of identical disks)를 쓰는 시스템에서 LVM이 쓰는 /dev/hdiskX 이름은 4GB가 아닌 여러 디스크로 이루어질 수 있습니다. 이 경우에도 1016 요구는 그대로입니다. LVM은 실제로 /dev/hdiskX를 이루는 개별 디스크의 크기를 모릅니다. LVM은 /dev/hdiskX를 이루는 실제 물리 디스크가 아니라 인식한 /dev/hdiskX 크기를 바탕으로 1016 한도를 적용합니다.
장치 구성 데이터베이스 동기화
시스템 오작동으로 장치 구성 데이터베이스가 LVM과 어긋날 수 있습니다. 장치 구성 데이터베이스를 LVM 정보와 동기화할 수 있습니다.
장치 구성 데이터베이스가 LVM과 어긋나면 논리 볼륨 명령이 다음과 같은 오류 메시지를 냅니다.
0516-322 The Device Configuration Database is inconsistent ...
또는
0516-306 Unable to find logical volume LVname in the Device
Configuration Database.
(LVname이라는 논리 볼륨은 보통 쓸 수 있는 상태입니다.)
주의: 볼륨 그룹이나 논리 볼륨의 /dev 항목을 지우지 않습니다. ODM으로 볼륨 그룹이나 논리 볼륨의 데이터베이스 항목을 바꾸지 않습니다.
장치 구성 데이터베이스를 LVM 정보와 동기화하려면 root 권한으로 명령행에서 다음을 입력합니다.
synclvodm -v VGName
VGName은 동기화할 볼륨 그룹 이름입니다.
관련 정보
- 볼륨 그룹 오류 고치기
볼륨 그룹 오류 고치기
다음 방법으로 볼륨 그룹 오류를 고칩니다.
importvg 명령이 제대로 동작하지 않으면 장치 구성 데이터베이스를 새로 고쳐 봅니다.
vary-on 실패 무시하기
주의: vary-on 실패를 무시하는 것은 드문 작업입니다. 진행하기 전에 하드웨어, 케이블, 어댑터, 전원 같은 다른 가능한 문제 원인을 모두 확인합니다. vary-on 과정에서 쿼럼 실패를 무시하는 것은 비상시에, 최후 수단으로만(예: 고장 나는 디스크에서 데이터를 건질 때) 씁니다. 쿼럼 실패를 무시하면 고른 VGDA와 VGSA 사본에 든 관리 데이터의 무결성을 보장할 수 없습니다.
쿼럼이 없는 것을 무시하고 볼륨 그룹을 강제로 vary-on하면, 이 vary-on 과정에서 빠진 모든 물리 볼륨의 PV STATE가 removed로 바뀝니다. 곧 이 물리 볼륨에서 VGDA와 VGSA 사본이 모두 지워집니다. 그 뒤로 이 물리 볼륨은 쿼럼 검사에 참여하지 않으며, 볼륨 그룹에 되돌릴 때까지 볼륨 그룹 안에서 활성이 될 수 없습니다. 볼륨 그룹이 쿼럼을 잃지 않았으면 (쿼럼 손실을 무시하는) varyonvg -f 플래그는 무시됩니다.
다음 조건 가운데 하나 이상이면 볼륨 그룹의 쓸 수 있는 디스크에 있는 데이터에 접근할 수 있도록 vary-on 실패를 무시하고 싶을 수 있습니다.
- 쓸 수 없는 물리 볼륨이 영구 손상된 것으로 보입니다.
- 지금 접근할 수 있는 물리 볼륨 가운데 적어도 하나(좋은 VGDA와 VGSA 사본도 있어야 함)가 볼륨 그룹을 마지막으로 vary-on했을 때 온라인이었음을 확인할 수 있습니다. 빠진 물리 볼륨은 진단하고 고칠 때까지 구성 해제하고 전원을 끕니다.
디스크 하나가 빠졌거나 곧 고장 나 수리가 필요할 때 쿼럼을 잃지 않으려면 다음 절차를 씁니다.
- 볼륨 그룹에서 볼륨을 잠시 빼려면 다음을 입력합니다.
chpv -vr PVname
이 명령이 끝나면 물리 볼륨 PVname은 더 이상 쿼럼 검사에 계산되지 않습니다. 그러나 디스크 둘인 볼륨 그룹에서 VGDA/VGSA가 둘인 디스크에 chpv 명령을 쓰면 실패합니다. 명령은 쿼럼을 잃게 하지 않습니다. 2. 수리하려고 디스크를 빼야 하면 시스템 전원을 끄고 디스크를 뺍니다(방법은 디스크 드라이브 문제 해결을 봅니다). 디스크를 고쳐 시스템에 되돌린 뒤 다음 단계로 갑니다. 3. 디스크를 다시 볼륨 그룹의 쿼럼 검사에 넣으려면 다음을 입력합니다.
chpv -v a PVname
참고: chpv 명령은 쿼럼 검사를 바꾸는 데만 씁니다. 디스크의 데이터는 그대로 있으므로, 디스크를 시스템에 되돌리지 않을 거라면 다른 디스크로 옮기거나 복사해야 합니다.
VGDA 경고
기존 볼륨 그룹에 새 디스크를 더하거나 새 볼륨 그룹을 만들 때 문제가 생기는 경우가 있습니다. LVM이 주는 메시지는 다음과 같습니다.
0516-1163 extendvg: VGname already has maximum physical volumes. With the maximum
number of physical partitions per physical volume being LIMIT , the maximum
number of physical volumes for volume group VGname is MaxDisks .
| 항목 | 뜻 |
|---|---|
| VGname | 볼륨 그룹 이름 |
| LIMIT | 1016이나 1016의 배수 |
| MaxDisks | 볼륨 그룹의 최대 디스크 수. 예를 들어 디스크당 물리 파티션(PP)이 1016이면 MaxDisk는 32, 2032이면 16입니다. |
image.data 파일을 고친 뒤 대체 디스크 설치를 쓰거나, mksysb 명령으로 시스템을 복원해 볼륨 그룹을 big 볼륨 그룹으로 다시 만들 수 있습니다. 자세한 내용은 Installation and migration을 봅니다.
한도가 디스크 32개보다 작았던 예전 AIX 버전에서는 이 최대 VGDA 설명의 예외가 rootvg였습니다. 사용자에게 디스크 공간을 더 주려고 rootvg를 만들 때 mkvg -d 명령은 설치 메뉴에서 고른 디스크 수를 기준 수로 썼습니다. 이 -d 값은 디스크 하나면 7이고 디스크를 더 고를 때마다 하나씩 늘어납니다. 예를 들어 디스크 둘을 고르면 8, 셋이면 9입니다.
관련 개념
- 장치 구성 데이터베이스 동기화
영어 원문
Troubleshooting LVM
There are several common types of problems with LVM that you can troubleshoot.
Troubleshooting disk drive problems
This information tells how to diagnose and fix disk drive problems.
If you suspect a disk drive is mechanically failing or has failed, run diagnostics on the disk use the following procedure:
- With root authority, type the following SMIT fast path on the command line:
smit diag
Select Current Shell Diagnostics to enter the AIX Diagnostics tool.
After you read the Diagnostics Operating Instructions screen, press Enter.
Select Diagnostics Routines.
Select System Verification.
Scroll down through the list to find and select the drive you want to test.
Select Commit.
Based on the diagnostics results, you should be able to determine the condition of the disk:
If you detect the disk drive is failing or has failed, of primary importance is recovering the data from that disk. Migration is the preferred way to recover data from a failing disk. The following procedures describe how to recover or restore data in logical volumes if migration cannot complete successfully.
If your drive is failing and you can repair the drive without reformatting it, no data will be lost. • If the disk drive must be reformatted or replaced, make a backup, if possible, and remove the disk drive from its volume group and system configuration before replacing it. Some data from single-copy file systems might be lost.
Related concepts
Disk drive space If you run out of space on a disk drive, there are several ways to remedy the problem. You can automatically track and remove unwanted files, restrict users from certain directories, or mount space from another disk drive. Disk drive recovery without reformatting If you repair a bad disk and place it back in the system without reformatting it, you can let the system automatically activate and resynchronize the stale physical partitions on the drive at boot time. A stale physical partition contains data your system cannot use.
Related tasks
Migrating the contents of a physical volume Recovering by using a reformatted or replacement disk drive You can recover data from a failed disk drive when you must reformat or replace the failed disk. Recovering from disk failure while the system remains available You can recover from disk failure using the hot removability feature.
Disk drive space:
If you run out of space on a disk drive, there are several ways to remedy the problem. You can automatically track and remove unwanted files, restrict users from certain directories, or mount space from another disk drive.
You must have root user, system group, or administrative group authority to execute these tasks.
Related tasks
Troubleshooting disk drive problems This information tells how to diagnose and fix disk drive problems.
Command for cleaning up file systems automatically:
Use the skulker command to clean up file systems by removing unwanted files.
Type the following from the command line:
skulker -p
The skulker command is used to periodically purge obsolete or unneeded files from file systems. Candidates include files in the /tmp directory, files older than a specified age, a.out files, core files, or ed.hup files. For more information about the skulker command, see skulker.
The skulker command is typically run daily, as part of an accounting procedure run by the cron command during off-peak hours.
Related concepts
Disk overflows A disk overflow occurs when too many files fill up the allotted space. This can be caused by a runaway process that creates many unnecessary files.
Related tasks
Setting up an accounting system You can set up an accounting system.
Restricting users from certain directories:
You can release disk space and possibly keep it free by restricting access to directories and monitoring disk usage.
- Restrict users from certain directories by typing:
chmod 755 DirName
This command sets read and write permissions for the owner (root) and sets read-only permissions for the group and others. DirName is the full path name of the directory you want to restrict.
- Monitor the disk usage of individual users by adding the following line to the /var/spool/cron/
crontabs/adm file
0 2 * * 4 /usr/sbin/acct/dodisk
This line runs the dodisk command at 2 a.m. (0 2) each Thursday (4). The dodisk command initiates disk-usage accounting. This command is usually run as part of an accounting procedure that is run by the cron command during off-peak hours.
Related tasks
Setting up an accounting system You can set up an accounting system.
Mounting space from another disk drive:
You can get more space on a disk drive by mounting space from another drive.
You can mount space from one disk drive to another in the following ways:
Use the smit mountfs fast path.
Use the mount command. For example:
mount -n nodeA -vnfs /usr/spool /usr/myspool
The mount command makes a file system available for use at a specific location.
Related reference
Maintaining file systems The simplest tasks you might need when maintaining file systems are grouped within this table.
Disk drive recovery without reformatting:
If you repair a bad disk and place it back in the system without reformatting it, you can let the system automatically activate and resynchronize the stale physical partitions on the drive at boot time. A stale physical partition contains data your system cannot use.
If you suspect a stale physical partition, type the following on the command line:
lspv -M PhysVolName
Where PhysVolName is the name of your physical volume. The lspv command output will list all partitions on your physical volume. The following is an excerpt from example output:
hdisk16:112 lv01:4:2 stale
hdisk16:113 lv01:5:2 stale
hdisk16:114 lv01:6:2 stale
hdisk16:115 lv01:7:2 stale
hdisk16:116 lv01:8:2 stale
hdisk16:117 lv01:9:2 stale
hdisk16:118 lv01:10:2 stale
The first column displays the physical partitions and the second column displays the logical partitions. Any stale physical partitions are noted in the third column.
Related tasks
Troubleshooting disk drive problems This information tells how to diagnose and fix disk drive problems.
Recovering by using a reformatted or replacement disk drive:
You can recover data from a failed disk drive when you must reformat or replace the failed disk.
Attention: Before you reformat or replace a disk drive, remove all references to non-mirrored file systems from the failing disk and remove the disk from the volume group and system configuration. If you do not, you create problems in the ODM (object data manager) and system configuration databases. Instructions for these essential steps are included in the following procedure, under Before replacing or reformatting your failed or failing disk.
The following procedure uses a scenario in which the volume group called myvg contains three disk drives that are called hdisk2, hdisk3, and hdisk4. In this scenario, hdisk3 goes bad. The non-mirrored logical volume lv01 and a copy of the mylv logical volume is contained on hdisk2. The mylv logical volume is mirrored and has three copies, each of which takes up two physical partitions on its disk. The failing hdisk3 contains another copy of mylv, and the non-mirrored logical volume called lv00. Finally, hdisk4 contains a third copy of mylv as well as a logical volume called lv02. The following figure shows this scenario.
This procedure is divided into the following key segments:
The things that you do to protect data before you replace or reformat your failing disk
The procedure that you follow to reformat or replace the disk
The things that you do to recover the data after the disk is reformatted or replaced
Before you replace or reformat your failed or failing disk
Log in with root authority.
If you are not familiar with the logical volumes that are on the failing drive, use an operational disk to view the contents of the failing disk. For example, to use hdisk4 to look at hdisk3, type the following on the command line:
lspv -M -n hdisk4 hdisk3
The lspv command displays information about a physical volume within a volume group. The output looks similar to the following:
hdisk3:1 mylv:1
hdisk3:2 mylv:2
hdisk3:3 lv00:1
hdisk3:4-50
The first column displays the physical partitions, and the second column displays the logical partitions. Partitions 4 through 50 are free.
Back up all single-copy logical volumes on the failing device, if possible. For instructions, see Backing up user files or file systems.
If you have single-copy file systems, unmount them from the disk. (You can identify single-copy file systems from the output of the lspv command. Single-copy file systems have the same number of logical partitions as physical partitions on the output.) Mirrored file systems do not have to be unmounted. In the scenario,
lv00on the failing diskhdisk3is a single-copy file system. To unmount it, type the following:
unmount /dev/lv00
If you do not know the name of the file system, assuming the /etc/filesystems file is not solely on the failed disk, type mount on the command line to list all mounted file systems and find the name that is associated with your logical volume. You can also use the grep command on the /etc/filesystems file to list only the file system names, if any, associated with your logical volume. For example:
grep lv00 /etc/filesystems
The output looks similar to the following example:
dev = /dev/lv00
log = /dev/loglv00
Notes
- The unmount command fails if the file system you are trying to unmount is being used. The unmount command runs only if none of the file system's files are open and no user's current directory is on that device. b. Another name for the unmount command is umount. The names are interchangeable.
- Remove all single-copy file systems from the failed physical volume by typing the rmfs command:
rmfs / FSname
- Remove all mirrored logical volumes on the failing disk.
Note: You cannot use rmlvcopy on the hd5 and hd7 logical volumes from physical volumes in the rootvg volume group. The system does not allow you to remove these logical volumes because there is only one copy of these. The rmlvcopy command removes copies from each logical partition. For example, type:
rmlvcopy mylv 2 hdisk3
By removing the copy on hdisk3, you reduce the number of copies of each logical partition belonging to the mylv logical volume from three to two (one on hdisk4 and one on hdisk2).
- If the failing disk was part of the root volume group and contained logical volume
hd7, remove the primary dump device (hd7) by typing the following on the command line:
sysdumpdev -P -p /dev/sysdumpnull
The sysdumpdev command changes the primary or secondary dump device location for a running system. When you reboot, the dump device returns to its original location.
Note: You can choose to dump to a DVD device. For more information on how to configure a DVD to be the dump device, see sysdumpdev.
- Remove any paging space on the disk by using the following command:
rmps PSname
Where PSname is the name of the paging space to be removed, which is actually the name of the logical volume on which the paging space resides. If the rmps command is not successful, you must use the smit chps fast path to deactivate the primary paging space and reboot before you continue with this procedure. The reducevg command in step 10 can fail if there are active paging spaces.
- Remove any other logical volumes from the volume group, such as the logical volumes that do not contain a file system, by using the rmlv command. For example, type:
rmlv -f lv00
- Remove the failed disk from the volume group by using the reducevg command. For example, type:
reducevg -df myvg hdisk3
If you cannot run the reducevg command or if the command is unsuccessful, the procedure in step 13 can help clean up the VGDA/ODM information after you reformat or replace the drive.
Replacing or reformatting your failed or failing disk
- The next step depends on whether you want to reformat or replace your disk and on what type of hardware you are using:
- If you want to reformat the disk drive, use the following procedure: a. With root authority, type the following SMIT fast path on the command line:
smit diag
Select Current Shell Diagnostics to enter the AIX Diagnostics tool. c. After you read the Diagnostics Operating Instructions screen, press Enter. d. Select Task Selection. e. Scroll down through the task list to find and select Format Media.
Select the disk that you want to reformat. After you confirm that you want to reformat the disk, all content on the disk will be erased.
After the disk is reformatted, continue with step 12.
If your system supports hot swap disks, use the procedure in Recovering from disk failure while the system remains available, then continue with step 13.
If your system does not support hot swap disks, do the following steps: – Power off the old drive by using the SMIT fast path smit rmvdsk. Change the KEEP definition in database field to
No. – Contact your next level of system support to replace the disk drive.
After you replace or reformat your failed or failing disk
Follow the instructions in Configuring a disk and Making an available disk a physical volume.
If you cannot use the reducevg command on the disk from the old volume group before the disk was formatted (step 10), the following procedure can help clean up the VGDA/ODM information. a. If the volume group consisted of only one disk that was reformatted, type:
exportvg VGName
Where VGName is the name of your volume group. b. If the volume group consists of more than one disk, type the following on the command line:
varyonvg VGName
The system displays a message about a missing or unavailable disk, and the new (or reformatted) disk is listed. Note the physical volume identifier (PVID) of the new disk, which is listed in the varyonvg message. It is the 16-character string between the name of the missing disk and the label PVNOTFND. For example:
hdisk3 00083772caa7896e PVNOTFND
Type:
varyonvg -f VGName
The missing disk is now displayed with the PVREMOVED label. For example:
hdisk3 00083772caa7896e PVREMOVED
Then, type the command:
reducevg -df VGName PVID
Where PVID is the physical volume identifier (in this scenario, 00083772caa7896e).
- To add the new disk drive to the volume group, use the extendvg command. For example, type:
extendvg myvg hdisk3
- To re-create the single-copy logical volumes on the new (or reformatted) disk drive, use the mklv command. For example, type:
mklv -y lv00 myvg 1 hdisk3
This example re-creates the lv00 logical volume on the hdisk3 drive. The 1 means that this logical volume is not mirrored.
- To re-create the file systems on the logical volume, use the crfs command. For example, type:
crfs -v jfs -d lv00 -m /dev/lv00
To restore single-copy file system data from backup media, see Restoring user files from a backup image.
To re-create the mirrored copies of logical volumes, use the mklvcopy command. For example, type:
mklvcopy mylv 3 hdisk3
This example creates a mirrored third partition of the mylv logical volume on hdisk3.
- To synchronize the new mirror with the data on the other mirrors (in this example, hdisk2 and hdisk4), use the syncvg command. For example, type:
syncvg -p hdisk3
As a result, all mirrored file systems must be restored and up-to-date. If you were able to back up your single-copy file systems, they are also ready to use. You must be able to proceed with normal system use.
Related tasks
Troubleshooting disk drive problems This information tells how to diagnose and fix disk drive problems.
Example of recovering from a failed disk drive:
To recover from a failed disk drive, back out the way you came in; that is, list the steps you went through to create the volume group, and then go backwards.
The following example is an illustration of this technique. It shows how a mirrored logical volume was created and then how it was altered, backing out one step at a time, when a disk failed.
Note: The following example illustrates a specific instance. It is not intended as a general prototype on which to base any general recovery procedures.
- The system manager, Jane, created a volume group called workvg on hdisk1, by typing:
mkvg -y workvg hdisk1
- She then created two more disks for this volume group, by typing:
extendvg workvg hdisk2
extendvg workvg hdisk3
- Jane created a logical volume of 40 MB that has three copies. Each copy is on one of each of the three disks that comprise the workvg volume group. She used the following commands:
mklv -y testlv workvg 10
mklvcopy testlv 3
After Jane created the mirrored workvg volume group, hdisk2 failed. Therefore, she took the following steps to recover:
- She removed the logical volume copy from hdisk2 by typing:
rmlvcopy testlv 2 hdisk2
- She detached hdisk2 from the system so that the ODM and VGDA are updated, by typing:
reducevg workvg hdisk2
- She removed hdisk2 from the system configuration to prepare for replacement by typing:
rmdev -l hdisk2 -d
- She chose to shut down the system, by typing:
shutdown -F
She replaced the disk. The new disk did not have the same SCSI ID as the former hdisk2.
She rebooted the system. Because you have a new disk (the system sees that there is a new PVID on this disk), the system chooses the first open hdisk name. Because the
-dflag was used in step 3, the name hdisk2 was released, so the system chose hdisk2 as the name of the new disk. If the-dflag had not been used, hdisk4 would have been chosen as the new name.Jane added this disk into the workvg volume group by typing:
extendvg workvg hdisk2
- She created two mirrored copies of the logical volume by typing:
mklvcopy testlv 3
The Logical Volume Manager automatically placed the third logical volume copy on the new hdisk2.
Recovering from disk failure while the system remains available:
You can recover from disk failure using the hot removability feature.
The procedure to recover from disk failure using the hot removability feature is, for the most part, the same as described in Disk drive recovery without reformatting, with the following exceptions:
To unmount file systems on a disk, use the procedure Mount a JFS or JFS2.
To remove the disk from its volume group and from the operating system, use the procedure Removing a disk without data.
To replace the failed disk with a new one, you do not need to shut down the system. Use the following sequence of procedures: a. Logical volume storage b. Configuring a disk c. Continue with step 13 of Recovering by using a reformatted or replacement disk drive.
Related tasks
Troubleshooting disk drive problems This information tells how to diagnose and fix disk drive problems.
Replacing a disk when the volume group consists of one disk:
Use one the following procedure if you can access a disk that is going bad as part of a volume group.
- Migrating the contents of a physical volume
If the disk is bad and cannot be accessed, follow these steps:
Export the volume group.
Replace the drive.
Re-create the data from backup media that exists.
Physical and logical volume errors
There are several common erros with physical and logical volumes that you can troubleshoot.
Hot spot problems:
If you notice performance degradation when accessing logical volumes, you might have hot spots in your logical volumes that are experiencing too much disk I/O.
For more information, see Hot spot management in logical volumes and Enablement and configuration of hot spot report.
LVCB warnings:
A warning results if the LVCB contains invalid information.
The logical volume control block (LVCB) is the first block of a logical volume. The size of LVCB is the block size of the physical volumes within the volume group. This area holds important information such as the creation date of the logical volume, information about mirrored copies, and possible mount points
in the JFS. Certain LVM commands are required to update the LVCB, as part of the algorithms in LVM. The old LVCB is read and analyzed to see if it is a valid. If the information is valid LVCB information, the LVCB is updated. If the information is not valid, the LVCB update is not performed, and you might receive the following message:
Warning, cannot write lv control block data.
Most of the time, this message results when database programs bypass the JFS and access raw logical volumes as storage media. When this occurs, the information for the database is literally written over the LVCB. For raw logical volumes, this is not fatal. After the LVCB is overwritten, the user can still:
Expand a logical volume
Create mirrored copies of the logical volume
Remove the logical volume
Create a journaled file system to mount the logical volume
There are limitations to deleting LVCBs. A logical volume with a deleted LVCB might not import successfully to other systems. During an importation, the LVM importvg command scans the LVCBs of all defined logical volumes in a volume group for information concerning the logical volumes. If the LVCB does not exist, the imported volume group still defines the logical volume to the new system that is accessing this volume group, and the user can still access the raw logical volume. However, the following typically happens:
Any JFS information is lost and the associated mount point is not imported to the new system. In this case, you must create new mount points, and the availability of previous data stored in the file system is not ensured.
Some non-JFS information concerning the logical volume cannot be found. When this occurs, the system uses default logical volume information to populate the ODM information. Thus, some output from the lslv command might be inconsistent with the real logical volume. If any logical volume copies still exist on the original disks, the information will not be correctly reflected in the ODM database. Use the rmlvcopy and mklvcopy commands to rebuild any logical volume copies and synchronize the ODM.
Physical partition limits:
In the design of Logical Volume Manager (LVM), each logical partition maps to one physical partition (PP). And, each physical partition maps to a number of disk sectors. The design of LVM limits the number of physical partitions that LVM can track per disk to 1016. In most cases, not all of the 1016 tracking partitions are used by a disk.
When this limit is exceeded, you might see a message similar to the following:
0516-1162 extendvg: Warning, The Physical Partition Size of PPsize requires the
creation of TotalPPs partitions for PVname . The limitation for volume group
VGname is LIMIT physical partitions per physical volume. Use chvg command
with -t option to attempt to change the maximum Physical Partitions per
Physical volume for this volume group.
Where:
PPsize Is 1 MB to 1 GB in powers of 2.
Total PPs Is the total number of physical partitions on this disk, given the PPsize.
PVname Is the name of the physical volume, for example, hdisk3.
VGname Is the name of the volume group.
LIMIT Is 1016 or a multiple of 1016.
This limitation is enforced in the following instances:
When creating a volume group using the mkvg command, you specified a number of physical partitions on a disk in the volume group that exceeded 1016. To avoid this limitation, you can select from the physical partition size ranges of 1, 2, 4 (the default), 8, 16, 32, 64, 128, 256, 512 or 1024 MB and use the mkvg
-scommand to create the volume group. Alternatively, you can use a suitable factor that allows multiples of 1016 partitions per disk, and use the mkvg-tcommand to create the volume group.When adding a disk to a pre-existing volume group with the extendvg command, the new disk caused the 1016 limitation violation. To resolve this situation, convert the existing volume group to hold multiples of 1016 partitions per disk using the chvg
-tcommand. Alternatively, you can re-create the volume group with a larger partition size that allows the new disk, or you can create a standalone volume group consisting of a larger physical size for the new disk.
Partition limitations and the rootvg
If the installation code detects that the rootvg drive is larger than 4 GB, it changes the mkvg-s value until the entire disk capacity can be mapped to the available 1016 tracks. This installation change also implies that all other disks added to rootvg, regardless of size, are also defined at that physical partition size.
Partition limitations and RAID systems
For systems using a redundant array of identical disks (RAID), the /dev/hdiskX name used by LVM may consist of many non-4 GB disks. In this case, the 1016 requirement still exists. LVM is unaware of the size of the individual disks that really make up /dev/hdiskX. LVM bases the 1016 limitation on the recognized size of /dev/hdiskX, and not the real physical disks that make up /dev/hdiskX.
Device configuration database synchronization:
A system malfunction can cause the device configuration database to become inconsistent with the LVM. You can synchronize the device configuration database with the LVM information.
When the device configuration database becomes inconsistent with the LVM, a logical volume command generates such error messages as:
0516-322 The Device Configuration Database is inconsistent ...
OR
0516-306 Unable to find logical volume LVname in the Device
Configuration Database.
(where the logical volume called LVname is normally available).
Attention: Do not remove the /dev entries for volume groups or logical volumes. Do not change the database entries for volume groups or logical volumes using the Object Data Manager.
To synchronize the device configuration database with the LVM information, with root authority, type the following on the command line:
synclvodm -v VGName
Where VGName is the name of the volume group you want to synchronize.
Related information
Fixing volume group errors Use these methods to fix volume group errors.
Fixing volume group errors:
Use these methods to fix volume group errors.
If the importvg command is not working correctly, try refreshing the device configuration database.
Overriding a vary-on failure
Attention: Overriding a vary-on failure is an unusual operation; check all other possible problem sources such as hardware, cables, adapters, and power sources before proceeding. Overriding a quorum failure during a vary-on process is used only in an emergency and only as a last resort (for example, to salvage data from a failing disk). Data integrity cannot be guaranteed for management data contained in the chosen copies of the VGDA and the VGSA when a quorum failure is overridden.
When you choose to forcibly vary-on a volume group by overriding the absence of a quorum, the PV STATE of all physical volumes that are missing during this vary-on process will be changed to removed. This means that all the VGDA and VGSA copies are removed from these physical volumes. After this is done, these physical volumes will no longer take part in quorum checking, nor are they allowed to become active within the volume group until you return them to the volume group. The varyonvg -f flag (used to override quorum loss) is ignored if the volume group has not lost quorum.
Under one or more of the following conditions, you might want to override the vary-on failure so that the data on the available disks in the volume group can be accessed:
Unavailable physical volumes appear permanently damaged.
You can confirm that at least one of the presently accessible physical volumes (which must also contain a good VGDA and VGSA copy) was online when the volume group was last varied on. Unconfigure and power off the missing physical volumes until they can be diagnosed and repaired.
Use the following procedure to avoid losing quorum when one disk is missing or might soon fail and requires repair:
- To temporarily remove the volume from the volume group, type:
chpv -vr PVname
When this command completes, the physical volume PVname is no longer factored in quorum checking. However, in a two-disk volume group, this command fails if you try the chpv command on the disk that contains the two VGDA/VGSAs. The command does not allow you to cause quorum to be lost.
If you need to remove the disk for repair, power off the system, and remove the disk. (For instructions, see Troubleshooting disk drive problems.) After fixing the disk and returning the disk to the system, continue with the next step.
To make the disk available again to the volume group for quorum checking, type:
chpv -v a PVname
Note: The chpv command is used only for quorum-checking alteration. The data that resides on the disk is still there and must be moved or copied to other disks if the disk is not to be returned to the system.
VGDA warnings
In some instances, the user experiences a problem adding a new disk to an existing volume group or in creating of a new volume group. The message provided by LVM is:
0516-1163 extendvg: VGname already has maximum physical volumes. With the maximum
number of physical partitions per physical volume being LIMIT , the maximum
number of physical volumes for volume group VGname is MaxDisks .
Where:
VGname Is the name of the volume group.
LIMIT Is 1016 or a multiple of 1016.
MaxDisks Is the maximum number of disks in a volume group. For example, if there are 1016 physical partitions (PPs) per disk, then MaxDisk is 32; if there are 2032, then MaxDisk is 16.
You can modify the image.data file and then use alternate disk installation, or restore the system using the mksysb command to re-create the volume group as a big volume group. For more information, see the Installation and migration.
On older AIX versions when the limit was smaller than 32 disks, the exception to this description of the maximum VGDA was the rootvg. To provide users with more free disk space, when rootvg was created, the mkvg -d command used the number of disks selected in the installation menu as the reference number. This -d number is 7 for one disk and one more for each additional disk selected. For example, if two disks are selected, the number is 8 and if three disks are selected, the number is 9, and so on.
Related concepts
Device configuration database synchronization A system malfunction can cause the device configuration database to become inconsistent with the LVM. You can synchronize the device configuration database with the LVM information.