Unable to expand vdisk size on windows10 for Ubuntu18.04, says parameter is incorrect

CCLearningComputer 5 Reputation points
2023-03-10T21:19:11.4633333+00:00

Hi, I followed this instruction to increase size of WSL 2 (which is Ubuntu 18.04). I checked the size by detail vdisk which says virtual size: 256GB and physical size around 180GB.

So it succeeded once, when I expand vdisk maximum=640000 in diskpart. It succeeded, so I exit from diskpart and lost the screenshot of its success. And I went inside Ubuntu to do the resize by sudo resize2fs /dev/sdb 640000M. The error says "The containing partition (or device) is only 67108864 (4k) blocks. You requested a new size of 16384000 blocks". So I went to diskpart and detail vdisk again. Now it says virtual size: 625GB and physical size 183GB.

I thought that means the vdisk have enough space for what I tried to do in Ubuntu? But the problem is when I do expand vdisk maximum=256000 (and many other values lower than 640,000) on diskpart, it still says parameter is incorrect.

Not sure what happened.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,559 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Limitless Technology 43,921 Reputation points
    2023-03-14T09:13:17.6933333+00:00

    Hello there,

    Please try the below steps and see if that helps

    -Open cmd or powershell as administrator

    diskpart

    select vdisk file=“<path to your visk>” (e.g. V:\store\my.vhd)

    list vdisk (you should now see your vdisk and the path)

    expand vdisk maximum=60000 (This is the size in megabytes of the size you want to extend, so 60000 is 60Gb)

    attach vdisk

    list disk

    list volume (take note of the Volume number of the your vdisk, you should see the old size)

    select volume 5 (or whatever volume number from list volume command)

    extend

    list volume

    detach vdisk

    exit

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--