반응형

1. 고려사항

  • rootvg(OS영역)의 백업 및 복구는 mksysb 명령어를 통해, 데이터를 백업 및 복구가 가능하다.
  • 하지만, 일반 볼륨(User-defined VG, 데이터영역)의 백업 및 복구를 위해서는 savevg / restvg를 통해, 백업 및 복구를 할 수 있다.※ 단, JFS 혹은 JFS2 형태의 파일시스템 정보만 백업 / 복구가 가능하다.

      ※ Raw device 형태의 LV(Logical volume)은 백업되지 않는다.


2. savevg tape images

  • mksysb 형태처럼, savevg로 생성된 이미지는 부팅가능한 형태로 만들수 없다.
  • 테입 혹은 파일형태로 저장할 수 있으며, savevg로 생성한 이밎는 백
  • 하지만, 일반 볼륨(User-defined VG, 데이터영역)의 백업 및 복구를 위해서는 savevg / restvg를 통해, 백업 및 복구를 할 수 있다.※ 단, JFS 혹은 JFS2 형태의 파일시스템 정보만 백업 / 복구가 가능하다.

      ※ Raw device 형태의 LV(Logical volume)은 백업되지 않는다.


3. VG 백업

  0) 테스트 환경

 
OSLEVEL : AIX 7.2 TL04 SP02
테스트 목적 : VG BAckup & Restore
테스트 환경
 
