반응형

1. 개요

  • LVM에 대한 이해는 추후 포스팅하도록 하겠습니다.
  • 이 포스트는 jfs2 타입의 파일시스템을 명령어 기반으로 간편하게 생성하는 데, 기반을 둡니다.

2. JFS2타입의 1G 파일시스템 생성.

1) 파일시스템 생성단계  

  ▪ Volume Group 생성 (Physical Volume의 Group)

    ·  ex) hdisk1, hdisk2

  ▪  Volume Group 내의 Logical Volume 생성

  ▪  Logical Volume과 파일시스템 연결작업(Mount Point 생성)

 

2) VG 생성 명령어

  ▪  #mkvg -S -s 256 -y testvg hdisk1 hdisk2

    ·  -S : Scalable Volume group으로 생성.

    ·  -s : PP size를 256으로 지정

    ·  -y : Volume group 이름

    ·  hdisk1 hdisk2 : Volume group에 종족될 Physical Volume.  

      ※ 아래의 명령어는 "testvg" 볼륨그룹 생성정보.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[test_aix:root] /home] lsvg testvg
VOLUME GROUP:       testvg                   VG IDENTIFIER:  00c48b5500004c00000001784fc68bba
VG STATE:           active                   PP SIZE:        256 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      38 (9728 megabytes)
MAX LVs:            256                      FREE PPs:       33 (8448 megabytes)
LVs:                2                        USED PPs:       5 (1280 megabytes)
OPEN LVs:           2                        QUORUM:         2 (Enabled)
TOTAL PVs:          2                        VG DESCRIPTORS: 3
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         2                        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                                        
[test_aix:root] /home] lsvg -p testvg
testvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk1            active            19          15          04..00..03..04..04
hdisk2            active            19          18          04..03..03..04..04
 

 

2) LV 생성 명령어

  ▪  #mklv -t jfs2 -y test_lv testvg 1G

    ·  -t : 파일시스템 타입

    ·  -y : LV name

    ·  testvg : Volume group 이름

    ·  1G : 생성하고자 하는 용량

      ※ 아래의 명령어는 "test_lv" 생성 후, LV 생성정보.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[test_aix:root] /home] lsvg -l testvg
testvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
test_lv             jfs2       4       4       1    closed/syncd    N/A
loglv00             jfs2log    1       1       1    closed/syncd    N/A
[test_aix:root] /home] lslv test_lv
LOGICAL VOLUME:     test_lv                VOLUME GROUP:   testvg
LV IDENTIFIER:      00c48b5500004c00000001784fc68bba.1 PERMISSION:     read/write
VG STATE:           active/complete        LV STATE:       opened/syncd
TYPE:               jfs2                   WRITE VERIFY:   off
MAX LPs:            512                    PP SIZE:        256 megabyte(s)
COPIES:             1                      SCHED POLICY:   parallel
LPs:                4                      PPs:            4
STALE PPs:          0                      BB POLICY:      relocatable
INTER-POLICY:       minimum                RELOCATABLE:    yes
INTRA-POLICY:       middle                 UPPER BOUND:    1024
MOUNT POINT:        /test                  LABEL:          /test
DEVICE UID:         0                      DEVICE GID:     0
DEVICE PERMISSIONS: 432                                    
MIRROR WRITE CONSISTENCY: on/ACTIVE                              
EACH LP COPY ON A SEPARATE PV ?: yes                                    
Serialize IO ?:     NO                                     
INFINITE RETRY:     no                     PREFERRED READ: 0
DEVICESUBTYPE:      DS_LVZ                                        
COPY 1 MIRROR POOL: None                                   
COPY 2 MIRROR POOL: None                                   
COPY 3 MIRROR POOL: None  
 
 

 

3) Filesystem 생성

  ▪  #crfs -v jfs2 -d test_lv -m /test -A yes

    ·  -v : 파일시스템 타입

    ·  -d : LV name

    ·  -m : Filesystem mount point

    ·  -A : Filesystem Automount

 

