所以我有一台虚拟机,而我的客人缺少空间。所以我增加了它的 VM 磁盘大小,现在我希望它处理掉多余的空间。我已经使用 GParted(从来宾内部)扩展了分区并且它有点工作。我收到一条错误消息,但分区的大小确实增加了。cryptdata 具有正确的磁盘大小但 data-root 没有,我担心这是问题,但我不知道如何解决它。
这是 fdisk 和 df 的结果(我从 50GB 增加到 100GB):
15:34:16 ~$ sudo fdisk -l
[sudo] password for aho:
Disk /dev/sda: 100 GiB, 107374182400 bytes, 209715200 sectors
Disk model: VMware Virtual S
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: 0xb1032965
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 4096 1023998 1019903 498M 83 Linux
/dev/sda2 1024000 201326591 200302592 95.5G 83 Linux
/dev/sda3 201326592 209715199 8388608 4G 82 Linux swap / Solaris
Disk /dev/mapper/cryptdata: 95.51 GiB, 102538149888 bytes, 200269824 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/data-root: 45.5 GiB, 48846864384 bytes, 95404032 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
15:34:34 ~$ sudo df -h
Filesystem Size Used Avail Use% Mounted on
udev 5.8G 0 5.8G 0% /dev
tmpfs 1.2G 3.1M 1.2G 1% /run
/dev/mapper/data-root 45G 31G 12G 73% /
tmpfs 5.9G 4.0M 5.9G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 5.9G 0 5.9G 0% /sys/fs/cgroup
/dev/sda1 467M 332M 101M 77% /boot
vmhgfs-fuse 489G 293G 197G 60% /mnt/hgfs
tmpfs 1.2G 16K 1.2G 1% /run/user/110
tmpfs 1.2G 24K 1.2G 1% /run/user/1000
/dev/sr0 2.6G 2.6G 0 100% /media/aho/Pop_OS 20.10 amd64 Nvidia