Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
themeEmacs
[root@vmhost ~]# qemu-img create -f qcow2 065_msgr_data.qcow2 50G
Formatting '065_msgr_data.qcow2', fmt=qcow2 size=53687091200 cluster_size=65536 lazy_refcounts=off refcount_bits=16ls


[root@centos ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda    252:0    0   50G  0 disk 
└─vda1 252:1    0  7.8G  0 part /


[root@centos ~]# growpart /dev/vda 1
CHANGED: partition=1 start=2048 old: size=16384000 end=16386048 new: size=104855519 end=104857567


[root@centos ~]# xfs_growfs -d /dev/vda1
meta-data=/dev/vda1              isize=512    agcount=4, agsize=512000 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1
data     =                       bsize=4096   blocks=2048000, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 2048000 to 13106939


[root@centos ~]# lsblk 
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda    252:0    0  50G  0 disk 
└─vda1 252:1    0  50G  0 part /




Code Block
# lsblk /dev/sda
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda       8:0    0  2.2G  0 disk
├─sda1    8:1    0  2.1G  0 part /
├─sda14   8:14   0    4M  0 part
└─sda15   8:15   0  106M  0 part /boot/efi

# mount | grep sda1
/dev/sda1 on / type ext4 (rw,relatime,discard,errors=remount-ro)

### oVirt 에서 디스크 확장
# lsblk /dev/sda
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda       8:0    0   20G  0 disk
├─sda1    8:1    0  2.1G  0 part /
├─sda14   8:14   0    4M  0 part
└─sda15   8:15   0  106M  0 part /boot/efi

### 파티션 확장
# growpart /dev/sda 1
CHANGED: partition=1 start=227328 old: size=4384735 end=4612063 new: size=41715679 end=41943007

# lsblk /dev/sda
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda       8:0    0   20G  0 disk
├─sda1    8:1    0 19.9G  0 part /
├─sda14   8:14   0    4M  0 part
└─sda15   8:15   0  106M  0 part /boot/efi

### 파일시스템은 그대로임
# df -h /dev/sda1
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       2.0G  1.6G  378M  82% /

### 파일시스템 확장
# resize2fs /dev/sda1
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/sda1 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 3
The filesystem on /dev/sda1 is now 5214459 (4k) blocks long.

# df -h /dev/sda1
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        20G  1.6G   18G   9% /