[AIX 운영 체제와 장치 관리 32] LVM 구성 (1) — 유지 보수 명령과 빠른 경로, 디스크 추가, 논리 볼륨 이름 바꾸기·복사, 전용 로그, 핫 스페어, 핫 스폿, 볼륨 그룹 가져오기·내보내기, 물리 볼륨 이전
https://archive.horanglab.com/posts/aix-osdev-32
핵심 정리
- LVM은 기본 운영 체제와 함께 설치돼 따로 구성할 필요가 없지만, 디스크는 먼저 물리 볼륨으로 구성·정의해야 합니다. 작업별 SMIT 빠른 경로와 명령을 표로 정리했습니다.
- 작은 논리 볼륨으로 cplv하면 슈퍼블록까지 잘려 파일 시스템이 깨지므로 SMIT를 쓰지 말고 mklv·crfs·mount·cp로 옮깁니다. rootvg는 이름 바꾸기·가져오기·내보내기를 할 수 없습니다.
- 원본을 계속 써야 하면 mklvcopy로 미러를 만들고 닫은 뒤
splitlvcopy -y newlv oldlv로 나눕니다. 원시 논리 볼륨은 mklvcopy → syncvg → rmlvcopy 순서로 옮깁니다. - 사용자 VG의 JFS 로그는 별도 디스크의 논리 볼륨을
logform으로 서식화하고crfs -a logname=으로 지정합니다(JFS2는 jfs2log,logform -V jfs2). - 물리 볼륨 내용을 옮길 때 hd5(부트 LV)가 원본에 있으면
migratepv -l hd5뒤 bosboot와mkboot -c로 원본 부트 레코드를 지워야 합니다. 그 뒤smit migratepv, 끝나면 reducevg·rmdev로 원본을 뺍니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 6.1 (5.3판과 거의 같음) |
| 원문 | Operating system and device management — 5.3판 2934쪽, 6.1판 344352쪽 |
| 관련 명령어 | varyonvg, extendvg, mkvg, mklv, chlv, cplv, splitlvcopy, mklvcopy, syncvg, rmlvcopy, logform, crfs, importvg, exportvg, migratepv, bosboot, reducevg |
| 관련 파일 | /etc/filesystems |
논리 볼륨 관리자(LVM)는 기본 운영 체제와 함께 설치되며 더 구성할 필요가 없습니다. 그러나 LVM이 디스크를 쓰려면 먼저 디스크를 구성해 물리 볼륨으로 정의해야 합니다.
관련 작업
- 응용 프로그램용 원시 논리 볼륨 정의 — 원시 논리 볼륨은 운영 체제나 파일 시스템이 아니라 데이터베이스나 파티션 같은 응용 프로그램이 직접 제어하는 물리·논리 디스크 공간입니다.
LVM 유지 보수 명령과 빠른 경로
LVM이 제어하는 개체(물리·논리 볼륨, 볼륨 그룹, 파일 시스템)를 유지 보수할 때 필요할 수 있는 가장 간단한 작업을 다음 표에 묶었습니다.
표 62. 논리 볼륨과 저장소 관리 작업
| 작업 | SMIT 빠른 경로 | 명령이나 파일 |
|---|---|---|
| 볼륨 그룹 활성화 | smit varyonvg |
|
| 데이터 없는 고정 디스크를 기존 볼륨 그룹에 더하기 | smit extendvg |
|
| 데이터 없는 고정 디스크를 새 볼륨 그룹에 더하기 | smit mkvg |
|
| 논리 볼륨 더하기(참고 1) | smit mklv |
|
| 볼륨 그룹 더하기 | smit mkvg |
|
| 새 볼륨 그룹을 더하고 활성화 | smit mkvg |
|
| 논리 볼륨이 데이터 할당을 쓰도록 바꾸기 | smit chlv1 |
|
| 볼륨 그룹 이름 바꾸기(참고 2) | 1. smit varyoffvg 2. smit exportvg 3. smit importvg 4. smit mountfs |
1. varyoffvg OldVGName 2. exportvg OldVGName 3. importvg NewVGName 4. mount all |
| 볼륨 그룹이 자동 활성화를 쓰도록 바꾸기 | smit chvg |
|
| 논리 볼륨 정책 바꾸기·설정 | smit chlv1 |
|
| 논리 볼륨을 새 논리 볼륨으로 복사(참고 3) | smit cplv |
|
| 논리 볼륨을 같은 크기의 기존 논리 볼륨으로 복사(주의 1) | smit cplv |
|
| 논리 볼륨을 더 작은 기존 논리 볼륨으로 복사(주의 1, 참고 3) | SMIT를 쓰지 않음(주의 2) | 1. 논리 볼륨 만들기(예: mklv -y hdiskN vg00 4) 2. 새 논리 볼륨에 파일 시스템 만들기(예: crfs -v jfs -d hdiskN -m /doc -A yes) 3. 파일 시스템 마운트(예: mount /doc) 4. 새 마운트 지점에 디렉터리 만들기(예: mkdir /doc/options) 5. 원본에서 대상 논리 볼륨으로 파일 옮기기(예: cp -R /usr/adam/oldoptions/* /doc/options) |
| 논리 볼륨을 더 큰 기존 논리 볼륨으로 복사(주의 1) | smit cplv |
|
| 볼륨 그룹 비활성화 | smit varyoffvg |
|
| 쓰기 검증 켜기와 스케줄링 정책 바꾸기 | smit chlv1 |
|
| 논리 볼륨의 최대 크기 늘리기 | smit chlv1 |
|
| 논리 볼륨 크기 늘리기 | smit extendlv |
|
| 볼륨 그룹별 모든 논리 볼륨 나열 | smit lslv2 |
|
| 시스템의 모든 물리 볼륨 나열 | smit lspv2 |
|
| 모든 볼륨 그룹 나열 | smit lsvg2 |
|
| 물리 볼륨의 상태, 논리 볼륨, 파티션 나열 | smit lspv |
|
| 볼륨 그룹 내용 나열 | smit lsvg1 |
|
| 논리 볼륨의 상태나 대응 나열 | smit lslv |
|
| 데이터 할당 여부와 관계없이 논리 볼륨 미러링 | smit mklvcopy |
|
| 이동식 디스크 전원 끄기(핫 제거 기능에서만) | smit offdsk |
|
| 이동식 디스크 전원 켜기(핫 제거 기능에서만) | smit ondsk |
|
| 볼륨 그룹에서 미러링 제거 | smit unmirrorvg |
|
| 볼륨 그룹 제거 | smit reducevg2 |
|
| 볼륨 그룹 재구성 | smit reorgvg |
|
| 디스크 구성 해제와 전원 끄기 | smit rmvdsk1 또는 smit rmvdsk 뒤 smit opendoor |
주의
- 이 절차로 기존 논리 볼륨에 복사하면 사용자 확인 없이 그 볼륨의 데이터를 모두 덮어씁니다.
- SMIT 절차나 cplv 명령으로 큰 논리 볼륨을 작은 논리 볼륨에 복사하지 않습니다. 그러면 일부 데이터(슈퍼블록 포함)가 작은 논리 볼륨에 복사되지 않아 파일 시스템이 손상됩니다.
참고
- 논리 볼륨을 만든 뒤에는 그 논리 볼륨을 쓰는 LVM 구조가 없으므로 상태가 닫힘(closed)입니다. 논리 볼륨 위에 파일 시스템을 마운트하거나 원시 I/O용으로 열 때까지 닫힌 상태로 남습니다.
- rootvg의 이름을 바꾸거나 가져오거나 내보낼 수 없습니다.
- 특정 논리 볼륨을 복제할 만큼 직접 접근 저장 공간이 있어야 합니다.
관련 작업
- 응용 프로그램용 원시 논리 볼륨 정의
시스템을 켠 채 디스크 더하기
다음 절차는 시스템 전원을 끄지 않고 디스크를 더할 수 있는 핫 제거 기능으로 디스크를 켜고 구성하는 방법입니다.
저장 공간을 늘리거나 디스크 고장을 바로잡으려고 디스크를 더할 수 있습니다. 이 기능은 일부 시스템에서만 쓸 수 있습니다.
- 캐비닛의 빈 슬롯에 디스크를 설치합니다. 설치 절차는 기계의 서비스 안내서를 봅니다.
- 명령행에서 다음 빠른 경로를 입력해 새 디스크 전원을 켭니다.
smit ondsk
이제 디스크는 시스템에 더해졌지만 아직 쓸 수 없습니다. 다음 할 일은 새 디스크에 데이터가 있는지에 따라 다릅니다.
- 디스크에 데이터가 없으면 다음 가운데 하나로 볼륨 그룹에 물리 볼륨으로 더합니다.
- 기존 볼륨 그룹에 디스크를 더하려면 명령행에서 다음 빠른 경로를 입력합니다.
smit extendvg
- 새 볼륨 그룹에 디스크를 더하려면 명령행에서 다음 빠른 경로를 입력합니다.
smit mkvg
- 디스크에 데이터가 있으면 데이터를 가져옵니다.
관련 개념
- 볼륨 그룹 정책 구현 — 쓸 볼륨 그룹 정책을 정했으면 명령행에서 lspv 명령으로 현재 구성을 분석합니다.
관련 작업
- 볼륨 그룹 가져오기·내보내기, 데이터가 있는 디스크 제거, 데이터가 없는 디스크 제거
논리 볼륨 이름 바꾸기
다음 절차는 논리 볼륨의 데이터를 잃지 않고 이름을 바꾸는 방법입니다.
다음 예에서는 논리 볼륨 이름을 lv00에서 lv33으로 바꿉니다.
- 다음을 입력해 논리 볼륨과 연결된 모든 파일 시스템을 마운트 해제합니다.
unmount / FSname
FSname은 파일 시스템의 전체 이름입니다.
참고
- 마운트 해제하려는 파일 시스템을 지금 쓰고 있으면 unmount 명령은 실패합니다. unmount 명령은 파일 시스템의 파일이 하나도 열려 있지 않고 어떤 사용자의 현재 디렉터리도 그 장치에 없을 때만 실행됩니다.
- unmount 명령의 다른 이름은 umount입니다. 두 이름은 바꿔 쓸 수 있습니다.
- 다음을 입력해 논리 볼륨 이름을 바꿉니다.
chlv -n NewLVname OldLVname
-n 플래그는 새 논리 볼륨 이름(NewLVname)을 지정하고 OldLVname은 바꿀 이름입니다. 예:
chlv -n lv33 lv00
참고: JFS나 JFS2 로그의 이름을 바꾸면 이름을 바꾼 로그 장치를 쓰는 모든 파일 시스템에 chfs 명령을 실행하라는 메시지가 나옵니다. 3. 1단계에서 마운트 해제한 파일 시스템을 다음을 입력해 다시 마운트합니다.
mount /test1
이제 논리 볼륨 이름이 바뀌어 쓸 수 있습니다.
논리 볼륨을 다른 물리 볼륨으로 복사
필요에 따라 파일 시스템 무결성을 유지하면서 논리 볼륨을 다른 물리 볼륨으로 복사하는 방법이 여럿 있습니다.
논리 볼륨이나 JFS를 다른 물리 볼륨으로 복사하는 방법은 여러 가지입니다. 목적에 가장 맞는 방법을 고릅니다.
논리 볼륨 복사
가장 간단한 방법은 cplv 명령으로 원래 논리 볼륨을 복사해 대상 물리 볼륨에 새 논리 볼륨을 만드는 것입니다.
논리 볼륨 사용을 멈춥니다. 해당하면 파일 시스템을 마운트 해제하고 논리 볼륨에 접근하는 응용 프로그램을 멈춥니다.
원래 논리 볼륨의 모든 데이터를 담을 수 있는 물리 볼륨을 고릅니다. 주의: 데이터가 든 큰 논리 볼륨을 작은 논리 볼륨으로 복사하면 일부 데이터(슈퍼블록 포함)를 잃어 파일 시스템이 손상될 수 있습니다.
다음 명령으로 원래 논리 볼륨(이 예에서는 lv00)을 복사해 새 논리 볼륨을 만듭니다.
참고: 다음 cplv 명령은 새 논리 볼륨을 만드는데 볼륨 그룹이 동시 모드로 vary-on돼 있으면 실패합니다.
cplv lv00
- 해당하면 파일 시스템을 마운트하고 응용 프로그램을 다시 시작해 논리 볼륨을 쓰기 시작합니다.
이제 논리 볼륨 사본을 쓸 수 있습니다.
원래 논리 볼륨을 계속 쓰면서 복사
원래 논리 볼륨을 계속 써야 하면 다음 예처럼 splitlvcopy 명령으로 내용을 복사할 수 있습니다.
- 다음 SMIT 빠른 경로로 논리 볼륨을 미러링합니다.
smit mklvcopy
- 논리 볼륨 사용을 멈춥니다. 해당하면 파일 시스템을 마운트 해제하고 논리 볼륨에 접근하는 응용 프로그램을 멈추거나 정지(quiescent) 모드로 둡니다. 주의: 다음 단계는 splitlvcopy 명령을 씁니다. 이 명령을 쓰기 전에는 늘 논리 볼륨을 닫고 그 안의 파일 시스템을 마운트 해제합니다. 열린 논리 볼륨을 나누면 파일 시스템이 손상되고, 여러 프로세스가 동시에 접근하면 원래 논리 볼륨과 사본의 일관성이 깨질 수 있습니다.
- root 권한으로 다음 명령을 써서 원래 논리 볼륨(
oldlv)을 새 논리 볼륨(newlv)으로 복사합니다.
splitlvcopy -y newlv oldlv
-y 플래그는 새 논리 볼륨 이름을 지정합니다. oldlv 볼륨에 논리 볼륨 제어 블록이 없으면 splitlvcopy 명령은 성공하지만 newlv 볼륨이 논리 볼륨 제어 블록 없이 만들어졌다는 메시지를 냅니다.
4. 해당하면 파일 시스템을 마운트하고 응용 프로그램을 다시 시작해 논리 볼륨을 쓰기 시작합니다.
이제 논리 볼륨 사본을 쓸 수 있습니다.
원시 논리 볼륨을 다른 물리 볼륨으로 복사
원시 논리 볼륨을 다른 물리 볼륨으로 복사하려면 다음 단계를 따릅니다.
- 다음 명령으로 볼륨 그룹의 새 물리 볼륨에 논리 볼륨의 미러 사본을 만듭니다.
mklvcopy LogVol_name 2 new_PhysVol_name
- 다음 명령으로 새 미러 사본의 파티션을 동기화합니다.
syncvg -l LogVol_name
- 다음 명령으로 이전 물리 볼륨에서 논리 볼륨 사본을 지웁니다.
rmlvcopy LogVol_name 1 old_PhysVol_name
이제 원시 논리 볼륨 사본을 쓸 수 있습니다.
사용자 정의 볼륨 그룹용 전용 디스크에 파일 시스템 로그 만들기
JFS나 JFS2 파일 시스템 로그는 파일 시스템 트랜잭션 레코드의 서식화된 목록입니다. 트랜잭션이 끝나기 전에 시스템이 다운돼도 로그가 파일 시스템 무결성(데이터 무결성은 아님)을 보장합니다.
시스템을 설치할 때 rootvg용 전용 로그가 hd8에 만들어집니다. 다음 절차는 다른 볼륨 그룹용 JFS 로그를 별도 디스크에 만드는 방법입니다. JFS2 로그를 만들 때는 다음을 바꿉니다.
- 로그 장치 형은 jfs2log입니다.
- logform 명령에 JFS2 로그 장치임을 지정하는
-V jfs2옵션을 줍니다. - crfs 명령에는 jfs 대신 jfs2를 지정합니다.
참고: JFS2 로그가 파일 시스템과 다른 디스크에 있어야 한다는 요구는 없습니다. 로그 장치가 파일 시스템과 같은 볼륨 그룹에 있어야 한다는 것만 요구합니다. 이 연습에서는 성능 향상을 위해 JFS2 로그를 별도 디스크에 둡니다.
사용자 정의 볼륨 그룹용 파일 시스템 로그를 만들면 특정 조건에서 성능이 좋아질 수 있습니다. 예를 들어 NFS 서버가 있고 그 트랜잭션을 다른 프로세스와 다투지 않고 처리하고 싶을 때입니다.
사용자 정의 볼륨 그룹용 로그를 만드는 가장 쉬운 방법은 다음과 같이 Web-based System Manager 마법사를 쓰는 것입니다.
- Web-based System Manager가 실행 중이 아니면 root 권한으로 명령행에서
wsm을 입력합니다. - 호스트 이름을 고릅니다.
- Volumes 컨테이너를 고릅니다.
- Logical Volumes 컨테이너를 고릅니다.
- Volumes 메뉴에서 New Logical Volume (Wizard)을 고릅니다. 마법사가 절차를 안내합니다. 필요하면 온라인 도움말을 쓸 수 있습니다.
아니면 다음 절차를 쓸 수 있습니다. 물리 볼륨 둘(hdisk1과 hdisk2)로 볼륨 그룹(fsvg1)을 만듭니다. 파일 시스템은 hdisk2(/u/myfs에 마운트하는 256MB 파일 시스템)에, 로그는 hdisk1에 둡니다. JFS 로그 크기는 기본 4MB입니다. /blv처럼 거의 쓰지 않는 프로그램은 성능에 영향 없이 로그와 같은 물리 볼륨에 둘 수 있습니다.
다음은 SMIT와 명령행으로 사용자 정의 볼륨 그룹용 JFS 로그를 만드는 방법입니다.
- 다음 SMIT 빠른 경로로 새 볼륨 그룹(이 예에서는 fsvg1)을 더합니다.
smit mkvg
- 다음 SMIT 빠른 경로로 이 볼륨 그룹에 새 논리 볼륨을 더합니다.
smit mklv
- Add a Logical Volume 화면에서 다음 필드에 데이터를 넣습니다. 예:
Logical Volumes NAME fsvg1log
Number of LOGICAL PARTITIONS 1
PHYSICAL VOLUME names hdisk1
Logical volume TYPE jfslog
POSITION on Physical Volume center
- 필드를 설정한 뒤 Enter를 눌러 변경을 받아들이고 SMIT를 끝냅니다.
- 명령행에서 다음 명령을 입력합니다.
/usr/sbin/logform /dev/fsvg1log
- 다음 프롬프트가 나오면 y를 입력하고 Enter를 누릅니다.
Destroy /dev/fsvg1log
프롬프트 문구와 달리 아무것도 파괴되지 않습니다. y로 답하면 시스템은 파일 시스템 트랜잭션을 기록할 수 있도록 논리 볼륨을 JFS 로그용으로 서식화합니다.
7. 다음 SMIT 빠른 경로로 논리 볼륨을 하나 더 더합니다.
smit mklv
- 2단계에서 쓴 것과 같은 볼륨 그룹 이름(이 예에서는
fsvg1)을 입력합니다. Logical Volumes 화면에서 다음 필드에 데이터를 넣습니다. 이 논리 볼륨에는 3단계와 다른 물리 볼륨을 지정해야 합니다. 예:
Logical Volumes NAME fslv1
Number of LOGICAL PARTITIONS 64
PHYSICAL VOLUME names hdisk2
Logical volume TYPE jfs
필드를 설정한 뒤 Enter를 눌러 변경을 받아들이고 SMIT를 끝냅니다. 9. 다음 명령 순서로 새 논리 볼륨에 파일 시스템을 더하고, 로그를 지정하고, 새 파일 시스템을 마운트합니다.
crfs -v jfs -d LogVolName -m FileSysName -a logname= FSLogPath
mount FileSysName
LogVolName은 7단계(원문은 2단계)에서 만든 논리 볼륨 이름, FileSysName은 이 논리 볼륨에 마운트할 파일 시스템 이름, FSLogPath는 2단계에서 만든 논리 볼륨 이름입니다. 예:
crfs -v jfs -d fslv1 -m /u/myfs -a logname=/dev/fsvg1log
mount /u/myfs
- 파일 시스템과 로그를 올바르게 설정했는지 확인하려면 다음 명령을 입력합니다(볼륨 그룹 이름은 바꿔 넣음).
lsvg -l fsvg1
출력에 다음 예처럼 만든 두 논리 볼륨과 파일 시스템 형이 나옵니다.
LV NAME TYPE ...
/dev/fsvg1log jfslog ...
fslv1 jfs ...
서로 다른 물리 볼륨에 논리 볼륨을 적어도 둘 담은 볼륨 그룹을 만들었고, 그 가운데 하나에 파일 시스템 로그가 들어 있습니다.
참고: 중복성을 위해 JFS2 로그 장치를 논리 볼륨 수준에서 미러링할 수 있습니다. 그러나 흔한 방법이 아니며 필요하지 않습니다.
기존 볼륨 그룹에 핫 스페어 디스크 지원 켜기
다음 단계는 Web-based System Manager로 기존 볼륨 그룹(원문은 volume)에 핫 스페어 디스크 지원을 켭니다.
- (실행 중이 아니면) 명령행에서
wsm을 입력해 Web-based System Manager를 시작합니다. - Volumes 컨테이너를 고릅니다.
- Volume Groups 컨테이너를 고릅니다.
- 대상 볼륨 그룹 이름을 고르고 Selected 메뉴에서 Properties를 고릅니다.
- Hot Spare Disk Support 탭을 고르고 Enable hot spare disk support를 선택합니다.
- Physical Volumes 탭을 골라 쓸 수 있는 물리 볼륨을 핫 스페어 디스크로 볼륨 그룹에 더합니다.
이제 미러링된 볼륨 그룹에 스페어로 지정한 디스크가 하나 이상 있습니다. 시스템이 고장 나는 디스크를 감지하면 고른 옵션에 따라 고장 나는 디스크의 데이터를 사용이나 가용성의 중단 없이 스페어 디스크로 옮길 수 있습니다.
관련 작업
- 물리 볼륨 내용 옮기기
새 볼륨 그룹을 만들면서 핫 스페어 디스크 지원 켜기
다음 단계는 Web-based System Manager로 새 볼륨 그룹을 만들면서 핫 스페어 디스크 지원을 켭니다.
- (실행 중이 아니면) 명령행에서 wsm을 입력해 Web-based System Manager를 시작합니다.
- Volumes 컨테이너를 고릅니다.
- Volume Groups 컨테이너를 고릅니다.
- Volumes 메뉴에서 New → Volume Group (Advanced Method)을 고릅니다. 다음 화면에서 물리 볼륨과 크기를 고르고, 핫 스페어 디스크 지원을 켜고, 핫 스페어로 지정할 쓰지 않는 물리 볼륨을 고른 뒤, 핫 스페어 디스크나 핫 스페어 디스크 풀의 이전 특성을 설정합니다.
이제 시스템은 스페어로 지정한 디스크가 하나 이상 있는 새 미러링 볼륨 그룹을 인식합니다. 시스템이 고장 나는 디스크를 감지하면 고른 옵션에 따라 그 데이터를 중단 없이 스페어 디스크로 옮길 수 있습니다.
관련 작업
- 물리 볼륨 내용 옮기기
핫 스폿 보고 켜기와 구성
시스템 사용을 중단하지 않고 논리 볼륨의 핫 스폿 문제를 찾아 고칠 수 있습니다. 핫 스폿 문제는 디스크의 일부 논리 파티션에 디스크 I/O가 너무 많아 시스템 성능이 눈에 띄게 떨어질 때 생깁니다.
관련 개념
- 논리 볼륨의 핫 스폿 관리
볼륨 그룹 수준에서 핫 스폿 보고 켜기
다음 단계는 Web-based System Manager로 볼륨 그룹 수준에서 핫 스폿 보고를 켭니다.
- (실행 중이 아니면) 명령행에서
wsm을 입력해 Web-based System Manager를 시작합니다. - Volumes 컨테이너를 고릅니다.
- Volume Groups 컨테이너를 고릅니다.
- 대상 볼륨 그룹 이름을 고르고 Selected 메뉴에서 Hot Spot Reporting...을 고릅니다.
- Enable hot spot reporting과 Restart the Statistics Counters를 선택합니다.
이제 핫 스폿 기능이 켜졌습니다. Web-based System Manager의 풀다운이나 팝업 메뉴로 Manage Hot Spots... Sequential 대화 상자에 들어갑니다. 다음 화면에서 보고와 통계를 정의하고, 통계를 보고, 옮길 논리 파티션을 고르고, 대상 물리 파티션을 지정하고, 변경을 확정하기 전에 정보를 확인할 수 있습니다.
논리 볼륨 수준에서 핫 스폿 보고 켜기
다음 단계는 Web-based System Manager로 논리 볼륨 수준에서 핫 스폿 보고를 켜서 볼륨 그룹 전체에 켜지 않아도 되게 합니다.
- (실행 중이 아니면) 명령행에서
wsm을 입력해 Web-based System Manager를 시작합니다. - Volumes 컨테이너를 고릅니다.
- Logical Volumes 컨테이너를 고릅니다.
- 대상 논리 볼륨 이름을 고르고 Selected 메뉴에서 Hot Spot Reporting...을 고릅니다.
- Enable hot spot reporting과 Restart the Statistics Counters를 선택합니다.
이후 과정은 볼륨 그룹 수준과 같습니다.
볼륨 그룹 가져오기와 내보내기
다음은 가져오기와 내보내기로 사용자 정의 볼륨 그룹을 한 시스템에서 다른 시스템으로 옮기는 방법입니다(rootvg 볼륨 그룹은 내보내거나 가져올 수 없습니다).
내보내기 절차는 시스템에서 볼륨 그룹 정의를 지웁니다. 가져오기 절차는 새 시스템에 볼륨 그룹을 알립니다.
가져오기 절차로 한때 시스템과 연결돼 있다가 내보낸 볼륨 그룹을 다시 시스템에 알릴 수도 있습니다. 또 더할 디스크를 자기 볼륨 그룹에 넣어 가져오기와 내보내기로 데이터가 든 물리 볼륨을 볼륨 그룹에 더할 수도 있습니다.
주의: importvg 명령은 새 시스템에 같은 이름의 논리 볼륨이 이미 있으면 가져온 논리 볼륨의 이름을 바꿉니다. 이름을 바꿔야 하면 표준 오류에 오류 메시지를 출력합니다. 충돌이 없으면 importvg 명령은 파일 마운트 지점과 /etc/filesystems 파일 항목도 만듭니다.
| 작업 | SMIT 빠른 경로 | 명령이나 파일 |
|---|---|---|
| 볼륨 그룹 가져오기 | smit importvg |
|
| 볼륨 그룹 내보내기 | 1. 볼륨 그룹의 논리 볼륨에 있는 파일 시스템 마운트 해제: smit umntdsk 2. 볼륨 그룹 vary-off: smit varyoffvg 3. 볼륨 그룹 내보내기: smit exportvg |
주의: 페이징 공간 볼륨이 있는 볼륨 그룹은 페이징 공간이 활성인 동안 내보낼 수 없습니다. 활성 페이징 공간이 있는 볼륨 그룹을 내보내기 전에 다음 명령으로 시스템 초기화 때 페이징 공간이 자동으로 활성화되지 않게 합니다.
chps -a n paging_space name
그런 다음 페이징 공간이 비활성이 되도록 시스템을 재부팅합니다.
관련 작업
- 시스템을 켠 채 디스크 더하기, 데이터가 있는 디스크 제거
물리 볼륨 내용 옮기기
다음 지침으로 지정한 논리 볼륨 하나 이상에 속한 물리 파티션을 한 물리 볼륨에서 볼륨 그룹의 다른 물리 볼륨 하나 이상으로 옮깁니다. 고장 나는 디스크를 바꾸거나 고치기 전에 데이터를 옮길 때도 이 절차를 씁니다. 루트 볼륨 그룹과 사용자 정의 볼륨 그룹의 물리 볼륨 모두에 쓸 수 있습니다.
주의: 부트 논리 볼륨을 물리 볼륨에서 옮기면 원본의 부트 레코드를 지워야 하며, 그러지 않으면 시스템이 멈출 수 있습니다. bosboot 명령을 실행할 때는 다음 절차 4단계의 chpv -c 명령(원문 그대로. 실제 절차는 mkboot -c)도 실행해야 합니다.
데이터를 새 디스크로 옮기려면 다음 단계를 합니다. 아니면 2단계로 갑니다.
- 다음을 입력해 시스템이 디스크를 인식하고 쓸 수 있는지 확인합니다.
lsdev -Cc disk
출력은 다음과 비슷합니다.
hdisk0 Available 10-60-00-8,0 16 Bit LVD SCSI Disk Drive
hdisk1 Available 10-60-00-9,0 16 Bit LVD SCSI Disk Drive
hdisk2 Available 10-60-00-11,0 16 Bit LVD SCSI Disk Drive
- 디스크가 나열되고 available 상태이면 다음을 입력해 다른 볼륨 그룹에 속하지 않았는지 확인합니다.
lspv
출력은 다음과 비슷합니다.
hdisk0 0004234583aa7879 rootvg active
hdisk1 00042345e05603c1 none active
hdisk2 00083772caa7896e imagesvg active
이 예에서 hdisk1은 셋째 필드를 보면 볼륨 그룹이 쓰지 않으므로 대상 디스크로 쓸 수 있습니다. 새 디스크가 나열되지 않거나 쓸 수 없으면 디스크나 논리 볼륨 저장소를 구성해야 합니다.
- 다음을 입력해 새 디스크를 볼륨 그룹에 더합니다.
extendvg VGName diskname
VGName은 볼륨 그룹 이름, diskname은 새 디스크 이름입니다. 앞 단계의 예에서는 diskname을 hdisk1로 바꿉니다.
2. 원본과 대상 물리 볼륨은 같은 볼륨 그룹에 있어야 합니다. 두 물리 볼륨이 모두 볼륨 그룹에 있는지 확인하려면 다음을 입력합니다.
lsvg -p VGname
VGname은 볼륨 그룹 이름입니다. 루트 볼륨 그룹의 출력은 다음과 비슷합니다.
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 542 85 00..00..00..26..59
hdisk1 active 542 306 00..00..00..00..06
FREE PPs 수를 적어 둡니다. 3. 대상 디스크에 옮길 원본을 담을 공간이 충분한지 확인합니다.
- 다음을 입력해 원본 디스크의 물리 파티션 수를 알아냅니다.
lspv SourceDiskName | grep "USED PPs"
SourceDiskName은 원본 디스크 이름(예: hdisk0)입니다. 출력은 다음과 비슷합니다.
USED PPs: 159 (636 megabytes)
이 예에서 이전을 마치려면 대상 디스크에 FREE PPs가 159개 있어야 합니다.
- 원본 디스크의 USED PPs 수를 대상 디스크(들)의 FREE PPs 수(2단계)와 비교합니다. FREE PPs가 USED PPs보다 많으면 이전에 충분한 공간이 있습니다.
- rootvg 볼륨 그룹의 디스크에서 데이터를 옮길 때만 이 단계를 합니다. 사용자 정의 볼륨 그룹의 디스크에서 옮긴다면 5단계로 갑니다. 다음을 입력해 부트 논리 볼륨(hd5)이 원본 디스크에 있는지 확인합니다.
lspv -l SourceDiskNumber | grep hd5
출력이 없으면 부트 논리 볼륨은 원본 디스크에 없습니다. 5단계로 갑니다. 다음과 비슷한 출력이 나오면
hd5 2 2 02..00..00..00..00 /blv
다음 명령을 실행합니다.
migratepv -l hd5 SourceDiskName DestinationDiskName
대상 디스크에 bosboot 명령을 실행하라는 경고 메시지가 나옵니다. 원본의 부트 레코드를 지우려면 mkboot -c 명령도 실행해야 합니다. 다음 명령 순서를 입력합니다.
bosboot -a -d /dev/ DestinationDiskName
bootlist -m normal DestinationDiskName
mkboot -c -d /dev/ SourceDiskName
- 다음 SMIT 빠른 경로를 입력해 데이터를 옮깁니다.
smit migratepv
- 물리 볼륨을 나열하고 앞서 살펴본 원본 물리 볼륨을 고릅니다.
- DESTINATION physical volume 필드로 갑니다. 기본값을 받아들이면 볼륨 그룹의 모든 물리 볼륨이 이전 대상이 됩니다. 아니면 옮길 파티션에 충분한 공간이 있는 디스크를 하나 이상 고릅니다(4단계(원문 그대로) 참고).
- 원하면 Move only data belonging to this LOGICAL VOLUME 필드로 가서 논리 볼륨을 나열해 고릅니다. 원본 물리 볼륨에 있는, 지정한 논리 볼륨에 할당된 물리 파티션만 옮깁니다.
- Enter를 눌러 물리 파티션을 옮깁니다.
이제 데이터는 새 (대상) 디스크에 있습니다. 그러나 원래 (원본) 디스크는 볼륨 그룹에 남아 있습니다. 디스크가 아직 믿을 만하면 핫 스페어 디스크로 계속 쓸 수 있습니다. 특히 디스크가 고장 나고 있으면 다음 단계를 하는 것이 좋습니다.
- 원본 디스크를 볼륨 그룹에서 빼려면 다음을 입력합니다.
reducevg VGNname SourceDiskName
- 원본 디스크를 시스템에서 물리적으로 빼려면 다음을 입력합니다.
rmdev -l SourceDiskName -d
관련 개념
- 논리 볼륨 저장소 — 논리 볼륨은 물리 볼륨에 있는 정보 묶음입니다.
관련 작업
- 기존 볼륨 그룹에 핫 스페어 디스크 지원 켜기, 새 볼륨 그룹을 만들면서 핫 스페어 디스크 지원 켜기, 디스크 구성, 디스크 드라이브 문제 해결
영어 원문
Configuring Logical Volume Manager
The Logical Volume Manager (LVM) is installed with the base operating system and needs no further configuration. However, disks must be configured and defined as a physical volume before the LVM can use them.
Related tasks
Defining a raw logical volume for an application A raw logical volume is an area of physical and logical disk space that is under the direct control of an application, such as a database or a partition, rather than under the direct control of the operating system or a file system.
LVM maintenance commands and fastpaths
The simplest tasks you might need when maintaining the entities that LVM controls (physical and logical volumes, volume groups, and file systems) are grouped within the following table.
Table 62. Managing Logical Volumes and Storage Tasks Task SMIT Fast Path Command or File Activate a volume group smit varyonvg Add a fixed disk without data to existing volume group smit extendvg
Add a fixed disk without data to new volume group smit mkvg
Add a logical volumeNote 1 smit mklv Add a volume group smit mkvg Add and activate a new volume group smit mkvg Change a logical volume to use data allocation smit chlv1
Change the name of a volume groupNote 2
smit varyoffvg
smit exportvg
smit importvg
smit mountfs
varyoffvg OldVGName
exportvg OldVGName
importvg NewVGName
mount all
Change a volume group to use automatic activation smit chvg
Change or set logical volume policies smit chlv1 Copy a logical volume to a new logical volumeNote 3 smit cplv
Copy a logical volume to an existing logical volume of the same sizeAttn 1 smit cplv
Table 62. Managing Logical Volumes and Storage Tasks (continued) Task SMIT Fast Path Command or File Copy a logical volume to an existing logical volume of smaller sizeAttn 1 Note 3 Do not use SMITAttn 2
Create logical volume. For example: mklv -y hdiskN vg00 4
Create new file system on new logical volume. For example: crfs -v jfs -d hdiskN
-m /doc -A yesMount file system. For example: mount /doc
Create directory at new mount point. For example: mkdir /doc/options
Transfer files system from source to destination logical volume. For example: cp -R
/usr/adam/oldoptions/*\/doc/options
Copy a logical volume to an existing logical volume of larger sizeAttn 1 smit cplv
Deactivate a volume group smit varyoffvg Enable write-verify and change scheduling policy smit chlv1
Increase the maximum size of a logical volume smit chlv1
Increase the size of a logical volume smit extendlv List all logical volumes by volume group smit lslv2 List all physical volumes in system smit lspv2 List all volume groups smit lsvg2 List the status, logical volumes, or partitions of a physical volume smit lspv
List the contents of a volume group smit lsvg1 List a logical volume's status or mapping smit lslv Mirror a logical volume with or without data allocation smit mklvcopy
Power off a removable disk smit offdsk Available with the hot-removability feature only Power on a removable disk smit ondsk Available with the hot-removability feature only Remove mirroring from a volume group smit unmirrorvg Remove a volume group smit reducevg2 Reorganize a volume group smit reorgvg Unconfigure and power off a disk smit rmvdsk1 or smit rmvdsk then smit opendoor
Attention
Using this procedure to copy to an existing logical volume will overwrite any data on that volume without requesting user confirmation.
Do not use the SMIT procedure or the cplv command to copy a larger logical volume to a smaller one. Doing so results in a corrupted file system because some of the data (including the superblock) is not copied to the smaller logical volume.
Note
After you create a logical volume, the state will be closed because no LVM structure is using that logical volume. It will remain closed until a file system has been mounted over the logical volume or the logical volume is opened for raw I/O.
You cannot change the name of, import, or export rootvg.
You must have enough direct access storage to duplicate a specific logical volume.
Related tasks
Defining a raw logical volume for an application A raw logical volume is an area of physical and logical disk space that is under the direct control of an application, such as a database or a partition, rather than under the direct control of the operating system or a file system.
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.
You can add a disk for additional storage or to correct a disk failure. This feature is only available on certain systems.
Install the disk in a free slot of the cabinet. For detailed information about the installation procedure, see the service guide for your machine.
Power on the new disk by typing the following fast path on the command line:
smit ondsk
At this point, the disk is added to the system but it is not yet usable. What you do next depends on whether the new disk contains data.
- If the disk has no data, add it as a physical volume to a volume group using one of the following: – To add the disk to an existing volume group, type the following fast path on the command line:
smit extendvg
– To add the disk to a new volume group, type the following fast path on the command line:
smit mkvg
- If the disk contains data, import the data.
Related concepts
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.
Related tasks
Importing or exporting a volume group The following table explains how to use import and export to move a user-defined volume group from one system to another. (The rootvg volume group cannot be exported or imported.) Removing a disk with data Use this procedure to remove a disk that contains data without turning the system off. Removing a disk without data The following procedure describes how to remove a disk that contains either no data or no data that you want to keep.
Changing the name of a logical volume
The following procedure describes how to rename a logical volume without losing data on the logical volume.
In the following examples, the logical volume name is changed from lv00 to lv33.
- Unmount all file systems associated with the logical volume, by typing:
unmount / FSname
Where FSname is the full name of a file system.
Note
- The unmount command fails if the file system you are trying to unmount is currently being used. The unmount command executes 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.
- Rename the logical volume, by typing:
chlv -n NewLVname OldLVname
Where the -n flag specifies the new logical volume name (NewLVname) and OldLVname is the name you want to change. For example:
chlv -n lv33 lv00
Note: If you rename a JFS or JFS2 log, the system prompts you to run the chfs command on all file systems that use the renamed log device.
- Remount the file systems you unmounted in step 1 on page 346 by typing:
mount /test1
At this point, the logical volume is renamed and available for use.
Copying a logical volume to another physical volume
Depending on your needs, there are several ways to copy a logical volume to another physical volume while retaining file system integrity.
There are multiple methods for copying a logical volume or JFS to another physical volume. Choose the method that best serves your purposes.
Copying a logical volume:
The simplest method is to use the cplv command to copy the original logical volume and create a new logical volume on the destination physical volume.
Stop using the logical volume. Unmount the file system, if applicable, and stop any application that accesses the logical volume.
Select a physical volume that has the capacity to contain all of the data in the original logical volume. Attention: If you copy from a larger logical volume containing data to a smaller one, you can corrupt your file system because some data (including the superblock) might be lost.
Copy the original logical volume (in this example, it is named lv00) and create the new one, using the following command:
Note: The following cplv command fails if it creates a new logical volume and the volume group is varied on in concurrent mode.
cplv lv00
- Mount the file systems, if applicable, and restart applications to begin using the logical volume.
At this point, the logical volume copy is usable.
Copying a logical volume while original logical volume remains usable:
If your environment requires continued use of the original logical volume, you can use the splitlvcopy command to copy the contents, as shown in the following example.
- Mirror the logical volume, using the following SMIT fast path:
smit mklvcopy
Stop using the logical volume. Unmount the file system, if applicable, and stop or put into quiescent mode any application that accesses the logical volume. Attention: The next step uses the splitlvcopy command. Always close logical volumes before splitting them and unmount any contained file systems before using this command. Splitting an open logical volume can corrupt your file systems and cause you to lose consistency between the original logical volume and the copy if the logical volume is accessed simultaneously by multiple processes.
With root authority, copy the original logical volume (
oldlv) to the new logical volume (newlv) using the following command:
splitlvcopy -y newlv oldlv
The -y flag designates the new logical volume name. If the oldlv volume does not have a logical volume control block, the splitlvcopy command completes successfully but generates a message that the newlv volume has been created without a logical volume control block.
- Mount the file systems, if applicable, and restart applications to begin using the logical volume.
At this point, the logical volume copy is usable.
Copying a raw logical volume to another physical volume:
To copy a raw logical volume to another physical volume, perform the following steps.
- Create a mirrored copy of the logical volume on a new physical volume in the volume group using the following command:
mklvcopy LogVol_name 2 new_PhysVol_name
- Synchronize the partitions in the new mirror copy using the following command:
syncvg -l LogVol_name
- Remove the copy of the logical volume from the physical volume using the following command:
rmlvcopy LogVol_name 1 old_PhysVol_name
At this point, the raw logical volume copy is usable.
Creating a file system log on a dedicated disk for a user-defined volume group:
A JFS or JFS2 file system log is a formatted list of file system transaction records. The log ensures file system integrity (but not necessarily data integrity) in case the system goes down before transactions have been completed.
A dedicated disk is created on hd8 for rootvg when the system is installed. The following procedure helps you create a JFS log on a separate disk for other volume groups. When you create a JFS2 log, the procedure requires the following changes:
The log device type is jfs2log.
The logform command requires the
-V jfs2option to specify a JFS2 log device.The crfs commands must specify jfs2 instead of jfs.
Note: There is no requirement for a JFS2 log to be on a separate disk as the file system. The only requirement is that the log devices must be on the same volume group as the file system. In this exercise, JFS2 log must be on a separate disk for performance improvement.
Creating a file system log file for user-defined volume groups can improve performance under certain conditions, such as, if you have an NFS server and you want the transactions for this server to be processed without competition from other processes.
To create a log file for user-defined volume groups, the easiest way is to use the Web-based System Manager wizard, as follows:
If Web-based System Manager is not already running, with root authority, type
wsmon the command line.Select a host name.
Select the Volumes container.
Select the Logical Volumes container.
In the Volumes menu, select New Logical Volume (Wizard). The wizard will guide you through the procedure. Online help is available if you need it.
Alternatively, you can use the following procedure, which creates a volume group (fsvg1) with two physical volumes (hdisk1 and hdisk2). The file system is on hdisk2 (a 256 MB file system mounted at /u/myfs) and the log is on hdisk1. By default, a JFS log size is 4 MB. You can place little-used programs, for example, /blv, on the same physical volume as the log without impacting performance.
The following instructions explain how to create a JFS log for a user-defined volume group using SMIT and the command line interface:
- Add the new volume group (in this example, fsvg1) by using the SMIT fast path:
smit mkvg
- Add a new logical volume to this volume group by using the SMIT fast path:
smit mklv
- On the Add a Logical Volume screen, add your data to the following fields. For example:
Logical Volumes NAME fsvg1log
Number of LOGICAL PARTITIONS 1
PHYSICAL VOLUME names hdisk1
Logical volume TYPE jfslog
POSITION on Physical Volume center
After you set the fields, press Enter to accept your changes and exit SMIT.
Type the following command on a command line:
/usr/sbin/logform /dev/fsvg1log
- When you receive the following prompt, type y and press Enter:
Destroy /dev/fsvg1log
Despite the wording in this prompt, nothing is destroyed. When you respond y to this prompt, the system formats the logical volume for the JFS log so that it can record file system transactions.
- Add another logical volume by using the following SMIT fast path:
smit mklv
- Type the name of the same volume group as you used in step 2 (
fsvg1in this example). In the Logical Volumes screen, add your data to the following fields. Remember to designate a different physical volume for this logical volume than you did in step 3. For example:
Logical Volumes NAME fslv1
Number of LOGICAL PARTITIONS 64
PHYSICAL VOLUME names hdisk2
Logical volume TYPE jfs
After you set the fields, press Enter to accept your changes and exit SMIT.
- Add a file system to the new logical volume, designate the log, and mount the new file system, by using the following sequence of commands:
crfs -v jfs -d LogVolName -m FileSysName -a logname= FSLogPath
mount FileSysName
Where LogVolName is the name of the logical volume you created in step 2; FileSysName is the name of the file system you want to mount on this logical volume; and FSLogPath is the name of the logical volume you created in step 2. For example:
crfs -v jfs -d fslv1 -m /u/myfs -a logname=/dev/fsvg1log
mount /u/myfs
- To verify that you set up the file system and log correctly, type the following command (substituting your volume group name) :
lsvg -l fsvg1
The output shows both logical volumes that you created, with their file system types, as in the following example:
LV NAME TYPE ...
/dev/fsvg1log jfslog ...
fslv1 jfs ...
You created a volume group that contains at least two logical volumes on separate physical volumes, and one of those logical volumes contains the file system log.
Note: To provide redundancy, you can provide mirroring on the logical volume level for the JFS2 log device. However, providing mirroring is not a common practice and is not necessary.
Enabling hot spare disk support for an existing volume group:
The following steps use Web-based System Manager to enable hot spare disk support for an existing volume.
Start Web-based System Manager (if not already running) by typing
wsmon the command line.Select the Volumes container.
Select the Volume Groups container.
Select the name of your target volume group, and choose Properties from the Selected menu.
Select the Hot Spare Disk Support tab and check beside Enable hot spare disk support.
Select the Physical Volumes tab to add available physical volumes to the volume group as hot spare disks.
At this point, your mirrored volume group has one or more disks designated as spares. If your system detects a failing disk, depending on the options you selected, the data on the failing disk can be migrated to a spare disk without interruption to use or availability.
Related tasks
Migrating the contents of a physical volume
Enabling hot spare disk support while creating a new volume group:
The following steps use Web-based System Manager to enable hot spare disk support while you are creating a new volume group.
Start Web-based System Manager (if not already running) by typing wsm on the command line.
Select the Volumes container.
Select the Volume Groups container.
From the Volumes menu, select New
→Volume Group (Advanced Method). The subsequent panels let you choose physical volumes and their sizes, enable hot spare disk support, select unused physical volumes to assign as hot spares, then set the migration characteristics for your hot spare disk or your hot spare disk pool.
At this point, your system recognizes a new mirrored volume group with one or more disks designated as spares. If your system detects a failing disk, depending on the options you selected, the data on the failing disk can be migrated to a spare disk without interruption to use or availability.
Related tasks
Migrating the contents of a physical volume
Enablement and configuration of hot spot report: 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.
Related concepts
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.
Enabling hot spot reporting at the volume group level:
The following steps use Web-based System Manager to enable hot spot reporting at the volume group level.
Start Web-based System Manager (if not already running) by typing
wsmon the command line.Select the Volumes container.
Select the Volume Groups container.
Select the name of your target volume group, and choose Hot Spot Reporting... from the Selected menu.
Check beside Enable hot spot reporting and Restart the Statistics Counters.
At this point, the hot spot feature is enabled. Use the pull-down or pop-up menu in Web-based System Manager to access the Manage Hot Spots... Sequential dialog. In the subsequent panels, 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.
Enabling hot spot reporting at the logical volume level:
The following steps use Web-based System Manager to enable hot spot reporting at the logical volume level so you can avoid enabling it for an entire volume group.
Start Web-based System Manager (if not already running) by typing
wsmon the command line.Select the Volumes container.
Select the Logical Volumes container.
Select the name of your target logical volume and choose Hot Spot Reporting... from the Selected menu.
Check beside Enable hot spot reporting and Restart the Statistics Counters.
At this point, the hot spot feature is enabled. Use the pull-down or pop-up menu in Web-based System Manager to access the Manage Hot Spots... Sequential dialog. In the subsequent panels, 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.
Importing or exporting a volume group:
The following table explains how to use import and export to move a user-defined volume group from one system to another. (The rootvg volume group cannot be exported or imported.)
The export procedure removes the definition of a volume group from a system. The import procedure serves to introduce the volume group to its new system.
You can also use the import procedure to reintroduce a volume group to the system when it once was associated with the system but had been exported. You can also use import and export to add a physical volume that contains data to a volume group by putting the disk to be added in its own volume group.
Attention: The importvg command changes the name of an imported logical volume if a logical volume of that name already exists on the new system. If the importvg command must rename a logical volume, it prints an error message to standard error. When there are no conflicts, the importvg command also creates file mount points and entries in the /etc/filesystems file.
Import and Export Volume Group Tasks Task SMIT Fast Path Command or File Import a volume group smit importvg Export a volume group
Unmount files systems on logical volumes in the volume group: smit umntdsk
Vary off the volume group: smit varyoffvg
Export the volume group: smit exportvg
Attention: A volume group that has a paging space volume on it cannot be exported while the paging space is active. Before exporting a volume group with an active paging space, ensure that the paging space is not activated automatically at system initialization by typing the following command:
chps -a n paging_space name
Then, reboot the system so that the paging space is inactive.
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. Removing a disk with data Use this procedure to remove a disk that contains data without turning the system off.
Migrating the contents of a physical volume: To move the physical partitions belonging to one or more specified logical volumes from one physical volume to one or more other physical volumes in a volume group, use the following instructions. You can also use this procedure to move data from a failing disk before replacing or repairing the failing disk. This procedure can be used on physical volumes in either the root volume group or a user-defined volume group.
Attention: When the boot logical volume is migrated from a physical volume, the boot record on the source must be cleared or it could cause a system hang. When you execute the bosboot command, you must also execute the chpv -c command described in step 4 of the following procedure.
- If you want to migrate the data to a new disk, do the following steps. Otherwise, continue with step 2. a. Check that the disk is recognizable by the system and available by typing:
lsdev -Cc disk
The output resembles the following:
hdisk0 Available 10-60-00-8,0 16 Bit LVD SCSI Disk Drive
hdisk1 Available 10-60-00-9,0 16 Bit LVD SCSI Disk Drive
hdisk2 Available 10-60-00-11,0 16 Bit LVD SCSI Disk Drive
- If the disk is listed and in the available state, check that it does not belong to another volume group by typing:
lspv
The output looks similar to the following:
hdisk0 0004234583aa7879 rootvg active
hdisk1 00042345e05603c1 none active
hdisk2 00083772caa7896e imagesvg active
In the example, hdisk1 can be used as a destination disk because the third field shows that it is not being used by a volume group. If the new disk is not listed or unavailable, you need to configure the disk or logical volume storage. c. Add the new disk to the volume group by typing:
extendvg VGName diskname
Where VGName is the name of your volume group and diskname is the name of the new disk. In the example shown in the previous step, diskname would be replaced by hdisk1.
- The source and destination physical volumes must be in the same volume group. To determine whether both physical volumes are in the volume group, type:
lsvg -p VGname
Where VGname is the name of your volume group. The output for a root volume group looks similar to the following:
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 542 85 00..00..00..26..59
hdisk1 active 542 306 00..00..00..00..06
Note the number of FREE PPs.
- Check that you have enough room on the target disk for the source that you want to move: a. Determine the number of physical partitions on the source disk by typing:
lspv SourceDiskName | grep "USED PPs"
Where SourceDiskName is of the name of the source disk, for example, hdisk0. The output looks similar to the following:
USED PPs: 159 (636 megabytes)
In this example, you need 159 FREE PPs on the destination disk to successfully complete the migration. b. Compare the number of USED PPs from the source disk with the number of FREE PPs on the destination disk or disks (step 2). If the number of FREE PPs is larger than the number of USED PPs, you have enough space for the migration.
- Follow this step only if you are migrating data from a disk in the rootvg volume group. If you are migrating data from a disk in a user-defined volume group, proceed to step 5. Check to see if the boot logical volume (hd5) is on the source disk by typing:
lspv -l SourceDiskNumber | grep hd5
If you get no output, the boot logical volume is not located on the source disk. Continue to step 5. If you get output similar to the following:
hd5 2 2 02..00..00..00..00 /blv
then run the following command:
migratepv -l hd5 SourceDiskName DestinationDiskName
You will receive a message warning you to perform the bosboot command on the destination disk. You must also perform a mkboot -c command to clear the boot record on the source. Type the following sequence of commands:
bosboot -a -d /dev/ DestinationDiskName
bootlist -m normal DestinationDiskName
mkboot -c -d /dev/ SourceDiskName
- Migrate your data by typing the following SMIT fast path:
smit migratepv
List the physical volumes, and select the source physical volume you examined previously.
Go to the DESTINATION physical volume field. If you accept the default, all the physical volumes in the volume group are available for the transfer. Otherwise, select one or more disks with adequate space for the partitions you are moving (from step 4).
If you wish, go to the Move only data belonging to this LOGICAL VOLUME field, and list and select a logical volume. You move only the physical partitions allocated to the logical volume specified that are located on the physical volume selected as the source physical volume.
Press Enter to move the physical partitions.
At this point, the data now resides on the new (destination) disk. The original (source) disk, however, remains in the volume group. If the disk is still reliable, you could continue to use it as a hot spare disk. Especially when a disk is failing, it is advisable to do the following steps:
- To remove the source disk from the volume group, type:
reducevg VGNname SourceDiskName
- To physically remove the source disk from the system, type:
rmdev -l SourceDiskName -d
Related concepts
Logical volume storage Logical volumes are groups of information located on physical volumes.
Related tasks
Enabling hot spare disk support for an existing volume group The following steps use Web-based System Manager to enable hot spare disk support for an existing volume. Enabling hot spare disk support while creating a new volume group The following steps use Web-based System Manager to enable hot spare disk support while you are creating a new volume group. “Configuring a disk” You can configure a new disk by various methods. Troubleshooting disk drive problems This information tells how to diagnose and fix disk drive problems.