1

Goal: increase the size of a partition from 20 GB to 32 GB

I resized the disk using VBoxManage modifyhd ... --resize .... When I type VBoxManage list hdds, I can find the partition I resized and it's 32 GB in size (just how I wanted it). But when I start GParted in the VM to allocate the free space, it displays that my HDD is only 20 GB in size. How do I fix this?

OS: Windows 10

  • Screenshot from GParted

    Screenshot from GParted

  • output of ls -1 /dev/sd*

    $ ls -1 /dev/sd*
    /dev/sda
    /dev/sda1
    /dev/sda2
    /dev/sda5
    
  • Screenshot from VirtualBox

    Screenshot from VirtualBox

  • VBoxManage modifyhd ... --resize ... + results

    >VBoxManage modifyhd "C:\Users\mail\VirtualBox VMs\vm2\vm2.vda" --resize 32768
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    
  • output of lsblk

    $ lsblk
    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    loop0    7:0    0 800,4M  1 loop /snap/android-studio/91
    loop1    7:1    0   479M  1 loop /snap/clion/126
    loop2    7:2    0    55M  1 loop /snap/core18/1880
    loop3    7:3    0  55,3M  1 loop /snap/core18/1885
    loop4    7:4    0  97,1M  1 loop /snap/core/9993
    loop5    7:5    0 255,6M  1 loop /snap/gnome-3-34-1804/36
    loop6    7:6    0  30,3M  1 loop /snap/snapd/9279
    loop7    7:7    0  49,8M  1 loop /snap/snap-store/467
    loop8    7:8    0  62,1M  1 loop /snap/gtk-common-themes/1506
    loop9    7:9    0  29,9M  1 loop /snap/snapd/8790
    sda      8:0    0    20G  0 disk
    ├─sda1   8:1    0   512M  0 part /boot/efi
    ├─sda2   8:2    0     1K  0 part
    └─sda5   8:5    0  19,5G  0 part /
    sr0     11:0    1   366M  0 rom  /media/chris/GParted-live
    sr1     11:1    1  1024M  0 rom
    
  • output of VBoxManage showmediuminfo

C:\WINDOWS\system32>VBoxManage showmediuminfo "C:\Users\mail\VirtualBox VMs\vm2\vm2.vdi"
UUID:           9c95c78b-4016-4407-a5ae-478a5c3cd5fa
Parent UUID:    base
State:          locked read
Type:           normal (base)
Location:       C:\Users\mail\VirtualBox VMs\vm2\vm2.vdi
Storage format: VDI
Format variant: dynamic default
Capacity:       32768 MBytes
Size on disk:   7538 MBytes
Encryption:     disabled
Property:       AllocationBlockSize=1048576
In use by VMs:  vm2 (UUID: c3799a5b-c0fe-4bca-b333-21ce89dd8251) [Basic Installation 1 Python3.7 (UUID: 9732f164-51ab-4dd0-9a47-fb745d58ba05)]
Child UUIDs:    a7edd11a-2160-43ce-bea8-3e26f6563dc1
5
  • Please include a screenshot from GParted and output of ls -1 /dev/sd*.
    – gronostaj
    Sep 20, 2020 at 8:07
  • That's not what I expected to see. It looks like the disk didn't actually resize. Can you show exact commands that you're executing and their results?
    – gronostaj
    Sep 22, 2020 at 12:47
  • @gronostaj I added the screenshot of the command and a few more. At the moment I'm guessing it's the same problem as stated in this StackOverflow post. But I'm not sure Sep 22, 2020 at 20:31
  • Could you perhaps provide the output of running VBoxManage showmediuminfo against the disk image?
    – Daniel B
    Sep 23, 2020 at 7:19
  • 1
    Your virtual disk has a snapshot. That may interfere with resizing.
    – Daniel B
    Sep 23, 2020 at 7:40

2 Answers 2

0

Having multiple Snapshots stands in the way of resizing the partition. Delete all snapshots and resizing should work

GParted screenshot showing it works

GParted screenshot showing it works

-2

To resize one needs to boot the VM using a live image such as GParted Live

See Increase VirtualBox Disk Size

2
  • unfortunately, this didn't work. At step 4 of the post, after I executed lsblk in the terminal (see attached image), it showed I have 20 GB of storage in total, but if you check the screenshot from VirtualBox (also attached), you can see that I set the size to 32 GB Sep 22, 2020 at 20:27
  • -1 because you didn't even look at screenshots.
    – gronostaj
    Sep 23, 2020 at 6:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .