본문으로 바로가기
반응형

1. 디스크 정보 확인

[root@rhosp-tb0-test ~]#fdisk -l | grep "dev/vd" 
Disk /dev/vda: 128.8 GB, 128849018880 bytes, 251658240 sectors 
/dev/vda1   *        2048     2099199     1048576   83  Linux 
/dev/vda2         2099200   251658239   124779520   8e  Linux LVM 
Disk /dev/vdb: 53.7 GB, 53687091200 bytes, 104857600 sectors 

 

2. PV (Physical Volume) 정보 확인

[root@rhosp-tb0-test ~]#pvscan 
  PV /dev/vda2   VG rhel_director   lvm2 [<119.00 GiB / 0    free] 
  Total: 1 [<119.00 GiB] / in use: 1 [<119.00 GiB] / in no VG: 0 [0   ]

 

3. PV 생성

[root@rhosp-tb0-test ~]#pvscan 
  PV /dev/vda2   VG rhel_director   lvm2 [<119.00 GiB / 0    free] 
  PV /dev/vdb                       lvm2 [50.00 GiB] 
  Total: 2 [<169.00 GiB] / in use: 1 [<119.00 GiB] / in no VG: 1 [50.00 GiB] 

 

4. VG (Volume Group) 확장

[root@rhosp-tb0-test ~]#vgextend rhel_director /dev/vdb 
  Volume group "rhel_director" successfully extended 

 

5. LV (Logical Volume) 리사이징

[root@rhosp-tb0-test ~]#lvscan 
  ACTIVE            '/dev/rhel_director/swap' [12.00 GiB] inherit 
  ACTIVE            '/dev/rhel_director/root' [<107.00 GiB] inherit 
  
[root@rhosp-tb0-test ~]#lvextend -l +100%FREE -n /dev/rhel_director/root 
  Size of logical volume rhel_director/root changed from <107.00 GiB (27391 extents) to 156.99 GiB (40190 extents). 
  Logical volume rhel_director/root successfully resized. 

 

6. XFS 리사이징

[root@rhosp-tb0-test ~]#df -Th 
Filesystem                     Type      Size  Used Avail Use% Mounted on 
... 
/dev/mapper/rhel_director-root xfs       107G   46G   61G  43% / 

[root@rhosp-tb0-test ~]#xfs_growfs /dev/rhel_director/root 
meta-data=/dev/mapper/rhel_director-root isize=512    agcount=4, agsize=7012096 blks 
         =                       sectsz=512   attr=2, projid32bit=1 
         =                       crc=1        finobt=0 spinodes=0 
data     =                       bsize=4096   blocks=28048384, imaxpct=25 
         =                       sunit=0      swidth=0 blks 
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1 
log      =internal               bsize=4096   blocks=13695, version=2 
         =                       sectsz=512   sunit=0 blks, lazy-count=1 
realtime =none                   extsz=4096   blocks=0, rtextents=0 
data blocks changed from 28048384 to 41154560 

[root@rhosp-tb0-test ~]#df -h 
Filesystem                      Size  Used Avail Use% Mounted on 
...
/dev/mapper/rhel_director-root  157G   46G  111G  30% / 

 

728x90