UNIX/Redhat

lvm 확장 (lvextend)

99iberty 2020. 10. 5. 10:59

 

blog.naver.com/PostView.nhn?blogId=sunguru&logNo=220378207560&parentCategoryNo=&categoryNo=68&viewDate=&isShowPopularPosts=false&from=postView

 

CentOS 리눅스 LVM을 이용한 볼륨 용량 확장 [간단구성]

안녕하세요. 썬구루 입니다. 리눅스 LVM을 사용하여 볼륨을 만들어 사용한다고 가정을 했을 때 시간이 ...

blog.naver.com

lemontia.tistory.com/793

 

[centos7] LVM(Logical Volumn Manager) 확장

디스크 확인 fdisk -l ... Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum..

lemontia.tistory.com

 

이미 pv 만들어져 있어서 vgs에 들어가 있는 경우라면 아래 명령어만 치면 됨.

(azure에서 만든건 모두 gpt + xfs 이므로 아래 명령어 사용)

 


[PROD-root]zabbix01:/root#lvscan
  ACTIVE            '/dev/datavg/lv_data' [50.00 GiB] inherit
  ACTIVE            '/dev/datavg/lv_pgsql' [10.00 GiB] inherit
  ACTIVE            '/dev/datavg/lv_pgsql_data' [100.00 GiB] inherit
  ACTIVE            '/dev/datavg/lv_maxi55' [1.00 GiB] inherit
  ACTIVE            '/dev/datavg/lv_log' [30.00 GiB] inherit
  ACTIVE            '/dev/datavg/lv_maxi50' [2.00 GiB] inherit
  ACTIVE            '/dev/datavg/lv_docker' [20.00 GiB] inherit
[PROD-root]zabbix01:/root#lvextend -L +70G /dev/datavg/lv_log
  Size of logical volume datavg/lv_log changed from 30.00 GiB (7680 extents) to 100.00 GiB (25600 extents).
  Logical volume datavg/lv_log successfully resized.
[PROD-root]zabbix01:/root#lvscan
  ACTIVE            '/dev/datavg/lv_data' [50.00 GiB] inherit
  ACTIVE            '/dev/datavg/lv_pgsql' [10.00 GiB] inherit
  ACTIVE            '/dev/datavg/lv_pgsql_data' [100.00 GiB] inherit
  ACTIVE            '/dev/datavg/lv_maxi55' [1.00 GiB] inherit
  ACTIVE            '/dev/datavg/lv_log' [100.00 GiB] inherit
  ACTIVE            '/dev/datavg/lv_maxi50' [2.00 GiB] inherit
  ACTIVE            '/dev/datavg/lv_docker' [20.00 GiB] inherit

 

이 뒤에 df -h 하면 파일시스템은 아직 확장이 안된걸 알 수 있다.

아래 명령어 전후로 df -h 로 정상적으로 확장됐는지 확인하자

 

[PROD-root]zabbix01:/root#xfs_growfs /dev/datavg/lv_log
meta-data=/dev/mapper/datavg-lv_log isize=512    agcount=4, agsize=1966080 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=7864320, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=3840, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 7864320 to 26214400