ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • IBM AIX cplv 작업
    System of Infra/Unix System 2020. 5. 6. 21:38
    반응형

     

    AIX로고이미지

    IBM AIX cplv 작업

    #시나리오#

    datavg -> rootvg로 데이터 복제 후 복구 방식 작업으로 진행

    [root@test_svr1:/]# mkvg -S -y CPLV_VG -s 256 hdisk1
    0516-1254 mkvg: Changing the PVID in the ODM.
    CPLV_VG

    -> 방법 1. hdisk1번에 CPLV_VG를 한 개  명령어로 생성해주었습니다. 왜냐하면 rootvg에 cplv를 테스트하기 위해서 다른 vg를 생성해 준 것입니다.

    [root@test_svr1:/]smit vg
    Add a Volume Group->(선택)
    Add a Scalable Volume Group
    
    VOLUME GROUP name [CPLV_VG]
    Physical partition SIZE in megabytes 256
    * PHYSICAL VOLUME names [hdisk1]
    Force the creation of a volume group? yes 
    Activate volume group AUTOMATICALLY yes
    Max Logical Volumes 1024
    
    Command: OK            stdout: yes           stderr: no
    Before command completion, additional instructions may appear below.
    CPLV_VG

    -> 방법 2. hdisk1번에 CPLV_VG를 한 개  smit으로 생성해주었습니다.

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

    -> hdisk1번에 CPLV_VG라는 볼륨 그룹이 한 개 생성된 것을 확인할 수 있습니다.

    [root@test_svr1:/]# lsvg CPLV_VG
    VOLUME GROUP:       CPLV_VG                  VG IDENTIFIER:  00c5c6d700004c00000001719d5b137d
    VG STATE:           active                   PP SIZE:        256 megabyte(s)
    VG PERMISSION:      read/write               TOTAL PPs:      399 (102144 megabytes)
    MAX LVs:            256                      FREE PPs:       399 (102144 megabytes)
    LVs:                0                        USED PPs:       0 (0 megabytes)
    OPEN LVs:           0                        QUORUM:         2 (Enabled)
    TOTAL PVs:          1                        VG DESCRIPTORS: 2
    STALE PVs:          0                        STALE PPs:      0
    ACTIVE PVs:         1                        AUTO ON:        yes
    MAX PPs per VG:     32768                    MAX PVs:        1024
    LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
    HOT SPARE:          no                       BB POLICY:      relocatable
    MIRROR POOL STRICT: off                                      
    PV RESTRICTION:     none                     INFINITE RETRY: no
    DISK BLOCK SIZE:    512                      CRITICAL VG:    no
    FS SYNC OPTION:     no

    -> PP당 사이즈가 256MB로 만들어진 것을 명령어를 통해서 확인할 수 있습니다.

    [root@test_svr1:/]# mklv -y CP_LV -t jfs2 -e x CPLV_VG 5 hdisk1
    CP_LV

    -> CPLV_VG에 CP_LV라고 Logical volume을 생성합니다.

    [root@test_svr1:/]# lsvg -l CPLV_VG
    CPLV_VG:
    LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
    CP_LV               jfs2       5       5       1    closed/syncd  N/A

    -> CPLV_VG에 CP_LV가 생성된 것을 볼 수 있습니다. 하지만 현재 파일 시스템의 마운트가 되어 있지 않기 때문에 파일 시스템도 생성을 해주었습니다.

    [root@test_svr1:/]# smit jfs2
    Add an Enhanced Journaled File System on a Previously Defined Logical Volume->(선택)
    
    * LOGICAL VOLUME name CP_LV   
    * MOUNT POINT [/cp_fs]
    Mount AUTOMATICALLY at system restart?  yes
    
    Command: OK            stdout: yes           stderr: no
    Before command completion, additional instructions may appear below.
    ile system created successfully.
    1310476 kilobytes total disk space.
    New File System size is 2621440

    ->/cp_fs라는 파일 시스템을 한 개 생성해줍니다. 마운트는 서버가 재부팅이 되어도 자동으로 AUTO Mount 되도록 설정을 합니다.

    [root@test_svr1:/]# mount /cp_fs

    -> cpfs 파일 시스템을 mount를 해줍니다.

    [root@test_svr1:/]# df -tg | grep -i cp_fs
    /dev/CP_LV         1.25      0.00      1.25    1% /cp_fs

    -> cp_fs 파일 시스템이 마운트가 되었습니다. (용량 산정의 리스트로 보았을 때)

    [root@test_svr1:/]# lsvg -l CPLV_VG
    CPLV_VG:
    LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
    CP_LV               jfs2       5       5       1    open/syncd    /cp_fs
    loglv00             jfs2log    1       1       1    open/syncd    N/A

    -> cp_fs 파일 시스템이 마운트가 되었습니다. (lv의 리스트로 보았을 때)

    [root@test_svr1:/cp_fs]# touch 1; touch 2; touch 3

    -> 해당 경로에 touch의 파일들을  테스트의 용도를 위해서 3개 생성해주도록 합니다.

    [root@test_svr1:/cp_fs]# ls -al
    total 8
    drwxr-xr-x    3 root     system          256 Apr 23 18:48 .
    drwxr-xr-x   24 root     system         4096 Apr 23 18:46 ..
    -rw-r--r--    1 root     system            0 Apr 23 18:48 1
    -rw-r--r--    1 root     system            0 Apr 23 18:48 2
    -rw-r--r--    1 root     system            0 Apr 23 18:48 3
    drwxr-xr-x    2 root     system          256 Apr 23 18:46 lost+found

    -> touch 파일이 3개 생성된 것을 확인할 수 있습니다.

    [root@test_svr1:/cp_fs]# smit cplv
    Copy to a user created logical volume -> 선택
    
    * SOURCE logical volume name [CP_LV]         
    * DESTINATION logical volume to create [CP_LV2]
    * Destination VOLUME GROUP name [rootvg]
    
    Command: failed        stdout: yes           stderr: no
    Before command completion, additional instructions may appear below.
    0516-741 cplv: Source logical volume CP_LV is open.
    Unmount file system on this logical volume.

    ->cplv의 명령어를 통해서 현재 CPLV_VG에 있는 CP_LV를 CP_LV2라는 이름으로 rename을 통해 rootvg로 복사를 시켜주도록 합니다. 하지만 아까 마운트 되어 있는 파일 시스템으로 인해 실패를 하였기 때문에 umount 후에 작업을 해줍니다.

    ...(생략) umount 후에 다시 진행 완료
    Command: OK            stdout: yes           stderr: no
    Before command completion, additional instructions may appear below.
    cplv: Logical volume CP_LV successfully copied to CP_LV2 .

     

    -> umount 후에 cplv가 성공하였습니다.

    [root@test_svr1:/]# lsvg -l rootvg | grep -i CP_LV2
    CP_LV2              jfs2       5       5       1    closed/syncd  N/A

    -> rootvg안에 CP_LV2가 CP_LV2로 rename 되어서 생성된 것으로 볼 수 있습니다.

    [root@test_svr1:/]# cat /etc/filesystems
    /cp_fs:
            dev             = /dev/CP_LV
            vfs             = jfs2
            log             = /dev/loglv00
            mount           = true
            options         = rw
            account         = false

    -> /etc/filesystem의 dev영역이 CP_LV로 되어 있는 것을 볼 수 있습니다.

    [root@test_svr1:/]# cp filesystems filesystems_old

    -> /etc/filesystems를 bk로 백업을 진행합니다.

    [root@test_svr1:/etc]# ls -al | grep -i filesystems
    -rw-rw-r--    1 root     system         2378 Apr 23 19:05 filesystems
    -rw-r--r--    1 root     system         2381 Apr 23 19:01 filesystems_old

    -> filesystems_old로 변경이 되었습니다.

    [root@test_svr1:/etc]# vi /etc/filesystems
    /cp_fs:
            dev             = /dev/CP_LV2
            vfs             = jfs2
            log             = /dev/hd8
            mount           = true
            options         = rw
            account         = false

    ->  dev의 경로와 log의 경로를 변경된 LV에 cp_fs 파일 시스템을 마운트 해야 하기 때문에 위와 같이 변경을 해줍니다.

    [root@test_svr1:/]#mount /cp_fs
    [root@test_svr1:/]# lsvg -l rootvg | grep -i CP_LV2
    CP_LV2              jfs2       5       5       1    open/syncd  /cp_fs

    -> /cp_fs 파일시스템을 마운트하고 /cp_fs의 파일 시스템이 마운트 된 것을 확인합니다.

    [root@test_svr1:/]# df -tg | grep -i cp_fs
    /dev/CP_LV2        1.25      0.00      1.25    1% /cp_fs

    -> CP_LV2가 위치하고 있는 rootvg안에 cp_fs를 cplv를 통해서 이동시켜주고 마운트까지 한 모습입니다.

     

     

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

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

    반응형

    댓글

Designed by Tistory.