xfs扩容目录lvm
pve增加磁盘:
-bash-4.2# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 50G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 49G 0 part
├─centos-root 253:0 0 125.1G 0 lvm /
└─centos-swap 253:1 0 3.9G 0 lvm
sdb 8:16 0 20G 0 disk
└─centos-root 253:0 0 125.1G 0 lvm /
sdc 8:32 0 20G 0 disk
└─centos-root 253:0 0 125.1G 0 lvm /
sdd 8:48 0 40G 0 disk
└─centos-root 253:0 0 125.1G 0 lvm /
sde 8:64 0 80G 0 disk
sr0 11:0 1 4.4G 0 rom
-bash-4.2# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 7.9G 0 7.9G 0% /dev
tmpfs tmpfs 7.9G 0 7.9G 0% /dev/shm
tmpfs tmpfs 7.9G 736M 7.2G 10% /run
tmpfs tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root xfs 126G 126G 20K 100% /
/dev/sda1 xfs 1014M 199M 816M 20% /boot
tmpfs tmpfs 1.6G 0 1.6G 0% /run/user/0
overlay overlay 126G 126G 20K 100% /var/lib/docker/overlay2/59c298f4198a3d025223a30fe1c239bc3368e8dd05b0e867eb680c3dcb3b4f54/merged
-bash-4.2# ll /dev/sde
brw-rw---- 1 root disk 8, 64 Jan 10 19:38 /dev/sde
-bash-4.2# fdisk -l|grep sd
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Disk /dev/sdd: 42.9 GB, 42949672960 bytes, 83886080 sectors
Disk /dev/sdc: 21.5 GB, 21474836480 bytes, 41943040 sectors
Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 104857599 51379200 8e Linux LVM
Disk /dev/sde: 85.9 GB, 85899345920 bytes, 167772160 sectors
-bash-4.2#
-bash-4.2# pvcreate /dev/sde
Physical volume "/dev/sde" successfully created.
-bash-4.2# vgs
VG #PV #LV #SN Attr VSize VFree
centos 4 2 0 wz--n- 128.98g 0
-bash-4.2# vgextend centos /dev/sde
Couldn't create temporary archive name.
-bash-4.2# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 7.9G 0 7.9G 0% /dev
tmpfs tmpfs 7.9G 0 7.9G 0% /dev/shm
tmpfs tmpfs 7.9G 744M 7.2G 10% /run
tmpfs tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root xfs 126G 126G 20K 100% /
/dev/sda1 xfs 1014M 199M 816M 20% /boot
tmpfs tmpfs 1.6G 0 1.6G 0% /run/user/0
overlay overlay 126G 126G 20K 100% /var/lib/docker/overlay2/59c298f4198a3d025223a30fe1c239bc3368e8dd05b0e867eb680c3dcb3b4f54/merged
-bash-4.2# pwd
/root
-bash-4.2# du -sh *|grep G
8.2G anaconda3
-bash-4.2# du -sh *|grep M
9.1M apache-maven-3.6.3-bin.tar.gz
888M dbswitch
888M dbswitch.1.9.10
131M dify
121M dify.tar
257M images
102M mongodb-linux-x86_64-rhel70-4.0.27.tgz
8.1M mt-chat.log
330M mt-python.zip
-bash-4.2# pwd
/root
-bash-4.2# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b636448bfea3 ghcr.io/labring/fastgpt:v4.8.11 "sh -c 'node --max-o…" 2 months ago Up 4 weeks 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp fastgpt
-bash-4.2# ll /dbswitch
dbswitch1.9.10/ dbswitch2.0.0/
-bash-4.2# pwd
/root
-bash-4.2# rm -rf dbswitch
-bash-4.2# rm -rf dbswitch.1.9.10/
-bash-4.2# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 7.9G 0 7.9G 0% /dev
tmpfs tmpfs 7.9G 0 7.9G 0% /dev/shm
tmpfs tmpfs 7.9G 751M 7.2G 10% /run
tmpfs tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root xfs 126G 124G 1.7G 99% /
/dev/sda1 xfs 1014M 199M 816M 20% /boot
tmpfs tmpfs 1.6G 0 1.6G 0% /run/user/0
overlay overlay 126G 124G 1.7G 99% /var/lib/docker/overlay2/59c298f4198a3d025223a30fe1c239bc3368e8dd05b0e867eb680c3dcb3b4f54/merged
-bash-4.2# vgextend centos /dev/sde
Volume group "centos" successfully extended
-bash-4.2# vgdisplay|grep Free
Free PE / Size 20479 / <80.00 GiB
-bash-4.2# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos -wi-ao---- <125.11g
swap centos -wi-a----- <3.88g
You have new mail in /var/spool/mail/root
-bash-4.2#
-bash-4.2# lvdisplay|grep centos
LV Path /dev/centos/swap
VG Name centos
LV Path /dev/centos/root
VG Name centos
-bash-4.2# lvextend -l +100%free /dev/centos/root
Size of logical volume centos/root changed from <125.11 GiB (32028 extents) to <205.11 GiB (52507 extents).
Logical volume centos/root successfully resized.
-bash-4.2# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 7.9G 0 7.9G 0% /dev
tmpfs tmpfs 7.9G 0 7.9G 0% /dev/shm
tmpfs tmpfs 7.9G 751M 7.2G 10% /run
tmpfs tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root xfs 126G 124G 1.6G 99% /
/dev/sda1 xfs 1014M 199M 816M 20% /boot
tmpfs tmpfs 1.6G 0 1.6G 0% /run/user/0
overlay overlay 126G 124G 1.6G 99% /var/lib/docker/overlay2/59c298f4198a3d025223a30fe1c239bc3368e8dd05b0e867eb680c3dcb3b4f54/merged
-bash-4.2# xfs_growfs /dev/centos/root
meta-data=/dev/mapper/centos-root isize=512 agcount=12, agsize=2956800 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=32796672, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=5775, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 32796672 to 53767168
-bash-4.2# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 7.9G 0 7.9G 0% /dev
tmpfs tmpfs 7.9G 0 7.9G 0% /dev/shm
tmpfs tmpfs 7.9G 751M 7.2G 10% /run
tmpfs tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root xfs 206G 124G 82G 61% /
/dev/sda1 xfs 1014M 199M 816M 20% /boot
tmpfs tmpfs 1.6G 0 1.6G 0% /run/user/0
overlay overlay 206G 124G 82G 61% /var/lib/docker/overlay2/59c298f4198a3d025223a30fe1c239bc3368e8dd05b0e867eb680c3dcb3b4f54/merged
-bash-4.2# cat /etc/issue
\S
Kernel \r on an \m
-bash-4.2# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
-bash-4.2#
相关参考:linux增加磁盘扩容目录_linux 增加overlay 目录空间-CSDN博客