1、虚拟机关机通过管理界面给磁盘扩容。
root@curtis:/home/curtis/git_code# pvdisplay
--- Physical volume ---
PV Name /dev/vda3
VG Name ubuntu-vg
PV Size <239.00 GiB / not usable 0
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 61183
Free PE 0
Allocated PE 61183
PV UUID WoCzb3-a3jy-yV23-gOau-UeiA-K62x-petsV2
2、虚拟机启动之后查看磁盘容量,并且使用gparted更新分区表。
root@curtis:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
vda 252:0 0 512G 0 disk
├─vda1 252:1 0 1M 0 part
├─vda2 252:2 0 1G 0 part /boot
└─vda3 252:3 0 239G 0 part
└─ubuntu--vg-ubuntu--lv 253:0 0 239G 0 lvm /
root@curtis:~# parted /dev/vda
GNU Parted 3.2
Using /dev/vda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Warning: Not all of the space available to /dev/vda appears to be used, you can fix the GPT to use all of the space (an extra 570425344 blocks) or continue with
the current setting?
Fix/Ignore? Fix
Model: Virtio Block Device
Ubuntu虚拟机磁盘扩容操作指南

最低0.47元/天 解锁文章
2400

被折叠的 条评论
为什么被折叠?