4) 파일시스템 생성 전체 단계

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[test_aix:root] /home] lspv
hdisk0          00c48b55df91a7eb                    rootvg          active      
hdisk1          none                                None                        
hdisk2          none                                None                        
[test_aix:root] /home]    
[test_aix:root] /home] mkvg --256 -y testvg hdisk1 hdisk2
0516-1254 mkvg: Changing the PVID in the ODM. 
0516-1254 mkvg: Changing the PVID in the ODM. 
testvg
[test_aix:root] /home]    
[test_aix:root] /home] mklv -t jfs2 -y test_lv testvg 1G 
test_lv
[test_aix:root] /home]    
[test_aix:root] /home] crfs -v jfs2 -d test_lv -/test -A yes
File system created successfully.
1048340 kilobytes total disk space.
New File System size is 2097152
[test_aix:root] /home] mount /test
[test_aix:root] /home]    
[test_aix:root] /home] df -gP /test
Filesystem    GB blocks      Used Available Capacity Mounted on
/dev/test_lv       1.00      0.00      1.00       1/test
 

 

반응형

'LVM > FS' 카테고리의 다른 글

[AIX] 파일시스템 확장(Filesystem size increase)  (0) 2024.08.01
Posted by 정병욱

반응형

1. 고려사항

  • NIM Master에 복구하고자 하는 클라이언트의 "savevg" Resource가 있는지 확인필요.
  • NIM Server / Client 간의 네트워크 통신이 정상적인 상황인지 확인필요. (Network check)
  • NIM Server / Client 간의 NFS 통신이 정상적인지 확인필요. (NFS Communication Check)
  • NIM Server 에서 Client로 nimpush 프로세스를 이용하여, 복구가 진행된다.
  • 일반적인 restvg 복구절차와 동일하게, 복구하는 과정에서 "VG 생성 > LV 생성 > FS 생성 > 데이터복구" 가 발생하며, 복구한 VG 내의 파일시스템은 자동 마운트된다.

2. 확인

  1) 복구하고자 하는 클라이언트 Machine 상태확인.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[NIM_Master:root] /] lsnim -l lpar10
lpar10:
   class           = machines
   type            = standalone
   installed_image = 71_mksysb
   current_master  = NIM_Master
   connect         = shell
   sync_required   = yes
   platform        = chrp
   netboot_kernel  = 64
   if1             = net-pri lpar10 0
   cable_type1     = tp
   Cstate          = ready for a NIM operation
   prev_state      = unavailable for use
   Mstate          = ready for use
   cpuid           = 00C48B554C00
   Cstate_result   = success
 
  • Cstate 가 ready 상태이므로, NIM Remote opreation이 가능한 상태. 

2) 기존에 savevg로 백업받아놓은 Resource가 있는지 확인.

1
2
[NIM_Master:root] /] lsnim -c resources | grep -i savevg
lpar10_savevg_test     resources       savevg
 

