我在 VMware 上安装了 Ubuntu。之前的用户扩展了分区的大小(我相信是在启动模式下使用 GParted)。现在我收到有关根分区剩余可用空间的警告。不幸的是,除了磁盘使用工具外,它显示所有内容都是 80G。
> sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME FSTYPE SIZE MOUNTPOINT LABEL
loop0 squashfs 132,2M /snap/1password/66
loop1 squashfs 83,3M /snap/1password/61
loop2 squashfs 4K /snap/bare/5
loop3 squashfs 10,2M /snap/canonical-livepatch/104
loop4 squashfs 55,4M /snap/core18/2128
loop5 squashfs 10,2M /snap/canonical-livepatch/105
loop6 squashfs 208,4M /snap/code/75
loop7 squashfs 13M /snap/dmd/102
loop8 squashfs 216,3M /snap/code/76
loop9 squashfs 219M /snap/gnome-3-34-1804/72
loop10 squashfs 99,3M /snap/core/11743
loop11 squashfs 55,5M /snap/core18/2074
loop12 squashfs 167M /snap/gitkraken/182
loop13 squashfs 219M /snap/gnome-3-34-1804/66
loop14 squashfs 162,9M /snap/gnome-3-28-1804/145
loop15 squashfs 65,2M /snap/gtk-common-themes/1519
loop16 squashfs 65,1M /snap/gtk-common-themes/1515
loop17 squashfs 164,8M /snap/gnome-3-28-1804/161
loop18 squashfs 7M /snap/dub/53
loop19 squashfs 32,3M /snap/snapd/13170
loop20 squashfs 346,9M /snap/wine-platform-runtime/249
loop21 squashfs 322,8M /snap/wine-platform-6-stable/8
loop22 squashfs 61,4M /snap/prospect-mail/11
loop23 squashfs 303,1M /snap/wine-platform-5-stable/16
loop24 squashfs 126,6M /snap/slack/44
loop25 squashfs 303,1M /snap/wine-platform-5-stable/18
loop26 squashfs 51M /snap/snap-store/547
loop27 squashfs 168,1M /snap/postman/147
loop28 squashfs 32,4M /snap/snapd/13270
loop29 squashfs 51M /snap/snap-store/518
loop30 squashfs 5,5M /snap/notepad-plus-plus/292
loop31 squashfs 322,8M /snap/wine-platform-6-stable/5
loop32 squashfs 5,7M /snap/notepad-plus-plus/307
loop33 squashfs 127,2M /snap/slack/46
loop34 squashfs 99,4M /snap/core/11606
loop35 squashfs 346,9M /snap/wine-platform-runtime/250
loop36 squashfs 165,9M /snap/gitkraken/183
loop37 squashfs 168,1M /snap/postman/148
loop38 squashfs 64,9M /snap/prospect-mail/16
sda 80G
├─sda1 vfat 512M /boot/efi
├─sda2 1K
├─sda5 ext4 731M /boot
└─sda6 crypto_LUKS 78,8G
└─sda6_crypt LVM2_member 78,8G
├─vgubuntu-root ext4 77,8G /
└─vgubuntu-swap_1 swap 980M [SWAP]
sr0
答案1
看起来您的分区大约有 80GB,但您的文件系统大约有 30GB。如果您使用的是 ext4、ext3 或 ext2,则可以使用 resize2fs 命令轻松扩展文件系统。您正在使用 LVM,因此下面的指南应该可以解决您的问题。您只需执行 resize2fs 步骤,但那里还有许多其他命令可以帮助您了解机器上的 LVM 设置
https://www.tecmint.com/extend-and-reduce-lvms-in-linux/
由于这是执行重要的磁盘操作,因此您应该备份任何不能丢失的内容。