简体   繁体   English

调整Virtualbox Ubuntu VM存储大小无法生效

[英]Resize Virtualbox Ubuntu VM storage not taking effect

I followed these instructions to resize my VirtualBox Ubuntu VM on Mac: http://osxdaily.com/2015/04/07/how-to-resize-a-virtualbox-vdi-or-vhd-file-on-mac-os-x/ 我按照以下说明在Mac上调整了VirtualBox Ubuntu VM的大小: http//osxdaily.com/2015/04/07/how-to-resize-a-virtualbox-vdi-or-vhd-file-on-mac-os -X/

This is after the change: 这是更改之后:

*****-M-D2KA:$ VBoxManage showhdinfo ~/VirtualBox\ VMs/P4_Runtime/P4_Runtime.vdi 
UUID:           ce0ccd77-f265-46cd-9679-e25e64f1c992
Parent UUID:    base
State:          locked read
Type:           normal (base)
Location:       /Users/*****/VirtualBox VMs/P4_Runtime/P4_Runtime.vdi
Storage format: VDI
Format variant: dynamic default
Capacity:       25000 MBytes
Size on disk:   9967 MBytes
Encryption:     disabled
In use by VMs:  P4_Runtime (UUID: 5ea52b11-997f-45d8-b7d6-effa37a3b649) [Snapshot 1 (UUID: 409c1035-2134-4532-a931-a29018d33dc6)]
Child UUIDs:    540ae750-5307-44ef-a313-95134ae353b7
                165fe99e-490d-4dd9-9602-00e3aaa8f82c

But for some reason, it does not seem to take effect: This is the "df -k" output in the VM, and I get "No space left on device" error: 但是由于某种原因,它似乎没有生效:这是VM中的“ df -k”输出,并且出现“设备上没有剩余空间”错误:

Filesystem     1K-blocks     Used  Available Use% Mounted on
/dev/sda        10253588  9713020          0 100% /

What am I missing? 我想念什么?

I found out what I missed. 我发现了我错过的一切。 I used gparted to resize the partition. 我用gparted来调整分区的大小。

Resizing the VHD doesn't change the size of the partition /dev/sda . 调整VHD的大小不会更改/dev/sda分区的大小。 You can run lsblk inside the guest to see the additional space. 您可以在来宾系统中运行lsblk以查看更多空间。 To get the extra space that is available in the guest OS, you may 为了获得来宾操作系统中可用的额外空间,您可以

  1. Use something like gparted as mentioned here . 使用此处提到的gparted之类的东西。 Instructions to do that on VHD can be found here . 有关在VHD上执行此操作的说明,请参见此处 Note that this might not be easiest, but you may be forced to if you plan to not move some of your mount points (Example if you're not ready to move /home/ to a new partition). 请注意,这可能并非最简单,但是如果您计划不移动某些安装点,则可能会被迫执行(例如,如果您尚不准备将/home/移至新分区,则为例)。
  2. Or, create a new partition, again instructions on how to do is present here . 或者,创建一个新分区, 此处再次提供有关操作的说明。 I would prefer this option over the first. 我会优先选择此选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM