How do I expand the virtual disk space of the WSL2 in Docker?

Viewed 491

Due to an increasing database size in the local docker environments in my work project, I have been attempting to increase the maximum size of the virtual disk space of WSL2 for Docker from 256Gb to 512Gb. I have found this guide: https://docs.microsoft.com/en-us/windows/wsl/compare-versions#expanding-the-size-of-your-wsl-2-virtual-hard-disk which has proven very useful, but when attempting to increase the size of the devtmpfs filesystem in the Ubuntu subsystem I get the error:

root@PF2DR8H0:~# sudo mount -t devtmpfs none /dev
mount: /dev: unknown filesystem type 'devtmpfs'.

I managed this error by using 'df -h':

root@PF2DR8H0:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          953G  733G  221G  77% /
none            953G  733G  221G  77% /dev
none            953G  733G  221G  77% /run
none            953G  733G  221G  77% /run/lock
none            953G  733G  221G  77% /run/shm
none            953G  733G  221G  77% /run/user
tmpfs           953G  733G  221G  77% /sys/fs/cgroup
C:\             953G  733G  221G  77% /mnt/c

Where i noticed the filesystem 'tmpfs' which I then used instead in the guide which then gave me this error:

root@PF2DR8H0:~# sudo mount -t tmpfs none /dev
root@PF2DR8H0:~# mount | grep ext4
root@PF2DR8H0:~# sudo resize2fs /dev/sdb 512000M
resize2fs 1.45.5 (07-Jan-2020)
open: No such file or directory while opening /dev/sdb

I was hoping that someone in here could tell me where to go from here, as my understanding of the ubuntu mount theory is not sufficient enough for me to understand and fix this error.

0 Answers
Related