*/ Physical Disk information /*
[backup:root] /nim_backup] lspv
hdisk0          00c48b55df91a7eb                    rootvg          active      
hdisk1          00c48b55ecd138f4                    testvg          active  
 
*/ Filesystem information /*
[backup:root] /nim_backup] df -gP
Filesystem    GB blocks      Used Available Capacity Mounted on
/dev/hd4           1.00      0.36      0.64      37/
/dev/hd2           5.00      3.01      1.99      61/usr
/dev/hd9var        0.41      0.26      0.15      64/var
/dev/hd3           1.00      0.00      1.00       1/tmp
/dev/hd1          10.00      0.23      9.77       3/home
/proc                 -         -         -       - /proc
/dev/livedump      0.25      0.00      0.25       1/var/adm/ras/livedump
/dev/test_lv       1.00      0.00      1.00       1/nim_backup      
 
*/ Filesystem 내의 파일 /*
[backup:root] /nim_backup] cd /nim_backup
[backup:root] /nim_backup] ls -lrt
total 8
-rw-r--r--    1 root     system            8 Mar 07 11:35 backup_vg_test
drwxr-xr-x    2 root     system          256 Mar 07 11:45 lost+found
 
*/ Filesystem 내의 backup_vg_test /*
[backup:root] /nim_backup] cat backup_vg_test
save me
 
 
 
 

  1) SMIT : VG 백업

  #smitty 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
                                   Back Up a Volume Group to Tape/File or UDFS capable media
 
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
 
                                                        [Entry Fields]
    WARNING:  Execution of the savevg command will
              result in the loss of all material
              previously stored on the selected
              output medium.
 
* Backup DEVICE or FILE                              [/dev/rmt0]      << Backup device 혹은 파일    
* VOLUME GROUP to back up                            [testvg]         << Backup할 VG name      
 List files as they are backed up?                   no
 Generate new vg.data file?                          yes
 Create MAP files?                                   no                                                                        
  Create backup using snapshots?                      no                                                                         
  EXCLUDE files?                                      no                                                                         
  Location of File System Exclusion List             []                                                                          
  EXPAND /tmp if needed?                              no                                                                         
  Disable software packing of backup?                 no                                                                         
  Backup extended attributes?                         yes                                                                        
  Number of BLOCKS to write in a single output       []                                                                          
     (Leave blank to use a system default)
  Verify readability if tape device?                  no                                                                        
 Back up Volume Group information files only?        no                                                                        
 Back up encrypted files?                            yes                                                                       
 Back up DMAPI filesystem files?                     yes               
 
 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
Command: OK            stdout: yes           stderr: no
 
Before command completion, additional instructions may appear below.
 
 
Creating information file for volume group testvg.
 
Creating list of files to back up.
 
Backing up 9 files
 
9 of 9 files (100%)
0512-038 savevg: Backup Completed Successfully.
 

 

  2) 백업 확인

  #smitty lsbackvg

 
                                                List Files in a Volume Group Backup
 
Type or select values in entry fields.       
Press Enter AFTER making all desired changes.
 
* DEVICE or FILE                                   [/dev/rmt0]                                                             
  Number of BLOCKS to read in a single input       []                                                                      
     (Leave blank to use a system default)
  Verify BLOCK size if tape device?                no                                                               
 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
                                                           COMMAND STATUS
 
Command: OK            stdout: yes           stderr: no
 
Before command completion, additional instructions may appear below.
 
New volume on /dev/rmt0:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Fri Mar 12 22:00:32 KORST 2021
Files are backed up by name.
The user is root.
          11 ./tmp/vgdata/testvg/image.info
         127 ./tmp/vgdata/vgdata.files7602182
         127 ./tmp/vgdata/vgdata.files
        2301 ./tmp/vgdata/testvg/filesystems
        2587 ./tmp/vgdata/testvg/testvg.data
         358 ./tmp/vgdata/testvg/backup.data
           0 ./nim_backup
           8 ./nim_backup/backup_vg_test
           0 ./nim_backup/lost+found
The total size is 5519 bytes.
The number of archived files is 9.                                                        
cs

4. 복구

  • 복구 테스트를 위해, /nim_backup/backup_vg_test 파일 삭제.
  • 기존 testvg 내의 filesystem umount / varyoffvg / exportvg를 수행해준다.
  • 복구가 완료되면, 해당 VG는 자동 varyon / mount까지 자동으로 수행된다.

 

  1) 백업 복구

  #smitty restvg

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
                                                       Remake a Volume Group
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
                                                        [Entry Fields]
* Restore DEVICE or FILE                             [/dev/rmt0]                                                              
  SHRINK the filesystems?                             no                                                                         
  Recreate logical volumes and filesystems only?      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 file                             []                                                                           
     (Leave blank to use vg.data stored in
      backup image)
 
 

 

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
Command: OK            stdout: yes           stderr: no
Before command completion, additional instructions may appear below.
Will create the Volume Group:   testvg
Target Disks:   hdisk1
Allocation Policy:
        Shrink Filesystems:     no
        Preserve Physical Partitions for each Logical Volume:   no
testvg
test_lv
loglv00
New volume on /dev/rmt0:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Fri Mar 12 22:00:32 KORST 2021
Files are backed up by name.
The user is root.
x           11 ./tmp/vgdata/testvg/image.info
x          127 ./tmp/vgdata/vgdata.files7602182
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.
The number of restored files is 9.
 
 

 

  2) 복구 확인

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[backup:root] /] lsvg -o
testvg
rootvg
 
[backup:root] /] df -gP
Filesystem    GB blocks      Used Available Capacity Mounted on
/dev/hd4           1.00      0.36      0.64      37/
/dev/hd2           5.00      3.01      1.99      61/usr
/dev/hd9var        0.41      0.26      0.15      64/var
/dev/hd3           1.00      0.00      1.00       1/tmp
/dev/hd1          10.00      0.23      9.77       3/home
/proc                 -         -         -       - /proc
/dev/livedump      0.25      0.00      0.25       1/var/adm/ras/livedump
/dev/test_lv       1.00      0.00      1.00       1/nim_backup
 
[backup:root] /] ls -lrt /nim_backup/backup_vg_test 
-rw-r--r--    1 root     system            8 Mar 07 11:35 /nim_backup/backup_vg_test
 
[backup:root] /] cat /nim_backup/backup_vg_test    
save me
 
 
반응형

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

[AIX] VG 확장 (VG extend)  (0) 2024.08.01
[AIX] VG(Volume Group)에 남아있는 용량 확인하기  (0) 2024.07.31
Posted by 정병욱