[AIX 운영 체제와 장치 관리 37] 논리 볼륨 전략 — 미러링·스트라이핑, 쓰기 스케줄링, 불량 블록, MWC, 디스크 간·디스크 내 할당, 맵 파일, 쓰기 검증, 핫 스페어, 핫 스폿(lvmstat·migratelp), 볼륨 그룹 정책 구현
https://archive.horanglab.com/posts/aix-osdev-37
핵심 정리
- 가용성을 높이면 대개 성능이 떨어지지만, 미러 사본이 다른 디스크·어댑터에 있으면 LVM이 가장 한가한 디스크에서 읽어 읽기 성능이 좋아집니다. AIX LVM은 RAID 0(스트라이핑), 1(미러링), 10(둘 다)을 지원합니다. rootvg를 미러링하면 별도 덤프 LV를 만듭니다.
- 미러 쓰기 스케줄링은 순차, 병렬, 병렬 쓰기+순차 읽기, 병렬 쓰기+라운드 로빈 읽기가 있습니다. 불량 블록 재배치는 VG와 LV 정책이 모두 yes여야 켜집니다.
- MWC가 active면 쓰기 전에 디스크 바깥 가장자리의 MWC 로그를 갱신해 크래시 뒤 미러를 맞추고, passive(big VG만)면 vary-on 뒤 강제 동기화를 하며, off면 크래시 뒤
syncvg -f -l로 강제 동기화해야 합니다. - 디스크 간 정책은 Range(minimum은 가용성, maximum은 성능)와 Strict·Super Strict로 사본 배치를 정합니다. 디스크 내 정책은 outer edge·inner edge·outer middle·inner middle·center 다섯 영역이며 I/O가 많을수록 가운데에 둡니다(MWC on 미러는 바깥 가장자리).
- 핫 스페어 정책은
chvg -h y·Y·n·r -s y·n으로 정하고, 핫 스폿은lvmstat -e로 통계를 켜서 찾은 뒤migratelp lv/lp pv/pp로 옮깁니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 6.1 (5.3판과 거의 같음) |
| 원문 | Operating system and device management — 5.3판 4857쪽, 6.1판 393403쪽 |
| 관련 명령어 | mklv -m·-S·-u, chlv, syncvg -f, bosboot, chvg -h -s, chpv, lvmstat, migratelp, lspv -p |
| 관련 파일 | 맵 파일(예: /tmp/mymap1) |
여기서 설명하는 정책은 사이트에 알맞은 가용성, 성능, 비용 조합을 지향하는 논리 볼륨 사용 전략을 세우는 데 도움이 됩니다.
가용성은 데이터와 연결된 디스크가 고장 났거나 접근할 수 없어도 데이터에 접근할 수 있는 능력입니다. 정상 운영 중에 별도 디스크와 어댑터에 만들어 유지하는 데이터 사본으로 데이터에 계속 접근할 수 있습니다. 미러링과 핫 스페어 디스크 같은 기법이 데이터 가용성 보장에 도움이 됩니다.
성능은 데이터에 접근하는 평균 속도입니다. 쓰기 검증과 미러링 같은 정책은 가용성을 높이지만 시스템 처리 부하를 늘려 성능을 떨어뜨립니다. 미러링은 논리 볼륨 크기를 두세 배로 만듭니다. 일반적으로 가용성을 높이면 성능이 떨어집니다. 디스크 스트라이핑은 성능을 높일 수 있습니다. 디스크 스트라이핑은 미러링과 함께 쓸 수 있습니다. 디스크의 일부 논리 파티션에 디스크 I/O가 너무 많아 시스템 성능이 눈에 띄게 떨어지는 핫 스폿 문제를 찾아 고칠 수 있습니다.
디스크 안과 디스크 사이의 데이터 할당을 제어해 저장 시스템을 최고 성능으로 조정할 수 있습니다. 저장 시스템 성능을 최대화하는 방법은 Performance management를 봅니다.
다음 절로 성능, 가용성, 비용 사이의 절충을 평가합니다. 가용성을 높이면 성능이 떨어지는 경우가 많고 그 반대도 마찬가지라는 점을 기억합니다. 그러나 LVM은 읽기 때 가장 한가한 디스크의 사본을 고르므로 미러링이 성능을 높일 수도 있습니다.
참고: 미러링은 실수로 지웠거나 소프트웨어 문제로 잃은 개별 파일까지 지켜 주지 않습니다. 이런 파일은 일반 테이프나 디스크 백업에서만 복원할 수 있습니다.
관련 개념
- 볼륨 그룹 전략
미러링이나 스트라이핑 요구 사항
논리 볼륨에 저장하는 데이터가 미러링의 처리 비용과 디스크 공간 비용을 감수할 만큼 가치 있는지 판단합니다. 성능에 민감한 큰 순차 접근 파일 시스템이 있으면 디스크 스트라이핑을 고려할 수 있습니다.
성능과 미러링이 늘 반대인 것은 아닙니다. 논리 파티션의 서로 다른 인스턴스(사본)가 다른 물리 볼륨에, 되도록 다른 어댑터에 붙어 있으면 LVM은 가장 한가한 디스크의 사본을 읽어 읽기 성능을 높일 수 있습니다. 쓰기 성능은 디스크가 다른 어댑터에 붙어 있지 않으면 모든 사본을 갱신해야 하므로 늘 같은 비용이 듭니다. 읽기는 사본 하나만 읽으면 됩니다.
AIX LVM은 다음 RAID 옵션을 지원합니다.
표 63. 논리 볼륨 관리자의 RAID 지원
| RAID | 기능 |
|---|---|
| RAID 0 | 스트라이핑 |
| RAID 1 | 미러링 |
| RAID 10 또는 0+1 | 미러링과 스트라이핑 |
미러링은 저장 시스템 가용성을 높이지만 일반 테이프 백업을 대신하려는 것이 아닙니다.
rootvg를 미러링할 수 있지만 그렇게 하면 별도 덤프 논리 볼륨을 만듭니다. 미러링한 논리 볼륨에 덤프하면 덤프가 일관되지 않을 수 있습니다. 또 기본 덤프 장치는 1차 페이징 논리 볼륨이므로 페이징 논리 볼륨을 미러링하면 별도 덤프 논리 볼륨을 만듭니다.
보통 논리 파티션의 데이터를 갱신하면 그 논리 파티션을 담은 모든 물리 파티션이 자동으로 갱신됩니다. 그러나 시스템 오작동이나 갱신 때 물리 볼륨을 쓸 수 없었던 탓에 물리 파티션이 stale(최신 데이터가 아님)이 될 수 있습니다. LVM은 최신 물리 파티션의 현재 데이터를 stale 파티션에 복사해 일관된 상태로 되돌릴 수 있습니다. 이 과정을 미러 동기화라고 합니다. 이 새로 고침은 시스템을 다시 시작할 때, 물리 볼륨이 다시 온라인이 될 때, syncvg 명령을 내릴 때 일어날 수 있습니다.
부트 논리 볼륨의 물리 파티션 구성에 영향을 주는 변경을 하면 그 뒤 bosboot 명령을 실행해야 합니다. 곧 부트 논리 볼륨의 미러링을 바꾸는 것 같은 작업에는 bosboot가 필요합니다.
디스크에 미러 쓰기를 하는 스케줄링 정책
물리 사본이 하나뿐인 데이터는 논리 볼륨 장치 드라이버(LVDD)가 논리 읽기·쓰기 요청 주소를 물리 주소로 바꾸고 알맞은 물리 장치 드라이버를 호출해 요청을 처리합니다. 이 단일 사본(비미러) 정책은 쓰기 요청에 대해 불량 블록 재배치를 처리하고 모든 읽기 오류를 호출한 프로세스에 돌려줍니다.
미러 논리 볼륨을 쓰면 사본이 여럿인 논리 볼륨에 다음 쓰기 스케줄링 정책을 설정할 수 있습니다.
| 정책 | 동작 |
|---|---|
| 순차 스케줄링 | 여러 사본(미러)에 차례로 씁니다. 한 논리 파티션의 미러 사본을 나타내는 여러 물리 파티션을 1차, 2차, 3차로 지정합니다. 순차 스케줄링에서는 물리 파티션에 차례로 씁니다. 한 물리 파티션의 쓰기가 끝나기를 기다린 뒤 다음 물리 파티션의 쓰기를 시작합니다. 모든 미러의 쓰기가 끝나면 쓰기 작업이 끝납니다. |
| 병렬 스케줄링 | 논리 파티션의 모든 물리 파티션에 대한 쓰기를 동시에 시작합니다. 가장 오래 걸리는 물리 파티션 쓰기가 끝나면 쓰기 작업이 끝납니다. 사본이 여럿이면 이 논리 볼륨에서 가장 한가한 디스크로 읽기를 보낼 수 있으므로, 병렬 스케줄링 정책의 미러 논리 볼륨은 I/O 읽기 성능을 높일 수 있습니다. |
| 병렬 쓰기, 순차 읽기 스케줄링 | 논리 파티션의 모든 물리 파티션에 대한 쓰기를 동시에 시작합니다. 읽기는 늘 1차 사본을 먼저 읽습니다. 그 읽기가 실패하면 다음 사본을 읽습니다. 다음 사본에서 읽기를 다시 시도하는 동안 LVM이 실패한 1차 사본을 하드웨어 재배치로 바로잡습니다. 이렇게 나중 접근을 위해 불량 블록을 고칩니다. |
| 병렬 쓰기, 라운드 로빈 읽기 스케줄링 | 논리 파티션의 모든 물리 파티션에 대한 쓰기를 동시에 시작합니다. 읽기는 미러 사본을 번갈아 가며 합니다. |
불량 블록 정책
볼륨 그룹에 불량 블록 재배치가 켜져 있는지 나타냅니다. 기본값은 yes입니다. 볼륨 그룹 값이 yes이면 불량 블록을 재배치할 수 있습니다. no이면 이 정책이 논리 볼륨 설정보다 우선합니다. 값을 바꿔도 모든 논리 볼륨은 이전 설정을 유지합니다. 이 값은 요청한 I/O를 재배치한 블록으로 보내야 하는지를 나타냅니다. yes이면 볼륨 그룹이 불량 블록 재배치를 허용하고, no이면 불량 블록 할당(원문 그대로)을 하지 않습니다. LVM은 하드웨어 재배치가 실패할 때만 소프트웨어 재배치를 합니다. 그 밖에는 LVM 불량 블록 재배치(BBR) 플래그가 효과가 없습니다.
참고: 볼륨 그룹과 논리 볼륨의 불량 블록 정책이 모두 yes가 아니면 불량 블록 재배치는 꺼집니다.
논리 볼륨의 미러 쓰기 일관성 정책
미러 쓰기 일관성(MWC)을 켜면 시스템이나 볼륨 그룹이 올바르게 종료되지 않았을 때 일관되지 않을 수 있는 논리 파티션을 표시합니다. 볼륨 그룹을 다시 온라인으로 vary-on할 때 이 정보로 논리 파티션을 일관되게 만듭니다. 이를 active MWC라고 합니다.
논리 볼륨이 active MWC를 쓰면, 대상 물리 볼륨의 MWC 캐시 블록을 갱신할 수 있을 때까지 이 논리 볼륨에 대한 요청을 스케줄링 계층에 붙잡아 둡니다. MWC 캐시 블록이 갱신되면 요청은 물리 데이터 쓰기로 진행합니다. 쓰기를 진행하기 전에 실제로 데이터가 있는 디스크에만 MWC 캐시 블록을 쓰면 됩니다.
active MWC를 쓰면 시스템 성능에 나쁜 영향을 줄 수 있습니다. 논리 트랙 그룹(LTG)이 활성인 쓰기 요청을 기록(저널링)하는 부담 때문입니다. 볼륨 그룹에 허용되는 LTG 크기는 128K, 256K, 512K, 1024K, 2MB, 4MB, 8MB, 16MB입니다.
참고: LTG 크기를 128K보다 크게 하려면 볼륨 그룹에 든 디스크가 디스크 전략 루틴에서 그 크기의 I/O 요청을 지원해야 합니다. LTG는 논리 볼륨 안의 연속 블록이며 LTG 크기에 맞춰 정렬됩니다. 이 부담은 미러 쓰기에만 있습니다.
미러 사이의 데이터 일관성 보장은 모든 미러에 쓰기를 마치기 전에 시스템이나 볼륨 그룹이 크래시했을 때만 필요합니다. 볼륨 그룹의 모든 논리 볼륨은 MWC 로그를 공유합니다. MWC 로그는 각 디스크의 바깥 가장자리에 있습니다. active MWC를 쓰는 논리 볼륨은 디스크의 MWC 로그와 가깝도록 디스크 바깥 가장자리에 둡니다.
MWC를 passive로 설정하면 볼륨 그룹은 논리 볼륨이 열렸다는 것을 기록합니다. 크래시 뒤 볼륨 그룹을 vary-on하면 논리 볼륨의 자동 강제 동기화가 시작됩니다. 강제 동기화가 진행되는 동안에는 읽는 블록을 논리 볼륨의 다른 미러로 퍼뜨리는 읽기 복구 정책으로 일관성을 유지합니다. 이 정책은 BIG 볼륨 그룹 형에서만 지원합니다.
MWC를 끄면 시스템이나 볼륨 그룹이 크래시할 때 미러 논리 볼륨의 미러가 일관되지 않은 상태로 남을 수 있습니다. 미러 일관성의 자동 보호가 없습니다. 크래시 때 처리 중이던 쓰기 때문에 다음에 볼륨 그룹을 vary-on할 때 미러의 데이터가 일관되지 않을 수 있습니다. 크래시 뒤 MWC가 꺼진 미러 논리 볼륨은 그 안의 데이터를 쓰기 전에 강제 동기화를 해야 합니다. 예:
syncvg -f -l LTV name
강제 동기화의 예외는 페이징 공간처럼 논리 볼륨이 열려 있는 동안에만 내용이 유효한 논리 볼륨입니다.
쓰기에 관한 한 미러 논리 볼륨은 비미러 논리 볼륨과 같습니다. LVM이 쓰기 요청을 완전히 끝내면 데이터는 LVM 아래의 모든 드라이브에 쓰였습니다. LVM이 쓰기에 iodone을 내기 전까지는 쓰기 결과를 알 수 없습니다. 이것이 끝나면 크래시 뒤 복구가 필요 없습니다. 기계가 크래시할 때 끝나지 않은(iodone이 없는) 쓰기 블록은 MWC 설정이나 미러 여부와 관계없이 확인하고 다시 써야 합니다.
미러 논리 볼륨은 비미러 논리 볼륨과 같으므로 "최신 데이터"라는 것은 없습니다. 데이터 유효성에 신경 쓰는 모든 응용 프로그램은 논리 볼륨이 미러링됐든 아니든 볼륨 그룹이나 시스템이 크래시하기 전에 끝나지 않은 처리 중 쓰기의 데이터 유효성을 판단해야 합니다.
active와 passive MWC는 크래시 뒤 볼륨 그룹을 다시 vary-on할 때 미러 하나를 골라 그 데이터를 다른 미러에 퍼뜨려 미러를 일관되게 할 뿐입니다. 이 MWC 정책은 최신 데이터를 추적하지 않습니다. active MWC는 지금 쓰고 있는 LTG만 추적하므로 최신 데이터가 모든 미러에 퍼진다고 보장하지 않습니다. passive MWC는 크래시 뒤 읽을 때 퍼뜨리는 모드로 들어가 미러를 일관되게 합니다. 크래시 뒤 데이터 유효성을 판단해야 하는 것은 LVM 위의 응용 프로그램입니다. LVM 관점에서는 응용 프로그램이 크래시 때 처리 중이던 쓰기를 모두 다시 내면, (크래시 때 처리 중이던 것과 같은 블록을 크래시 뒤에 쓰는 한) 이 쓰기가 끝날 때 일관되지 않았을 수 있는 미러가 일관됩니다.
참고: JFS 로그나 파일 시스템이 든 미러 논리 볼륨은 크래시 뒤 쓰기 전에 강제 동기화하거나, MWC를 켜거나, passive MWC를 켜서 동기화해야 합니다.
디스크 간 할당 정책
디스크 간 할당 정책은 논리 볼륨의 물리 파티션이 놓이는 디스크 수를 지정합니다.
논리 볼륨의 물리 파티션은 디스크 하나에 있을 수도 있고 볼륨 그룹의 모든 디스크에 퍼져 있을 수도 있습니다. mklv와 chlv 명령에서 다음 옵션으로 디스크 간 정책을 정합니다.
- Range 옵션은 논리 볼륨의 물리 사본 하나에 쓰는 디스크 수를 정합니다.
- Strict 옵션은 둘 이상의 사본이 같은 물리 볼륨을 차지해야 할 때 mklv 작업이 성공하는지를 정합니다.
- Super Strict 옵션은 한 미러에 할당한 파티션이 다른 미러의 파티션과 물리 볼륨을 공유할 수 없게 합니다.
- 스트라이프 논리 볼륨은 maximum range와 super strict 디스크 간 정책만 가질 수 있습니다.
관련 개념
- hd6 페이징 공간 옮기기와 줄이기 — 덜 바쁜 다른 디스크로 페이징과 스와핑을 보내 저장 시스템 성능을 높이려고 기본 페이징 공간을 줄이거나 옮길 수 있습니다. 기본 페이징을 줄이거나 옮기면 hdisk0의 디스크 공간도 아낍니다.
논리 볼륨 사본 하나에 대한 디스크 간 설정
최소 디스크 간 설정(Range = minimum)을 고르면 논리 볼륨에 할당한 물리 파티션이 가용성을 높이도록 디스크 하나에 놓입니다. 최대 디스크 간 설정(Range = maximum)을 고르면 성능을 높이도록 여러 디스크에 놓입니다.
비미러 논리 볼륨은 최소 설정을 써서 가용성(하드웨어 고장 때 데이터 접근)을 가장 높입니다. 최소 설정은 가능하면 물리 볼륨 하나가 이 논리 볼륨의 원래 물리 파티션을 모두 담는다는 뜻입니다. 할당 프로그램이 물리 볼륨을 둘 이상 써야 하면 다른 매개변수와 맞게 최소 수를 씁니다.
물리 볼륨을 최소한으로 쓰면 디스크 고장으로 데이터를 잃을 위험이 줄어듭니다. 물리 사본 하나에 물리 볼륨을 하나 더 쓸 때마다 위험이 늘어납니다. 물리 볼륨 넷에 퍼진 비미러 논리 볼륨은 물리 볼륨 하나에 든 논리 볼륨보다 물리 볼륨 하나의 고장으로 데이터를 잃을 가능성이 네 배 높습니다.
원문 그림 3은 최소 디스크 간 할당 정책(디스크 셋 가운데 하나에 물리 파티션 셋)을 보여 줍니다.
최대 설정은 다른 제약을 고려하면서 논리 볼륨의 물리 파티션을 되도록 많은 물리 볼륨에 고르게 퍼뜨립니다. 물리 파티션을 여러 디스크에 퍼뜨리면 논리 볼륨의 평균 접근 시간이 줄어드는 경향이 있으므로 성능 지향 옵션입니다. 가용성을 높이려면 최대 설정은 미러 논리 볼륨에만 씁니다.
원문 그림 4는 최대 디스크 간 할당 정책(디스크 셋에 물리 파티션 하나씩)을 보여 줍니다.
이 정의는 기존 논리 볼륨을 늘리거나 복사할 때도 적용됩니다. 새 물리 파티션 할당은 현재 할당 정책과 이미 쓴 물리 파티션의 위치로 정해집니다.
논리 볼륨 사본에 대한 디스크 간 설정
논리 볼륨 사본 하나를 디스크에 할당하는 것은 꽤 단순합니다.
그러나 미러 사본을 만들면 할당이 다소 복잡해집니다. 원문 그림은 논리 볼륨 첫 인스턴스의 최소·최대 디스크 간(Range) 설정과, 미러 논리 볼륨 사본에 쓸 수 있는 Strict 설정을 보여 줍니다.
예를 들어 논리 볼륨의 미러 사본이 있으면 최소 설정은 논리 볼륨 첫 인스턴스를 담은 물리 파티션을 가능하면 물리 볼륨 하나에 할당합니다. 그런 다음 Strict 옵션 설정에 따라 추가 사본을 같은 물리 볼륨이나 별도 물리 볼륨에 할당합니다. 다시 말해 알고리즘은 Strict 옵션 같은 다른 매개변수의 제약 안에서 가능한 최소 물리 볼륨 수로 모든 물리 파티션을 담습니다.
Strict = y는 논리 파티션의 각 사본을 다른 물리 볼륨에 놓는다는 뜻입니다. Strict = n은 사본이 다른 물리 볼륨으로 제한되지 않는다는 뜻입니다. 이에 비해 Super Strict 옵션은 한 미러의 물리 파티션이 같은 논리 볼륨의 다른 미러의 물리 파티션과 같은 디스크에 있는 것을 허용하지 않습니다.
참고: 볼륨 그룹의 물리 볼륨 수가 고른 논리 파티션당 사본 수보다 적으면 Strict를 n으로 설정합니다. Strict가 y이면 논리 볼륨을 만들 때 오류 메시지가 나옵니다.
원문 그림 5와 6은 Strict 설정이 다른 최소·최대 디스크 간 할당 정책을 보여 줍니다.
관련 개념
- 디스크 고장 대비 고가용성, 논리 볼륨 사본 하나에 대한 디스크 간 설정
각 논리 볼륨의 디스크 내 할당 정책
디스크 내 할당 정책의 선택지는 물리 파티션이 놓일 수 있는 디스크의 다섯 영역에 바탕합니다.
물리 파티션이 물리 볼륨의 가운데에 가까울수록 평균 탐색 시간이 짧습니다. 가운데는 디스크의 다른 어느 부분에서든 평균 탐색 거리가 가장 짧기 때문입니다.
파일 시스템 로그는 운영 체제가 아주 자주 쓰므로 물리 볼륨 가운데에 할당하기 좋습니다. 반대로 부트 논리 볼륨은 드물게 쓰므로 물리 볼륨 가장자리나 중간에 할당합니다.
일반 규칙은 절대적으로든 중요한 응용 프로그램을 실행하는 동안이든 I/O가 많을수록 논리 볼륨의 물리 파티션을 물리 볼륨 가운데에 가깝게 할당해야 한다는 것입니다.
이 규칙에는 중요한 예외가 하나 있습니다. 미러 쓰기 일관성(MWC)이 On인 미러 논리 볼륨은 시스템이 MWC 데이터를 쓰는 바깥 가장자리에 둡니다. 미러링을 쓰지 않으면 MWC는 해당하지 않으며 성능에 영향을 주지 않습니다.
물리 파티션이 놓일 수 있는 다섯 영역은 다음과 같습니다.
- 바깥 가장자리(outer edge)
- 안쪽 가장자리(inner edge)
- 바깥 중간(outer middle)
- 안쪽 중간(inner middle)
- 가운데(center)
가장자리 파티션은 평균 탐색 시간이 가장 느려 그것을 쓰는 응용 프로그램의 응답 시간이 대체로 깁니다. 가운데 파티션은 평균 탐색 시간이 가장 빨라 응답 시간이 대체로 가장 좋습니다. 그러나 물리 볼륨에서 가운데 파티션은 다른 영역보다 적습니다.
관련 개념
- 디스크 고장 대비 고가용성
할당 정책 조합
서로 맞지 않는 디스크 간·디스크 내 정책을 고르면 예측할 수 없는 결과가 나올 수 있습니다.
시스템은 한 정책을 다른 정책보다 우선해 물리 파티션을 할당합니다. 예를 들어 디스크 내 정책으로 center, 디스크 간 정책으로 minimum을 고르면 디스크 간 정책이 우선합니다. 파티션이 모두 가운데 영역에 들어가지 않아도 시스템은 가능하면 논리 볼륨의 모든 파티션을 디스크 하나에 놓습니다. 구현하기 전에 고른 정책의 상호 작용을 이해해야 합니다.
맵 파일로 정확하게 할당
디스크 간·디스크 내 정책의 기본 옵션으로 부족하면 맵 파일을 만들어 논리 볼륨의 물리 파티션 순서와 위치를 정확히 지정하는 것을 고려합니다.
Web-based System Manager, SMIT, mklv -m 명령으로 맵 파일을 만들 수 있습니다.
예를 들어 rootvg에 hdisk1의 13, 4145, 50~60번 파티션으로 lv06이라는 파티션 10개짜리 논리 볼륨을 만들려면 명령행에서 다음 절차를 쓸 수 있습니다.
- 쓸 물리 파티션이 할당할 수 있는 빈 파티션인지 확인하려면 다음을 입력합니다.
lspv -p hdisk1
- 다음 내용이 든
/tmp/mymap1같은 파일을 만듭니다.
hdisk1:1-3
hdisk1:41-45
hdisk1:50-60
mklv 명령은 맵 파일에 나온 순서대로 물리 파티션을 할당합니다. mklv 명령으로 지정한 논리 볼륨 전체를 할당할 만큼 맵 파일에 물리 파티션이 충분한지 확인합니다(필요보다 많이 나열해도 됩니다). 3. 다음 명령을 입력합니다.
mklv -t jfs -y lv06 -m /tmp/mymap1 rootvg 10
스트라이프 논리 볼륨 전략
스트라이프 논리 볼륨은 자주 접근하고 성능에 민감한 큰 순차 파일 시스템에 씁니다. 스트라이핑은 성능을 높이려는 것입니다.
참고: 덤프 공간이나 부트 논리 볼륨은 스트라이핑할 수 없습니다. 부트 논리 볼륨은 연속된 물리 파티션이어야 합니다.
VGName에 hdisk1, hdisk2, hdisk3에 걸쳐 스트립 크기(스트립 크기에 배열의 디스크 수를 곱하면 스트라이프 크기) 16KB로 lv07이라는 파티션 12개짜리 스트라이프 논리 볼륨을 만들려면 다음을 입력합니다.
mklv -y lv07 -S 16K VGName 12 hdisk1 hdisk2 hdisk3
VGName 안의 아무 디스크 셋에 걸쳐 스트립 크기 8KB로 lv08이라는 파티션 12개짜리 스트라이프 논리 볼륨을 만들려면 다음을 입력합니다.
mklv -y lv08 -S 8K -u 3 VGName 12
디스크 스트라이핑으로 성능을 높이는 방법은 Performance management를 봅니다.
쓰기 검증 정책
쓰기 검증 옵션을 쓰면 모든 쓰기 작업 바로 뒤에 읽기를 해서 쓰기가 성공했는지 확인합니다.
쓰기가 실패하면 오류 메시지가 나옵니다. 이 정책은 가용성을 높이지만 읽기에 드는 시간 때문에 성능을 떨어뜨립니다. 쓰기 검증 정책은 mklv 명령으로 논리 볼륨을 만들 때나 나중에 chlv 명령으로 지정할 수 있습니다.
핫 스페어 디스크 정책
미러 논리 볼륨이 있는 볼륨 그룹에 핫 스페어 디스크를 지정할 수 있습니다.
핫 스페어로 쓸 디스크를 지정할 때 디스크가 고장 나기 시작하면 쓸 정책과 동기화 특성을 지정할 수 있습니다.
(핫 스페어 디스크로 표시하려고) 볼륨 그룹에 물리 볼륨을 더하면 그 디스크는 볼륨 그룹의 가장 작은 디스크 이상의 용량이어야 합니다. 이 기능을 쓰면 MWC 쓰기 실패로 물리 볼륨이 missing으로 표시될 때 데이터가 핫 스페어 디스크로 옮겨집니다.
핫 스페어 디스크 지원을 켜는 chvg와 chpv 명령은 다음 구문처럼 사이트에서 기능을 구현하는 여러 옵션을 제공합니다.
chvg -h hotsparepolicy -s syncpolicy VolumeGroup
hotsparepolicy는 디스크가 고장 날 때 쓸 정책을 정합니다.
| 값 | 핫 스페어 정책 |
|---|---|
| y | 고장 나는 디스크 하나에서 스페어 디스크 하나로 파티션을 자동으로 옮깁니다. 핫 스페어 디스크 풀에서 고장 나는 디스크를 대신할 만큼 큰 디스크 가운데 가장 작은 것을 씁니다. |
| Y | 고장 나는 디스크에서 파티션을 자동으로 옮기되 핫 스페어 디스크 풀 전체를 쓸 수 있습니다. |
| n | 자동으로 옮기지 않습니다(기본값). |
| r | 이 볼륨 그룹의 핫 스페어 디스크 풀에서 모든 디스크를 뺍니다. |
syncpolicy 인수는 stale 파티션을 자동으로 동기화할지 정합니다.
| 값 | 동기화 정책 |
|---|---|
| y | stale 파티션을 자동으로 동기화하려고 합니다. |
| n | stale 파티션을 자동으로 동기화하지 않습니다(기본값). |
VolumeGroup 인수는 연결된 미러 볼륨 그룹 이름을 지정합니다.
논리 볼륨의 핫 스폿 관리
시스템 사용을 중단하지 않고 논리 볼륨의 핫 스폿 문제를 찾아 고칠 수 있습니다.
핫 스폿 문제는 디스크의 일부 논리 파티션에 디스크 I/O가 너무 많아 시스템 성능이 눈에 띄게 떨어질 때 생깁니다.
문제를 푸는 첫걸음은 문제를 찾는 것입니다. 기본적으로 시스템은 논리 볼륨 사용 통계를 모으지 않습니다. 통계 수집을 켠 뒤 lvmstat 명령을 처음 입력하면 시스템은 이전 재부팅 이후의 카운터 값을 보여 줍니다. 그 뒤로는 lvmstat 명령을 입력할 때마다 이전 lvmstat 명령 이후의 차이를 보여 줍니다.
lvmstat 명령 출력을 해석하면 트래픽이 가장 많은 논리 파티션을 찾을 수 있습니다. 물리 디스크 하나에 사용량이 많은 논리 파티션이 여럿 있어 쓸 수 있는 디스크에 고르게 나누고 싶으면 migratelp 명령으로 이 논리 파티션을 다른 물리 디스크로 옮길 수 있습니다.
다음 예에서는 통계 수집을 켜고 lvmstat 명령을 되풀이해 기준 통계를 모읍니다.
# lvmstat -v rootvg -e
# lvmstat -v rootvg -C
# lvmstat -v rootvg
출력은 다음과 비슷합니다.
Logical Volume iocnt Kb_read Kb_wrtn Kbps
hd8 4 0 16 0.00
paging01 0 0 0 0.00
lv01 0 0 0 0.00
hd1 0 0 0 0.00
hd3 0 0 0 0.00
hd9var 0 0 0 0.00
hd2 0 0 0 0.00
hd4 0 0 0 0.00
hd6 0 0 0 0.00
hd5 0 0 0 0.00
앞 출력은 모든 카운터가 0으로 초기화됐음을 보여 줍니다. 다음 예에서는 먼저 /unix의 데이터를 /tmp 디렉터리로 복사합니다. lvmstat 명령 출력은 rootvg의 활동을 반영합니다.
# cp -p /unix /tmp
# lvmstat -v rootvg
Logical Volume iocnt Kb_read Kb_wrtn Kbps
hd3 296 0 6916 0.04
hd8 47 0 188 0.00
hd4 29 0 128 0.00
hd2 16 0 72 0.00
paging01 0 0 0 0.00
lv01 0 0 0 0.00
hd1 0 0 0 0.00
hd9var 0 0 0 0.00
hd6 0 0 0 0.00
hd5 0 0 0 0.00
출력은 /tmp 디렉터리에 마운트된 hd3 논리 볼륨, JFS 로그 논리 볼륨인 hd8, /(루트)인 hd4, /usr 디렉터리인 hd2, /var 디렉터리인 hd9var의 활동을 보여 줍니다. 다음 출력은 hd3과 hd2의 세부 정보입니다.
# lvmstat -l hd3
Log_part mirror# iocnt Kb_read Kb_wrtn Kbps
1 1 299 0 6896 0.04
3 1 4 0 52 0.00
2 1 0 0 0 0.00
4 1 0 0 0 0.00
# lvmstat -l hd2
Log_part mirror# iocnt Kb_read Kb_wrtn Kbps
2 1 9 0 52 0.00
3 1 9 0 36 0.00
7 1 9 0 36 0.00
4 1 4 0 16 0.00
9 1 1 0 4 0.00
14 1 1 0 4 0.00
1 1 0 0 0 0.00
볼륨 그룹 출력은 논리 볼륨의 모든 I/O 활동 요약을 보여 줍니다. I/O 요청 수(iocnt), 읽고 쓴 킬로바이트(각각 Kb_read와 Kb_wrtn), KB/s 단위 전송량(Kbps)으로 나뉩니다. 논리 볼륨 정보를 요청하면 같은 정보를 논리 파티션별로 받습니다. 미러 논리 볼륨이면 미러 볼륨마다 통계를 받습니다. 앞 출력 예에서는 활동이 없는 논리 파티션 줄 몇 개를 생략했습니다. 출력은 늘 iocnt 열 내림차순으로 정렬됩니다.
migratelp 명령은 매개변수로 논리 볼륨 이름, (lvmstat 출력에 나온) 논리 파티션 번호, 특정 미러 사본의 선택적 번호를 받습니다. 정보를 생략하면 첫 미러 사본을 씁니다. 옮길 대상 물리 볼륨을 지정해야 하며, 대상 물리 파티션 번호도 지정할 수 있습니다. 성공하면 출력은 다음과 비슷합니다.
# migratelp hd3/1 hdisk1/109
migratelp: Mirror copy 1 of logical partition 1 of logical volume
hd3 migrated to physical partition 109 of hdisk1.
논리 볼륨이나 볼륨 그룹에 핫 스폿 기능을 켠 뒤에는 보고와 통계를 정의하고, 통계를 보고, 옮길 논리 파티션을 고르고, 대상 물리 파티션을 지정하고, 변경을 확정하기 전에 정보를 확인할 수 있습니다. Web-based System Manager가 핫 스폿 보고를 구성하고 결과를 관리하는 것을 도와줍니다.
관련 개념
- 핫 스폿 보고 켜기와 구성
영어 원문
Logical volume strategy
The policies described here help you set a strategy for logical volume use that is oriented toward a combination of availability, performance, and cost that is appropriate for your site.
Availability is the ability to access data even if its associated disk has failed or is inaccessible. The data might remain accessible through copies of the data that are made and maintained on separate disks and adapters during normal system operation. Techniques such as mirroring and the use of hot spare disks can help ensure data availability.
Performance is the average speed at which data is accessed. Policies such as write-verify and mirroring enhance availability but add to the system processing load, and thus degrade performance. Mirroring doubles or triples the size of the logical volume. In general, increasing availability degrades performance. Disk striping can increase performance. Disk striping is allowed with mirroring. You can detect and remedy hot-spot problems that occur when some of the logical partitions on your disk have so much disk I/O that your system performance noticeably suffers.
By controlling the allocation of data on the disk and between disks, you can tune the storage system for the highest possible performance. See Performance management for detailed information on how to maximize storage-system performance.
Use the following sections to evaluate the trade-offs among performance, availability, and cost. Remember that increased availability often decreases performance, and vice versa. Mirroring may increase performance, however, the LVM chooses the copy on the least busy disk for Reads.
Note: Mirroring does not protect against the loss of individual files that are accidentally deleted or lost because of software problems. These files can only be restored from conventional tape or disk backups.
Related concepts
Volume group strategy Disk failure is the most common hardware failure in the storage system, followed by failure of adapters and power supplies. Protection against disk failure primarily involves the configuration of the logical volumes.
Requirements for mirroring or striping
Determine whether the data that is stored in the logical volume is valuable enough to warrant the processing and disk-space costs of mirroring. If you have a large sequential-access file system that is performance-sensitive, you may want to consider disk striping.
Performance and mirroring are not always opposed. If the different instances (copies) of the logical partitions are on different physical volumes, preferably attached to different adapters, the LVM can improve Read performance by reading the copy on the least busy disk. Write performance, unless disks are attached to different adapters, always cost the same because you must update all copies. It is only necessary to read one copy for a Read operation.
AIX LVM supports the following RAID options:
Table 63. Logical Volume Manager support for RAID
- RAID 0 — Striping
- RAID 1 — Mirroring
- RAID 10 or 0+1 — Mirroring and striping
While mirroring improves storage system availability, it is not intended as a substitute for conventional tape backup arrangements.
You can mirror the rootvg, but if you do, create a separate dump logical volume. Dumping to a mirrored logical volume can result in an inconsistent dump. Also, because the default dump device is the primary paging logical volume, create a separate dump logical volume if you mirror your paging logical volumes.
Normally, whenever data on a logical partition is updated, all the physical partitions containing that logical partition are automatically updated. However, physical partitions can become stale (no longer containing the most current data) because of system malfunctions or because the physical volume was unavailable at the time of an update. The LVM can refresh stale partitions to a consistent state by copying the current data from an up-to-date physical partition to the stale partition. This process is called mirror synchronization. The refresh can take place when the system is restarted, when the physical volume comes back online, or when you issue the syncvg command.
Any change that affects the physical partition makeup of a boot logical volume requires that you run the bosboot command after that change. This means that actions such as changing the mirroring of a boot logical volume require a bosboot.
Scheduling policies for mirrored writes to disk:
For data that has only one physical copy, the logical volume device driver (LVDD) translates a logical Read or Write request address into a physical address and calls the appropriate physical device driver to service the request. This single-copy or nonmirrored policy handles bad block relocation for Write requests and returns all Read errors to the calling process.
If you use mirrored logical volumes, the following scheduling policies for writing to disk can be set for a logical volume with multiple copies:
Sequential-scheduling policy
Performs Writes to multiple copies or mirrors in order. The multiple physical partitions representing the mirrored copies of a single logical partition are designated primary, secondary, and tertiary. In sequential scheduling, the physical partitions are written to in sequence. The system waits for the Write operation for one physical partition to complete before starting the Write operation for the next one. When all write operations have been completed for all mirrors, the Write operation is complete.
Parallel-scheduling policy
Simultaneously starts the Write operation for all the physical partitions in a logical partition. When the Write operation to the physical partition that takes the longest to complete finishes, the Write operation is completed. Specifying mirrored logical volumes with a parallel-scheduling policy might improve I/O read-operation performance, because multiple copies allow the system to direct the read operation to the least busy disk for this logical volume.
Parallel write with sequential read-scheduling policy
Simultaneously starts the Write operation for all the physical partitions in a logical partition. The primary copy of the read is always read first. If that Read operation is unsuccessful, the next copy is read. During the Read retry operation on the next copy, the failed primary copy is corrected by the LVM with a hardware relocation. This patches the bad block for future access.
Parallel write with round robin read-scheduling policy
Simultaneously starts the Write operation for all the physical partitions in a logical partition. Reads are switched back and forth between the mirrored copies.
Bad block policy
Indicates whether the volume group is enabled for bad block relocation. The default value is yes. When the value is set to yes for the volume group, the bad blocks can be relocated. When the value is set to no, the policy overrides the logical volume settings. When the value is changed, all logical volumes continue with the previous setting. The value indicates whether or not a requested I/O must be directed to a relocated block. If the value is set to yes, the volume group allows bad block relocation. If the value is set to no, bad block allocation is not completed. The LVM performs software relocation only when hardware relocation fails. Otherwise, the LVM bad block relocation (BBR) flag has no effect.
Note: Bad block relocation is disabled unless the bad block policy settings for volume group and logical volume are both set to yes.
Mirror Write Consistency policy for a logical volume:
When Mirror Write Consistency (MWC) is turned ON, logical partitions that might be inconsistent if the system or the volume group is not shut down properly are identified. When the volume group is varied back online, this information is used to make logical partitions consistent. This is referred to as active MWC.
When a logical volume is using active MWC, then requests for this logical volume are held within the scheduling layer until the MWC cache blocks can be updated on the target physical volumes. When the MWC cache blocks have been updated, the request proceeds with the physical data Write operations. Only the disks where the data actually resides must have these MWC cache blocks written to it before the Write can proceed.
When active MWC is being used, system performance can be adversely affected. Adverse effects are caused by the overhead of logging or journaling a Write request in which a Logical Track Group (LTG) is active. The allowed LTG sizes for a volume group are 128 K, 256 K, 512 K, 1024 K, 2 MB, 4 MB, 8 MB, and 16 MB.
Note: To have an LTG size greater than 128 K, the disks contained in the volume group must support I/O requests of this size from the disk's strategy routines. The LTG is a contiguous block contained within the logical volume and is aligned on the size of the LTG. This overhead is for mirrored Writes only.
It is necessary to guarantee data consistency between mirrors only if the system or volume group crashes before the Write to all mirrors has been completed. All logical volumes in a volume group share the MWC log. The MWC log is maintained on the outer edge of each disk. Locate the logical volumes that use Active MWC at the outer edge of the disk so that the logical volume is in close proximity to the MWC log on disk.
When MWC is set to passive, the volume group logs that the logical volume has been opened. After a crash when the volume group is varied on, an automatic force sync of the logical volume is started. Consistency is maintained while the force sync is in progress by using a copy of the read recovery policy that propagates the blocks being read to the other mirrors in the logical volume. This policy is only supported on the BIG volume group type.
When MWC is turned OFF, the mirrors of a mirrored logical volume can be left in an inconsistent state in the event of a system or volume group crash. There is no automatic protection of mirror consistency. Writes outstanding at the time of the crash can leave mirrors with inconsistent data the next time the volume group is varied on. After a crash, any mirrored logical volume that has MWC turned OFF should perform a forced sync before the data within the logical volume is used. For example,
syncvg -f -l LTV name
An exception to forced sync is logical volumes whose content is only valid while the logical volume is open, such as paging spaces.
A mirrored logical volume is the same as a nonmirrored logical volume with respect to a Write. When LVM completely finishes with a Write request, the data has been written to all the drive(s) below LVM. The outcome of the Write is unknown until LVM issues an iodone on the Write. After this is complete, no recovery after a crash is necessary. Any blocks being written that have not been completed (iodone) when a machine crashes should be checked and rewritten, regardless of the MWC setting or whether they are mirrored.
Because a mirrored logical volume is the same as a nonmirrored logical volume, there is no such thing as latest data. All applications that care about data validity need to determine the validity of the data of outstanding or in-flight writes that did not complete before the volume group or system crashed, whether or not the logical volume was mirrored.
Active and passive MWC make mirrors consistent only when the volume group is varied back online after a crash by picking one mirror and propagating that data to the other mirrors. These MWC policies do not keep track of the latest data. Active MWC only keeps track of LTGs currently being written, therefore MWC does not guarantee that the latest data will be propagated to all the mirrors. Passive MWC makes mirrors consistent by going into a propagate-on-read mode after a crash. It is the application above LVM that has to determine the validity of the data after a crash. From the LVM perspective, if the application always reissues all outstanding Writes from the time of the crash, the possibly inconsistent mirrors will be consistent when these Writes finish, (as long as the same blocks are written after the crash as were outstanding at the time of the crash).
Note: Mirrored logical volumes containing either JFS logs or file systems must be synchronized after a crash either by forced sync before use, by turning MWC on, or turning passive MWC on.
Inter-disk allocation policies
The inter-disk allocation policy specifies the number of disks on which the physical partitions of a logical volume are located.
The physical partitions for a logical volume might be located on a single disk or spread across all the disks in a volume group. The following options are used with the mklv and chlv commands to determine inter-disk policy:
The Range option determines the number of disks used for a single physical copy of the logical volume.
The Strict option determines whether the mklv operation succeeds if two or more copies must occupy the same physical volume.
The Super Strict option specifies that the partitions allocated for one mirror cannot share a physical volume with the partitions from another mirror.
Striped logical volumes can only have a maximum range and a super strict inter-disk policy.
Related concepts
Relocating and reducing hd6 paging space You might want to reduce or move the default paging space in order to enhance storage system performance by forcing paging and swapping to other disks in the system that are less busy. Reducing or moving the default paging also conserves disk space on hdisk0.
Inter-disk settings for a single copy of the logical volume:
If you select the minimum inter-disk setting (Range = minimum), the physical partitions assigned to the logical volume are located on a single disk to enhance availability. If you select the maximum inter-disk setting (Range = maximum), the physical partitions are located on multiple disks to enhance performance.
For nonmirrored logical volumes, use the minimum setting to provide the greatest availability (access to data in case of hardware failure). The minimum setting indicates that one physical volume contains all the original physical partitions of this logical volume if possible. If the allocation program must use two or more physical volumes, it uses the minimum number, while remaining consistent with other parameters.
By using the minimum number of physical volumes, you reduce the risk of losing data because of a disk failure. Each additional physical volume used for a single physical copy increases that risk. A nonmirrored logical volume spread across four physical volumes is four times as likely to lose data because of one physical volume failure than a logical volume contained on one physical volume.
The following figure illustrates a minimum inter-disk allocation policy.
This illustration shows three disks. One disk contains three physical partitions; the others have no physical partitions.
The maximum setting, considering other constraints, spreads the physical partitions of the logical volume as evenly as possible over as many physical volumes as possible. This is a performance-oriented option, because spreading the physical partitions over several disks tends to decrease the average access time for the logical volume. To improve availability, the maximum setting is only used with mirrored logical volumes.
The following figure illustrates a maximum inter-disk allocation policy.
This illustration shows three disks, each containing one physical partition.
These definitions are also applicable when extending or copying an existing logical volume. The allocation of new physical partitions is determined by your current allocation policy and where the existing used physical partitions are located.
Related concepts
Figure 3. Minimum Inter-Disk Allocation Policy
Figure 4. Maximum Inter-Disk Allocation Policy
“Inter-disk settings for logical volume copies” The allocation of a single copy of a logical volume on disk is fairly straightforward.
Inter-disk settings for logical volume copies:
The allocation of a single copy of a logical volume on disk is fairly straightforward.
When you create mirrored copies, however, the resulting allocation is somewhat complex. The figures that follow show minimum maximum and inter-disk (Range) settings for the first instance of a logical volume, along with the available Strict settings for the mirrored logical volume copies.
For example, if there are mirrored copies of the logical volume, the minimum setting causes the physical partitions containing the first instance of the logical volume to be allocated on a single physical volume, if possible. Then, depending on the setting of the Strict option, the additional copy or copies are allocated on the same or on separate physical volumes. In other words, the algorithm uses the minimum number of physical volumes possible, within the constraints imposed by other parameters such as the Strict option, to hold all the physical partitions.
The setting Strict = y means that each copy of the logical partition is placed on a different physical volume. The setting Strict = n means that the copies are not restricted to different physical volumes. By comparison, the Super Strict option would not allow any physical partition from one mirror to be on the same disk as a physical partition from another mirror of the same logical volume.
Note: If there are fewer physical volumes in the volume group than the number of copies per logical partition you have chosen, set Strict to n. If Strict is set to y, an error message is returned when you try to create the logical volume.
The following figure illustrates a minimum inter-disk allocation policy with differing Strict settings:
The following figure illustrates a maximum inter-disk allocation policy with differing Strict settings: Figure 5. Minimum Inter-Disk Policy/Strict. This illustration shows that if the Strict option is equal to Yes, each copy of
Related concepts
High availability in case of disk failure The primary methods used to protect against disk failure involve logical volume configuration settings, such as mirroring. Inter-disk settings for a single copy of the logical volume If you select the minimum inter-disk setting (Range = minimum), the physical partitions assigned to the logical volume are located on a single disk to enhance availability. If you select the maximum inter-disk setting (Range = maximum), the physical partitions are located on multiple disks to enhance performance.
Intra-disk allocation policies for each logical volume
The intra-disk allocation policy choices are based on the five regions of a disk where physical partitions can be located.
The closer a given physical partition is to the center of a physical volume, the lower the average seek time is because the center has the shortest average seek distance from any other part of the disk.
The file system log is a good candidate for allocation at the center of a physical volume because it is so frequently used by the operating system. At the other extreme, the boot logical volume is used infrequently and therefore is allocated at the edge or middle of the physical volume.
The general rule is that the more I/Os, either absolutely or during the running of an important application, the closer to the center of the physical volumes the physical partitions of the logical volume needs to be allocated.
This rule has one important exception: Mirrored logical volumes with Mirror Write Consistency (MWC) set to On are at the outer edge because that is where the system writes MWC data. If mirroring is not in effect, MWC does not apply and does not affect performance.
The five regions where physical partitions can be located are as follows:
outer edge
inner edge
outer middle
inner middle
center Figure 6. Maximum Inter-Disk Policy/Strict. This illustration shows that if the Strict option is equal to Yes, each copy of
The edge partitions have the slowest average seek times, which generally result in longer response times for any application that uses them. The center partitions have the fastest average seek times, which generally result in the best response time for any application that uses them. There are, however, fewer partitions on a physical volume at the center than at the other regions.
Related concepts
High availability in case of disk failure The primary methods used to protect against disk failure involve logical volume configuration settings, such as mirroring.
Combining allocation policies
If you select inter-disk and intra-disk policies that are not compatible, you might get unpredictable results.
The system assigns physical partitions by allowing one policy to take precedence over the other. For example, if you choose an intra-disk policy of center and an inter-disk policy of minimum, the inter-disk policy takes precedence. The system places all of the partitions for the logical volume on one disk if possible, even if the partitions do not all fit into the center region. Make sure you understand the interaction of the policies you choose before implementing them.
Using map files for precise allocation
If the default options provided by the inter- and intra-disk policies are not sufficient for your needs, consider creating map files to specify the exact order and location of the physical partitions for a logical volume.
You can use Web-based System Manager, SMIT, or the mklv -m command to create map files.
For example, to create a ten-partition logical volume called lv06 in the rootvg in partitions 1 through 3, 41 through 45, and 50 through 60 of hdisk1, you could use the following procedure from the command line.
- To verify that the physical partitions you plan to use are free to be allocated, type:
lspv -p hdisk1
- Create a file, such as
/tmp/mymap1, containing:
hdisk1:1-3
hdisk1:41-45
hdisk1:50-60
The mklv command allocates the physical partitions in the order that they appear in the map file. Be sure that there are sufficient physical partitions in the map file to allocate the entire logical volume that you specify with the mklv command. (You can list more than you need.)
- Type the command:
mklv -t jfs -y lv06 -m /tmp/mymap1 rootvg 10
Developing striped logical volume strategies
Striped logical volumes are used for large sequential file systems that are frequently accessed and performance-sensitive. Striping is intended to improve performance.
Note: A dump space or boot logical volume cannot be striped. The boot logical volume must be contiguous physical partitions.
To create a 12-partition striped logical volume called lv07 in VGName with a strip size (the strip size multiplied by the number of disks in an array equals the stripe size) of 16 KB across hdisk1, hdisk2, and hdisk3, type:
mklv -y lv07 -S 16K VGName 12 hdisk1 hdisk2 hdisk3
To create a 12-partition striped logical volume called lv08 in VGName with a strip size of 8 KB across any three disks within VGName, type:
mklv -y lv08 -S 8K -u 3 VGName 12
For more information on how to improve performance by using disk striping, see Performance management.
Write-verify policies
Using the write-verify option causes all Write operations to be verified by an immediate follow-up Read operation to check the success of the Write.
If the Write operation is not successful, you get an error message. This policy enhances availability but degrades performance because of the extra time needed for the Read. You can specify the use of a write-verify policy on a logical volume either when you create it using the mklv command, or later by changing it with the chlv command.
Hot-spare disk policies
You can designate disks as hot-spare disks for a volume group with mirrored logical volumes.
When you designate which disks to use as hot-spare disks, you can specify a policy to be used if a disk or disks start to fail and you can specify synchronization characteristics.
If you add a physical volume to a volume group (to mark it as a hot-spare disk), the disk must have at least the same capacity as the smallest disk already in the volume group. When this feature is implemented, data will be migrated to a hot-spare disk when Mirror Write Consistency (MWC) write failures mark a physical volume missing.
The commands to enable hot-spare disk support, chvg and chpv, provide several options in how you implement the feature at your site, as shown by the following syntax:
chvg -h hotsparepolicy -s syncpolicy VolumeGroup
Where hotsparepolicy determines which of the following policies you want to use when a disk is failing:
y Automatically migrates partitions from one failing disk to one spare disk. From the pool of hot spare disks, the smallest one that is big enough to substitute for the failing disk will be used.
Y Automatically migrates partitions from a failing disk, but might use the complete pool of hot-spare disks.
n Does not migrate automatically (default).
r Removes all disks from the pool of hot-spare disks for this volume group.
The syncpolicy argument determines whether you want to synchronize any stale partitions automatically:
y Automatically tries to synchronize stale partitions.
n Does not automatically try to synchronize stale partitions. (This option is the default.)
The VolumeGroup argument specifies the name of the associated mirrored volume group.
Hot spot management in logical volumes
You can identify hot spot problems with your logical volumes and remedy those problems without interrupting the use of your system.
A hot-spot problem occurs when some of the logical partitions on your disk have so much disk I/O that your system performance noticeably suffers.
The first step toward solving the problem is to identify it. By default, the system does not collect statistics for logical volume use. After you enable the gathering of these statistics, the first time you enter the lvmstat command, the system displays the counter values since the previous system reboot. Thereafter, each time you enter the lvmstat command, the system displays the difference since the previous lvmstat command.
By interpreting the output of the lvmstat command, you can identify the logical partitions with the heaviest traffic. If you have several logical partitions with heavy usage on one physical disk and want to balance these across the available disks, you can use the migratelp command to move these logical partitions to other physical disks.
In the following example, the gathering of statistics is enabled and the lvmstat command is used repeatedly to gather a baseline of statistics:
# lvmstat -v rootvg -e
# lvmstat -v rootvg -C
# lvmstat -v rootvg
The output is similar to the following:
Logical Volume iocnt Kb_read Kb_wrtn Kbps
hd8 4 0 16 0.00
paging01 0 0 0 0.00
lv01 0 0 0 0.00
hd1 0 0 0 0.00
hd3 0 0 0 0.00
hd9var 0 0 0 0.00
hd2 0 0 0 0.00
hd4 0 0 0 0.00
hd6 0 0 0 0.00
hd5 0 0 0 0.00
The previous output shows that all counters have been reset to zero. In the following example, data is first copied from the /unix directory to the /tmp directory. The lvmstat command output reflects the activity for the rootvg:
(13줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
The output shows activity on the hd3 logical volume, which is mounted in the /tmp directory, on hd8, which is the JFS log logical volume, on hd4, which is / (root), on hd2, which is the /usr directory, and on hd9var, which is the /var directory. The following output provides details for hd3 and hd2:
(15줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
The output for a volume group provides a summary for all the I/O activity of a logical volume. It is separated into the number of I/O requests (iocnt), the kilobytes read and written (Kb_read and Kb_wrtn, respectively), and the transferred data in KB/s (Kbps). If you request the information for a logical volume, you receive the same information, but for each logical partition separately. If you have mirrored logical volumes, you receive statistics for each of the mirror volumes. In the previous sample output, several lines for logical partitions without any activity were omitted. The output is always sorted in decreasing order on the iocnt column.
The migratelp command uses, as parameters, the name of the logical volume, the number of the logical partition (as it is displayed in the lvmstat output), and an optional number for a specific mirror copy. If information is omitted, the first mirror copy is used. You must specify the target physical volume for the move; in addition, you can specify a target physical partition number. If successful, the output is similar to the following:
# migratelp hd3/1 hdisk1/109
migratelp: Mirror copy 1 of logical partition 1 of logical volume
hd3 migrated to physical partition 109 of hdisk1.
After the hot spot feature is enabled, either for a logical volume or a volume group, you can define your reporting and statistics, display your statistics, select logical partitions to migrate, specify the destination physical partition, and verify the information before committing your changes. The Web-based System Manager helps you configure hot-spot reporting and manage the result.
Related concepts
Enablement and configuration of hot spot report
볼륨 그룹 정책 구현
쓸 볼륨 그룹 정책을 정했으면 명령행에서 lspv 명령을 입력해 현재 구성을 분석합니다.
표준 구성은 같은 디스크 어댑터와 다른 지원 하드웨어에 붙은 여러 물리 볼륨을 담은 볼륨 그룹 하나를 제공합니다. 표준 구성에서는 쿼럼 볼륨 그룹을 이루는 디스크가 많을수록 디스크가 고장 나도 쿼럼이 남을 가능성이 커집니다. 비쿼럼 그룹은 적어도 디스크 둘로 이루어져야 합니다. 볼륨 그룹 정책 변경을 구현하려면 다음을 합니다.
- lspv 명령 출력으로 할당된 물리 볼륨과 빈 물리 볼륨을 확인합니다.
- 물리 볼륨을 하나 이상 더해 쿼럼을 보장합니다.
- 볼륨 그룹을 비쿼럼 상태로 바꿉니다.
- 고가용성을 보장하는 데 필요할 때만 하드웨어를 다시 구성합니다. 지침은 시스템의 서비스 안내서를 봅니다.
관련 개념
- 볼륨 그룹을 비쿼럼 상태로 전환
관련 작업
- 시스템을 켠 채 디스크 더하기
영어 원문
Implementing a volume group policy
After you have decided which volume group policies you want to use, analyze your current configuration by typing the lspv command on the command line.
The standard configuration provides a single volume group that includes multiple physical volumes attached to the same disk adapter and other supporting hardware. In a standard configuration, the more disks that make up a quorum volume group the better the chance of the quorum remaining when a disk failure occurs. In a nonquorum group, a minimum of two disks must make up the volume group. To implement your volume group policy changes, do the following:
Use the lspv command output to check your allocated and free physical volumes.
Ensure a quorum by adding one or more physical volumes.
Change a volume group to nonquorum status 4. Reconfigure the hardware only if necessary to ensure high availability. For instructions, see the service guide for your system.
Related concepts
Conversion of a volume group to nonquorum status You can change a volume group to nonquorum status to have data continuously available even when there is no quorum.
Related tasks
Adding disks while the system remains available The following procedure describes how to turn on and configure a disk using the hot-removability feature, which lets you add disks without powering off the system.