
私のCentOS 8システムには次のパーティションがあります。
[root@XXXXX]# fdisk -l
Disk /dev/sda: 80 GiB, 85899345920 bytes, 167772160 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
Disklabel type: dos
Disk identifier: 0xbccac24e
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 167768063 165668864 79G 8e Linux LVM
Disk /dev/mapper/cl-root: 76.5 GiB, 82137055232 bytes, 160423936 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/cl-swap: 2.5 GiB, 2684354560 bytes, 5242880 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
[root@XXXXX]#
/dev/mapper/cl-root
表示サイズは76.5GiBです。ただし、df -h
ルートディレクトリには22Gという別のサイズが表示されます。
[root@XXXXX]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 9.5M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mapper/cl-root 22G 22G 62M 100% /
/dev/sda1 976M 256M 654M 29% /boot
tmpfs 379M 1.2M 377M 1% /run/user/42
tmpfs 379M 4.6M 374M 2% /run/user/1000
[root@XXXXX]#
スペースが不足しているため、ルートファイルシステムを拡張する必要があります。私はそれを見つけることができません。合計の結果/dev/mapper/cl-root
は次のとおりです。pvdisplay
lsblk
[root@XXXXX]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name cl
PV Size <79.00 GiB / not usable 1.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 20223
Free PE 0
Allocated PE 20223
PV UUID XXXXXX-XXXX-XXXX-XXXX-XXXX-XXXXX-XXXXX
[root@XXXXX]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 80G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 79G 0 part
├─cl-root 253:0 0 76.5G 0 lvm /
└─cl-swap 253:1 0 2.5G 0 lvm [SWAP]
sr0 11:0 1 1024M 0 rom
[root@XXXXX]#
lvdisplay
次の出力が表示されます。
[root@XXXXX]# lvdisplay
--- Logical volume ---
LV Path /dev/cl/swap
LV Name swap
VG Name cl
LV UUID 000000000000000000000000000
LV Write Access read/write
LV Creation host, time localhost, 2020-01-29 21:17:47 -0500
LV Status available
# open 2
LV Size 2.50 GiB
Current LE 640
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
--- Logical volume ---
LV Path /dev/cl/root
LV Name root
VG Name cl
LV UUID 00000000000000000000000000
LV Write Access read/write
LV Creation host, time localhost, 2020-01-29 21:17:48 -0500
LV Status available
# open 1
LV Size <76.50 GiB
Current LE 19583
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
[root@XXXXX]#
CentOS 8を使用しています。私は何をすべきですか?
答え1
あなたのLVが/dev/cl/root
利用可能な最大サイズに達しました。必要なのは、ファイルシステムのサイズを変更することです。デフォルトオプションを使用する場合、xfs
コマンドは次のようになります。
xfs_growfs /
このコマンドは、xfs ボリュームを使用可能なすべてのスペースに拡張します。xfs
サイズは縮小できないことを忘れないでください。
を使用すると、xfs_growfs / -D size
拡張するサイズを指定できますが、これはMB / GBではなくファイルシステムブロックとして表されます。xfs_info
このコマンドはブロックサイズを表示します。
このコマンドは、LVサイズとxfsボリュームサイズの違いを確認するのに役立ちます。
lsblk -o name,fstype,size,fssize,mountpoint,label,model,vendor
また、pvs
LVM物理ボリューム、ボリュームグループ、および論理ボリュームがそれぞれよくまとめられていますvgs
。lvs