3. 복구

  1) SMIT로 복구.

    #smitty nim > Perform NIM Administration Tasks > Manage Machines > Perform Operations on Machines > 복구 클라이언트 선택 > restvg 지정

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
______________________________________________________
l                              Target Name            l                    
l                                                     l                     
l Move cursor to desired item and press Enter.        l                     
l                                                     l                     
l   master          machines       master             l                     
l   lpar1           machines       standalone         l                     
l   lpar2           machines       standalone         l                     
l   lpar3           machines       standalone         l                     
l   lpar4           machines       standalone         l                     
l   lpar5           machines       standalone         l                     
l   lpar6           machines       standalone         l                     
l   lpar7           machines       standalone         l                     
l   lpar8           machines       standalone         l                     
l   lpar9           machines       standalone         l                     
l   lpar10          machines       standalone         l    << 복구 클라이언트 지정
l   NIM_Master      machines       alternate_master   l
l_____________________________________________________l                     
cs

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
____________________________________________________________________________
l                          Operation to Perform                            l
l                                                                          l
l  Move cursor to desired item and press Enter. Use arrow keys to scroll.  l 
l                                                                          l 
l     diag             = enable a machine to boot a diagnostic image       l
l     cust             = perform software customization                    l
l     bos_inst         = perform a BOS installation                        l
l     maint            = perform software maintenance                      l
l     reset            = reset an object's NIM state                       l
l     fix_query        = perform queries on installed fixes                l
l     check            = check the status of a NIM object                  l
l     reboot           = reboot specified machines                         l
l     maint_boot       = enable a machine to boot in maintenance mode      l
l     showlog          = display a log in the NIM environment              l
l     lppchk           = verify installed filesets                         l
l     restvg           = perform a restvg operation                        l << restvg 선택
l     linux_inst       = operation to install Linux onto a standalone      l
l     lswpar           = show the characteristics of a workload partition  l
l     syncwpar         = synchronize workload partition software with the  l
l     showdump         = Show the location of a client dump                l
l     snap             = collect a snap record from a client               l
l     update_all = update all currently installed filesets                 l
l__________________________________________________________________________l                                                                         
 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
        Perform Network Restore of a Volume Group
 
Type or select values in entry fields.      
Press Enter AFTER making all desired changes.
                               
                                                        [Entry Fields]
  Target Name                                         lpar10
* SAVEVG                                             [lpar10_savevg_test] << F4를 눌러, 백업한 savevg 파일 선택
  SHRINK the filesystems?                             no
 PHYSICAL VOLUME names                              [hdisk1] << 클라이언트에 복구할 디스크 선택
     (Leave blank to use the PHYSICAL VOLUMES listed
      in the vgname.data file in the backup image)
  Use existing MAP files?                             yes
  Physical partition SIZE in megabytes               []
     (Leave blank to have the SIZE determined
      based on disk size)
  Number of BLOCKS to read in a single input         []
     (Leave blank to use a system default)
  Alternate vg.data resource                         []
     (Leave blank to use vg.data stored in
      backup image)
  Recreate logical volumes and filesystems only?      no
 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
                                                           COMMAND STATUS
 
Command: OK            stdout: yes           stderr: no
 
Before command completion, additional instructions may appear below.
 
hdisk1
testvg
test_lv
loglv00
x           11 ./tmp/vgdata/testvg/image.info
x          127 ./tmp/vgdata/vgdata.files8519888
x          127 ./tmp/vgdata/vgdata.files
x         2301 ./tmp/vgdata/testvg/filesystems
x         2587 ./tmp/vgdata/testvg/testvg.data
x          358 ./tmp/vgdata/testvg/backup.data
x            0 ./nim_backup
x            8 ./nim_backup/backup_vg_test
x            0 ./nim_backup/lost+found
The total size is 5519 bytes.
 
Will create the Volume Group:   testvg
Target Disks:   Allocation Policy:
        Shrink Filesystems:     no
        Preserve Physical Partitions for each Logical Volume:   no
 
New volume on /tmp/_nim_dir_7536766/mnt0:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Sun Mar 14 08:13:51 KORST 2021
Files are backed up by name.
The user is root.
The number of restored files is 9.
 
 

 

  2) CLI로 복구.

    #nim -o restvg -a savevg=lpar10_savevg_test -a disk=hdisk1 lpar10

  • savevg : 저장한 savevg resource name
  • disk    : 복구할 클라이언트의 hdisk number
  • lpar10 : 복구할 클라이언트의 Machine name

    

반응형

'NIM > NIM Backup_Restore' 카테고리의 다른 글

[AIX, NIM] NIM 백업/복구 실패 [0042-172]  (0) 2024.07.31
NIM Mksysb backup  (0) 2021.03.22
NIM 서버에서 Non-rootvg Backup  (0) 2021.03.13
Posted by 정병욱

반응형

1. 고려사항

  • 이 문서는 기존에 NIM Server / Client 구성이 되어있다는 가정하에 작성된 문서입니다.
  • NIM Master에 백업하고자하는 Client의 Machine 등록 및 네트워크 통신이 정상적인 상태라는 가정.

