반응형

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)  (1) 2024.08.01
Posted by 정병욱