在安装我的 centos stream 8 操作系统期间,我给 /var 设置了 10GB 的大小,我认为这已经足够了,但是在我开始使用 docker 之后,我发现它在 /var 分区上占用了太多空间,如下所示df 命令:
[root@compute-07 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 28G 0 28G 0% /dev
tmpfs 28G 0 28G 0% /dev/shm
tmpfs 28G 179M 28G 1% /run
tmpfs 28G 0 28G 0% /sys/fs/cgroup
/dev/mapper/cs-root 371G 8.2G 363G 3% /
/dev/mapper/cs-home 100G 2.0G 98G 2% /home
/dev/mapper/cs-var 10G 9.0G 1.1G 90% /var
/dev/sda2 2.0G 412M 1.6G 21% /boot
/dev/sda1 2.0G 7.3M 2.0G 1% /boot/efi
/dev/mapper/cs-tmp 10G 105M 9.9G 2% /tmp
tmpfs 5.5G 16K 5.5G 1% /run/user/42
overlay 10G 9.0G 1.1G 90%
/var/lib/docker/overlay2/77f74478297ca61595f0003d35c7323ec627adb44d94cef92c2b4a3c97319a66/merged
overlay 10G 9.0G 1.1G 90% /var/lib/docker/overlay2/5eeb399ce4a3c0d8065d63123985269a359fa66f4d20a8486326e466a48a0128/merged
overlay 10G 9.0G 1.1G 90% /var/lib/docker/overlay2/08d42ca66e3a5974bc305b502bca2aa4d22aa7ddcab6ea14c6af300b3abb3a70/merged
overlay 10G 9.0G 1.1G 90% /var/lib/docker/overlay2/1a45cb32b127fdf8f5c1483385139a865fdc69260ec20f3dcd4c56ad6890f909/merged
overlay 10G 9.0G 1.1G 90% /var/lib/docker/overlay2/ebb9af8edee824a4013dcd526e33e22272283bdee508fd43208fade557def728/merged
overlay 10G 9.0G 1.1G 90% /var/lib/docker/overlay2/41d55822108d04c85f348dc134fe6929b0e67f6b3bd7e0af147633bfd3a252c1/merged
overlay 10G 9.0G 1.1G 90% /var/lib/docker/overlay2/5cf3e8e06e9b4c2e6ed65164d91aed19f63d55e91524d6563e9f16b6709d29be/merged
overlay 10G 9.0G 1.1G 90% /var/lib/docker/overlay2/1d1eda94e68596b00d0cabcc75a7c91999a1c845ebd02c733bb9f00ac66a26f0/merged
overlay 10G 9.0G 1.1G 90% /var/lib/docker/overlay2/bc9e9a28c6761ad89a9457110642156ebd2b4d77de841f2a3ac9ffbaa90e4b63/merged
tmpfs 5.5G 0 5.5G 0% /run/user/0
这是 lsblk 命令的输出,因为 /var 在一个单独的分区中然后 / 和 /home 我找不到调整它的大小或创建另一个分区然后将它链接到 /var 的方法
[root@compute-07 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 558.4G 0 disk
├─sda1 8:1 0 2G 0 part /boot/efi
├─sda2 8:2 0 2G 0 part /boot
└─sda3 8:3 0 554.4G 0 part
├─cs-root 253:0 0 370.4G 0 lvm /
├─cs-swap 253:1 0 64G 0 lvm [SWAP]
├─cs-tmp 253:2 0 10G 0 lvm /tmp
├─cs-home 253:3 0 100G 0 lvm /home
└─cs-var 253:4 0 10G 0 lvm /var
sr0 11:0 1 1024M 0 rom
有什么办法可以在不丢失任何数据的情况下调整此分区的大小。