2. NIM 서버를 이용한 Non-rootvg 백업 - SMIT

  • NIM Machine 등록확인 및 상태체크
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[NIM_Master:root] /export/lpar10] lsnim -l lpar10
lpar10:
   class           = machines
   type            = standalone
   installed_image = 71_mksysb
   current_master  = NIM_Master
   connect         = shell
   sync_required   = yes
   platform        = chrp
   netboot_kernel  = 64
   if1             = net-pri lpar10 0
   cable_type1     = tp
   Cstate          = ready for a NIM operation
   prev_state      = not running
   Mstate          = currently running
   cpuid           = 00C48B554C00
   Cstate_result   = success
 

          º Cstate 는 NIM Client의 상태를 나타내며, 현재 상태는 "ready 상태"이므로, 바로, Backup이 가능하다.

 

  • NIM Client인 "lpar10" 의 testvg 백업.

          º #smitty nim_mkres > savevg

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
                                                         Define a Resource
 
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
 
                                                        [Entry Fields]
* Resource Name                                      [lpar10_savevg_test] << savevg 리소스이름
* Resource Type                                       savevg
* Server of Resource                                 [master]
* Location of Resource                               [/export/lpar10/testvg] << 저장위치 [/export/lpar10에 해당하는 디렉토리는 반드시 있어야한다.]
  NFS Client Security Method                         []
  NFS Version Access                                 []
  Use exclude_packing.rootvg file?                    no
  Comments                                           []
  
  Source for Replication                             []
                  -OR-                                                                                                              
  System Backup Image Creation Options:
    CREATE volume group backup image?                 yes
   NIM CLIENT containing volume group to backup     [lpar10] << 백업받고자하는 클라이언트 이름
   VOLUME GROUP to backup                           [testvg] << 해당클라이언트의 VG Name
    PREVIEW only?                                     no
    IGNORE space requirements?                        no 
    EXPAND /tmp if needed?                            no
    Backup extended attributes?                       yes
    Generate new VG.DATA file?                        yes
    Create MAP files?                                 no
    Number of BLOCKS to write in a single output     []
     (leave blank to use system default)                                                                                            
    Use local EXCLUDE file?                           no
     (specify no to include all files in backup)                                                                                    
                  -OR-                                                                                                              
    EXCLUDE_FILES resource                           []
     (leave blank to include all files in backup)                                                                                   
  Back up Volume Group information files only?        no
   Create backup using snapshots?                     yes
    Backup encrypted files?                           yes
    Backup DMAPI filesystem files?                    yes
  Disable software packing of backup?                 no
 
 

 

  • "lpar10"의 testvg 백업 완료.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
                                                           COMMAND STATUS
 
Command: OK            stdout: yes           stderr: no
 
Before command completion, additional instructions may appear below.
 
 
+---------------------------------------------------------------------+
                System Backup Image Space Information
              (Sizes are displayed in 1024-byte blocks.)
+---------------------------------------------------------------------+
 
Required = 493 (1 MB)    Available = 88264352 (86196 MB)
 
 
 
Creating information file for volume group testvg.
 
Creating snapshots.
 
Creating list of files to back up.
.
Backing up 9 files
 
9 of 9 files (100%)
0512-038 savevg: Backup Completed Successfully.
 

 

  • 완료된 savevg resource 확인
1
2
3
4
[NIM_Master:root] /] lsnim -c resources |grep -i savevg
savevg_test            resources       savevg
test_savevg            resources       savevg
lpar10_savevg_test     resources       savevg << 생성됨.
 

 

 

반응형

'NIM > NIM Backup_Restore' 카테고리의 다른 글

[AIX, NIM] NIM 백업/복구 실패 [0042-172]  (0) 2024.07.31
NIM Mksysb backup  (0) 2021.03.22
NIM 서버에서 Non-rootvg Restore  (0) 2021.03.14
Posted by 정병욱