设想
我从 proxmox 中的 kvm 扩展了磁盘空间。
错误地将 50 GB 扩展为 500GB
好吧,当我使用 vps 检查时dmesg | grep vdb
,fdisk -l /dev/vdb | grep ^/dev
我意识到我的错误
选择停止机器并使用以下命令进行磁盘缩减
lvreduce -L -400G /dev/lvm/vm-109-disk-1
WARNING: Reducing active logical volume to 800.00 GiB.
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lvm/vm-109-disk-1? [y/n]: and
Size of logical volume lvm/vm-109-disk-1 changed from 1.22 TiB (320000 extents) to 800.00 GiB (204800 extents).
Logical volume lvm/vm-109-disk-1 successfully resized.
现在,当我启动系统并像平常扩大磁盘时一样去工作时,我发现了不一致之处,这使得我无法修复实际空间。
通常为了扩展我执行以下操作(1 是分区增长)
parted /dev/vdb
(parted) print
(parted) resizepart 1 100%
(parted) quit
上一篇
pvresize /dev/vdb1
Physical volume "/dev/vdb1" changed
1 physical volume (s) resized or updated / 0 physical volume (s) not resized
但我发现自己没有改变
pvscan
PV / dev / vda2 VG lvm lvm2 [<24.51 GiB / 0 free]
PV / dev / vdb1 VG lvm lvm2 [<600.00 GiB / 0 free]
如果我尝试使用 parted 查看控制台中的状态并使用 LiveParted 启动 vps,我会遇到同样的错误
GNU Parted 3.1
Using / dev / vdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: Can't make partition off disk!
Model: Virtio Block Device (virtblk)
Disk / dev / vdb: 859GB
Sector size (logical / physical): 512B / 512B
Partition Table: unknown
Disk Flags:
Vps 运行正常但磁盘无法调整大小......