df가 아닌 fdisk를 사용하여 볼륨 크기 늘리기

df가 아닌 fdisk를 사용하여 볼륨 크기 늘리기

/dev/mapper/centos-root에서 여유 디스크 공간을 늘리려고 하는데 왜 df -h가 증가된 크기를 보고하지 않는지 잘 모르겠습니다.

$ sudo fdisk -l

Disk /dev/sda: 68.7 GB, 68719476736 bytes, 134217728 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000a12e4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   132120575    65547264   8e  Linux LVM

Disk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-root: 64.6 GB, 64634224640 bytes, 126238720 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

비교적:

$ df -h
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   18G   13G  4.8G  73% /
devtmpfs                 906M     0  906M   0% /dev
tmpfs                    914M     0  914M   0% /dev/shm
tmpfs                    914M  8.6M  906M   1% /run
tmpfs                    914M     0  914M   0% /sys/fs/cgroup
/dev/sda1                497M  140M  357M  29% /boot
.host:/                  465G  432G   34G  93% /mnt/hgfs
.host:/-vagrant          465G  432G   34G  93% /vagrant
.host:/-etc-bolt         465G  432G   34G  93% /etc/bolt

fdisk 명령에는 다음이 있습니다: Disk /dev/mapper/centos-root: 64.6 GB, 64634224640 bytes, 126238720 sectors df -h 명령에는 다음이 있습니다: /dev/mapper/centos-root 18G 13G 4.8G 73% /

답변1

이것은 나를 위해 문제를 해결했습니다.

sudo xfs_growfs /dev/mapper/centos-root

관련 정보