Centos partition 확장 (Extend) on VM
vm환경에서 디스크를 확장할 경우 VM콘솔에서 디스크 할당 영역을 확장 후 Linux의 콘솔에서 디스크를 확장합니다. 

0. VM콘솔에서 디스크 확장 및 저장
0.1. 혹시 모르니 재부팅

1. Linux의  물리 디스크 확장
1.1. parted 또는 fdisk 를 이용해서 확장

 – parted 
prmpt>parted ${target-partitne to extend}  
ex> prmpt>parted /dev/sda2
prmpt>p                  #print
prmpt>
resizepart 2  # resize

 – fdisk
prmpt>fdisk ${target-partitne to extend}  
ex> prmpt>fdisk /dev/sda2

2. 확장 확인
prmpt>e2fsck -f /dev/sda2

3. LVM 디스크 확장
3.1.  논리 영역 확인
prmpt>lvdisplay

3.2.  LVM 영역 확장
prmpt>lvresize -l +100%FREE ${TARGET}
ex> prmpt>lvresize -l +100%FREE /dev/cl/root

4.  논리 영역 확장
4.1. resizefs2 사용
xfs 타입일 경우 에러가 발생, xfs_growfs 사용

prmpt>resizefs2 -p ${LVM-TARGET}
ex> prmpt>resizefs2 -p /dev/cl/root

4.2.  xfs_growfs 사용
prmpt>xfs_growfs ${LVM-TARGET}
ex> prmpt>xfs_growfs /dev/cl/root

5. reboot

Leave a Reply

Your email address will not be published. Required fields are marked *