我最近将我的 VPS 的硬盘空间从 80 > 160gb 升级,但除了在 fdisks 中查看它时,它没有显示更改。
root@localhost:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 794M 1.2M 793M 1% /run
/dev/mapper/vg00-lv01 77G 31G 43G 43% /
tmpfs 3.9G 16K 3.9G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 456M 145M 278M 35% /boot
tmpfs 794M 0 794M 0% /run/user/0
root@localhost:~# fdisk /dev/sda
Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sda: 160 GiB, 171798691840 bytes, 335544320 sectors
Disk model: Virtual disk
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: 0x520f1760
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 999423 997376 487M 83 Linux
/dev/sda2 999424 335544286 334544863 159.5G 8e Linux LVM
我曾尝试使用 resize2fs 但我得到:
root@localhost:~# resize2fs /dev/mapper/vg00-lv01
resize2fs 1.45.5 (07-Jan-2020)
The filesystem is already 20345856 (4k) blocks long. Nothing to do!
我觉得我需要创建一个新分区才能做到这一点?
为了让我更困惑 vgdisplay 显示没有可用空间:
root@localhost:~# vgdisplay vg00
--- Volume group ---
VG Name vg00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <79.52 GiB
PE Size 4.00 MiB
Total PE 20357
Alloc PE / Size 20357 / <79.52 GiB
Free PE / Size 0 / 0
VG UUID ZRC0sL-qOeU-Uyfp-Qbo4-m06c-CwEt-xpFTsO