ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • IBM AIX ALT_DISK생성 작업
    System of Infra/Unix System 2020. 4. 13. 20:53
    반응형

    AIX로고이미지

    IBM AIX ALT_DISK생성 작업

    [root@test_svr1:/]# lspv
    hdisk0          00008492ef481bbc                    rootvg          active     
    hdisk1          00c5c6d788d2c92f                    None

    -> 여분의 디스크가 있는지 확인 후에 여분의 디스크가 있다면 진행하시면 됩니다.

    [root@test_svr1:/]# bootinfo -s hdisk0
    81920

    -> hdisk0번 디스크에는 용량이 총 80GB인것을 확인할 수 있습니다.

    [root@test_svr1:/]# bootinfo -s hdisk1
    102400

    -> hdisk1번 디스크에는 용량이 총100GB정도가 있으니 타깃이 더 용량이 크기 때문에 alt_disk 복제를 할 수가 있습니다. 만약 용량이 적다면 작업을 진행할 수 없습니다.

    [root@test_svr1:/]# alt_disk_install -CB hdisk1
    +-----------------------------------------------------------------------------+
    ATTENTION: calling new module /usr/sbin/alt_disk_copy. Please see the alt_disk_copy man page
    and documentation for more details.
    Executing command: {/usr/sbin/alt_disk_copy -B -d "hdisk1"}
    +-----------------------------------------------------------------------------+
    Calling mkszfile to create new /image.data file.
    Checking disk sizes.
    Creating cloned rootvg volume group and associated logical volumes.
    Creating logical volume alt_hd5
    Creating logical volume alt_hd6
    Creating logical volume alt_hd8
    Creating logical volume alt_hd4
    ...(생략)
    Creating logical volume alt_livedump
    Creating logical volume alt_ptflv
    
    Creating /alt_inst/ file system.
    Creating /alt_inst/admin file system.
    Creating /alt_inst/home file system.
    Creating /alt_inst/opt file system.
    Creating /alt_inst/ptf file system.
    ...(생략) -> alt_disk에 대한 파일시스템으로 복제 마운트
    Creating /alt_inst/var file system.
    Creating /alt_inst/var/adm/ras/livedump file system.
    Generating a list of files
    for backup and restore into the alternate file system...
    Backing-up the rootvg files and restoring them to the
    
    alternate file system...
    Modifying ODM on cloned disk. -> 작업이 거의 완료된 상태
    Building boot image on cloned disk.
    
    forced unmount of /alt_inst/var/adm/ras/livedump
    forced unmount of /alt_inst/var/adm/ras/livedump
    forced unmount of /alt_inst/var
    ...(생략) -> 복제를 끝내고 강제로 마운트 했던 alt_disk 마운트를 umount
    forced unmount of /alt_inst/admin
    forced unmount of /alt_inst
    forced unmount of /alt_inst
    Changing logical volume names in volume group descriptor area.
    
    Fixing LV control blocks...
    Fixing file system superblocks...

    -> Modifying ODM on cloned disk의 호출명령어가 출력되면 복제를 뜨고 나서 강제로 Umount 하게 됩니다. alt_disk가 진행이 완료되어 가는 시점을 나타내는 것으로 생각하시면 됩니다.

    [root@test_svr1:/]# lspv
    hdisk0          00008492ef481bbc                    rootvg          active     
    hdisk1          00c5c6d788d2c92f                    altinst_rootvg

    -> altinst_rootvg라는 vg로 alt_disk가 생성된것을 볼 수 있습니다.

    [root@test_svr1:/]# ipl_varyon -i
    PVNAME BOOT DEVICE PVID VOLUME GROUP ID
    hdisk0 YES 00008492ef481bbc0000000000000000 000084920000d900
    hdisk1 YES 00c5c6d788d2c92f0000000000000000 00c5c6d700004c00

    -> 명령어를 통해서 hdisk1번 즉 나의 clone인 alt_disk에 boot image가 있는지 확인할 수 있습니다.

    [root@test_svr1:/]# bootlist -m normal hdisk0 hdisk1

    -> 지금은 single rootvg이므로 실질적으로 이렇게 사용하지 않게지만 만약을 대비하여 alt_disk로 복구를 하기 위해서 booting순서를 지정해 줍니다.

    [root@test_svr1:/]# bootlist -om normal
    hdisk0 blv=hd5 pathid=0
    hdisk1 blv=hd5 pathid=1

    ->hdisk0번 primary hdisk1이 secondary의 디스크 임을 나타냅니다.

    [root@test_svr1:/]# 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 34 34 1 open/syncd N/A
    hd8 jfs2log 1 1 1 open/syncd N/A
    ...(생략)
    hd1 jfs2 8 8 1 open/syncd /home
    hd10opt jfs2 20 20 1 open/syncd /opt
    hd11admin jfs2 4 4 1 open/syncd /admin
    lg_dumplv sysdump 16 16 1 open/syncd N/A
    livedump jfs2 1 1 1 open/syncd /var/adm/ras/livedump
    ptflv jfs2 52 52 1 open/syncd /ptf

    ->rootvg안에 속해있는 LV의 항목들을 확인하도록 합니다.

    [root@test_svr1:/]# lsvg -l altnist_rootvg
    0516-306 : Unable to find volume group altnist_rootvg in the Device
    Configuration Database.

    -> altinst_rootvg의 내용을 보기위해서 똑같이 clone복제를 하기 위해서 확인을 했지만 불가능한 상태입니다. active상태가 아니기 때문입니다.

    [root@test_svr1:/]# lsvg -l altinst_rootvg
    0516-010 : Volume group must be varied on; use varyonvg command.

    ->varyonvg명령어를 통해서 vg를 활성화 시키라는 호출을 뿌리게 됩니다.

    [root@test_svr1:/]# alt_disk_install -W hdisk1
    +-----------------------------------------------------------------------------+
    ATTENTION: calling new module /usr/sbin/alt_rootvg_op. Please see the alt_rootvg_op man page
    and documentation for more details.
    Executing command: {/usr/sbin/alt_rootvg_op -W -d hdisk1}
    +-----------------------------------------------------------------------------+
    Waking up altinst_rootvg volume group ...

    -> altinst_rootvg를 -W 옵션을 주어 잠시 깨워주었다는 의미로 현재 OS 상에서 복제한 alt_disk의 파일 시스템을 확인할 수 있습니다.

    [root@test_svr1:/]# lspv
    hdisk0 00008492ef481bbc rootvg active
    hdisk1 00c5c6d788d2c92f altinst_rootvg active

    -> altinst_rootvg가 wake-up 되면서 현재 OS에서 hdisk1번으로 active의 상태가 된것을 확인할 수 있습니다.

    [root@test_svr1:/]# lsvg -l altinst_rootvg
    altinst_rootvg:
    LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
    alt_hd5 boot 1 1 1 closed/syncd N/A
    alt_hd6 paging 34 34 1 closed/syncd N/A
    alt_hd8 jfs2log 1 1 1 open/syncd N/A
    alt_hd4 jfs2 8 8 1 open/syncd /alt_inst
    alt_livedump jfs2 1 1 1 open/syncd /alt_inst/var/adm/ras/livedump
    ...(생략)
    alt_ptflv jfs2 52 52 1 open/syncd /alt_inst/ptf

    -> lsvg -l rootvg 와 lsvg -l altinst_rootvg의 lv 및 fs의 정보가 복제가 된 상태로 똑같은 것을 볼 수 있습니다.

    [root@test_svr1:/]# alt_disk_install -S hdisk1
    +-----------------------------------------------------------------------------+
    ATTENTION: calling new module /usr/sbin/alt_rootvg_op. Please see the alt_rootvg_op man page
    and documentation for more details.
    Executing command: {/usr/sbin/alt_rootvg_op -S hdisk1}
    +-----------------------------------------------------------------------------+
    Putting volume group altinst_rootvg to sleep ...
    forced unmount of /alt_inst/var/adm/ras/livedump
    forced unmount of /alt_inst/var/adm/ras/livedump
    forced unmount of /alt_inst/var
    forced unmount of /alt_inst/var
    forced unmount of /alt_inst/usr
    ...(생략)
    forced unmount of /alt_inst
    forced unmount of /alt_inst
    Fixing LV control blocks...
    Fixing file system superblocks...

    ->wake-up을 진행한 alt_disk를 깨운상태에서 확인 후 다시 sleep 시키기 위해 -S옵션을 통해서 alt_disk의 fs들을 강제로 force umount 하고 있습니다.

    [root@test_svr1:/]# lspv
    hdisk0 00008492ef481bbc rootvg active
    hdisk1 00c5c6d788d2c92f altinst_rootvg

    -> active의 상태가 없어진것을 확인할 수 있습니다.

    [root@test_svr1:/]# alt_disk_install -X
    +----------------------------------------------------------------------------+
    ATTENTION: calling new module /usr/sbin/alt_rootvg_op. Please see the alt_rootvg_op man page
    and documentation for more details.
    Executing command: {/usr/sbin/alt_rootvg_op -X }
    +-----------------------------------------------------------------------------+
    Bootlist is set to the boot disk: hdisk0 blv=hd5

    ->alt_disk를 제거 하기 위해서 -X옵션을 통해서 제거를 하였습니다. 제거를 하면서 기존 bootlist에 잡혀있던 hdisk1번의 hd5부팅 이미지에 대한 호출이 보이네요. 보통 제거하는 옵션을 쓰는 옵션을 사용할 경우 disk교체 및 백업용으로 할 때 많이 사용을 하고 있습니다.

    [root@test_svr1:/]# bootlist -om normal
    hdisk0 blv=hd5 pathid=0
    hdisk0 blv=hd5 pathid=1

    ->hdisk1번의 booting순서가 리스트에서 빠진것을 볼 수 있습니다.

    [root@test_svr1:/]# lspv
    hdisk0 00008492ef481bbc rootvg active
    hdisk1 00c5c6d788d2c92f None

    ->hdisk1번에서 None으로 처음과 같은 상태로 원복된것을 확인할 수 있습니다.

     

    PS. 포스팅의 내용은 제 기준으로 작성한 것이기 때문에 참고해서 보시면 감사하겠습니다.

    포스팅 과정의 오류 및 오타 그리고 궁금한 점에 대해서는 댓글 남겨주세요.

    반응형

    댓글

Designed by Tistory.