mirroring rootvg

1. 새 디스크 추가.

# cfgmgr

# lspv
hdisk0 00064a4ad8be3db8 rootvg active
hdisk1                                             none     None

2. rootvg에 hdisk1 을 추가.

# extendvg rootvg hdisk1
# lspv
hdisk0 00064a4a86b6e289 rootvg active
hdisk1 00064a4ad8be3db8 rootvg active

3. 미러 걸어줌

# mirrorvg -m rootvg hdisk1
0516-1124 mirrorvg: Quorum requirement turned off, reboot system for this
to take effect for rootvg.
0516-1126 mirrorvg: rootvg successfully mirrored, user should perform
bosboot of system to initialize boot records. Then, user must modify
bootlist to include: hdisk0 hdisk1.

4. 확인 (PV 개수가 1에서 2로 바뀜)

# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 1 2 2 open/syncd N/A
hd8 jfslog 1 2 2 open/syncd N/A
hd4 jfs 1 2 2 open/syncd /
hd2 jfs 12 24 2 open/syncd /usr
hd9var jfs 1 2 2 open/syncd /var
hd3 jfs 1 2 2 open/syncd /tmp
hd1 jfs 1 2 2 open/syncd /home
hd10opt jfs 1 2 2 open/syncd /opt

5. 추가한 디스크에 부트블럭을 넣어주고, quroum을 꺼 준다.

# bosboot -ad /dev/hdisk1

bosboot: Boot image is 16773 512 byte blocks.

# chvg -Q n rootvg
# lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 00064a4a00004c000000013a86b6f7dc
VG STATE: active PP SIZE: 64 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1639 (104896 megabytes)
MAX LVs: 256 FREE PPs: 1599 (102336 megabytes)
LVs: 9 USED PPs: 40 (2560 megabytes)
OPEN LVs: 8 QUORUM: 1
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: yes
MAX PPs per PV: 2032 MAX PVs: 16
LTG size: 128 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable

 

# bootlist -m normal -o
hdisk0 blv=hd5
# bootlist -m normal hdisk0 hdisk1
# bootlist -m normal -o
hdisk0 blv=hd5
hdisk1 blv=hd5

6. mirror 제거

# unmirrorvg rootvg hdisk1
0516-1246 rmlvcopy: If hd5 is the boot logical volume, please run ‘chpv -c <diskname>’
as root user to clear the boot record and avoid a potential boot
off an old boot image that may reside on the disk from which this
logical volume is moved/removed.
0516-1132 unmirrorvg: Quorum requirement turned on, reboot system for this
to take effect for rootvg.
0516-1144 unmirrorvg: rootvg successfully unmirrored, user should perform
bosboot of system to reinitialize boot records. Then, user must modify
bootlist to just include: hdisk0.
# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 1 1 closed/syncd N/A
hd6 paging 1 1 1 open/syncd N/A
hd8 jfslog 1 1 1 open/syncd N/A
hd4 jfs 1 1 1 open/syncd /
hd2 jfs 12 12 1 open/syncd /usr
hd9var jfs 1 1 1 open/syncd /var
hd3 jfs 1 1 1 open/syncd /tmp
hd1 jfs 1 1 1 open/syncd /home
hd10opt jfs 1 1 1 open/syncd /opt
# lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: 00064a4a00004c000000013a86b6f7dc
VG STATE: active PP SIZE: 64 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 1639 (104896 megabytes)
MAX LVs: 256 FREE PPs: 1619 (103616 megabytes)
LVs: 9 USED PPs: 20 (1280 megabytes)
OPEN LVs: 8 QUORUM: 2
TOTAL PVs: 2 VG DESCRIPTORS: 3
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 2 AUTO ON: yes
MAX PPs per PV: 2032 MAX PVs: 16
LTG size: 128 kilobyte(s) AUTO SYNC: no
HOT SPARE: no BB POLICY: relocatable

# reducevg rootvg hdisk1
# lspv
hdisk0 00064a4a86b6e289 rootvg active
hdisk1 00064a4ad8be3db8 None
# rmdev -l hdisk1 -d
hdisk1 deleted
# lspv
hdisk0 00064a4a86b6e289 rootvg active
#

 

기타:

mirrorvg 로 rootvg를 미러링 해도 되지만, mklvcopy 커맨드를 사용해도 된다. mklvcopy의 장점은, 원하는 lv만 미러링 할 수 있는것이다. 단점은, syncvg 커맨드로 sync 해주어야 하는것이다.

# mklvcopy hd5 2 hdisk1

# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/stale N/A
hd6 paging 4 4 1 open/syncd N/A
hd8 jfs2log 1 1 1 open/syncd N/A

# lslv -m hd8
hd8:N/A
LP PP1 PV1 PP2 PV2 PP3 PV3
0001 0220 hdisk0 0220 hdisk1

lv 상태가 closed/syncd 에서, closed/stale 로 바뀐다.

syncvg 커맨드를 내리고 기다리면,  stale이 syncd로 바뀐다.

# lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 4 8 2 open/syncd N/A
hd8 jfs2log 1 2 2 open/syncd N/A

# syncvg -v rootvg

나머지는 mirrorvg와 같은 순으로 진행하면 된다.

—- 추가 —-

미러확인을위해 unmirror하고  hdisk0을 제거 후 hdisk1 로 재부팅. 이후, hdisk0을 다시 붙이면, hdisk0에 미러되어 있지 않은 볼륨이 존재한다.  이 LV는 사용불가능한 상태이므로, 필요하다면, 아래와 같은 과정으로, hdisk1로 볼륨을 이동시킨 후 사용하면 된다.  (hdisk0의 datalv를 hdisk1로 이동)

# chpv -va hdisk0

# migratepv -l datalv hdisk0 hdisk1

mirror/unmiror 과정중에, 문제가 발생하였다.

# mklv -t sysdump -c 1 -y lg_dumplv rootvg 20
0516-360 getlvname: The device name is already used; choose a
different name.
0516-822 mklv: Unable to create logical volume.
0516-1734 mklv: Warning, savebase failed. Please manually run ‘savebase’ before rebooting.

# bosboot -a

0301-168 bosboot: The current boot logical volume, /dev/hd5,
does not exist on /dev/hdisk1.

# synclvodm -Pv rootvg
synclvodm: Physical volume data updated.
synclvodm: Logical volume hd6 updated.
synclvodm: Logical volume hd8 updated.
synclvodm: Logical volume hd4 updated.
synclvodm: Logical volume hd2 updated.
synclvodm: Logical volume hd9var updated.
synclvodm: Logical volume hd3 updated.
synclvodm: Logical volume hd1 updated.
synclvodm: Logical volume hd10opt updated.
synclvodm: Logical volume datalv updated.
0516-622 synclvodm: Warning, cannot write lv control block data.
synclvodm: Logical volume updated.

해결을 못했네…

 

 

참고문서:

http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.baseadmn/doc/baseadmndita/mirrorootvg.htm

http://www.unix.com/aix/30039-replace-failed-root-disk-aix.html

http://www-01.ibm.com/support/docview.wss?uid=isg3T1000358

답글 남기기

Your email address will not be published.