How to Mount an External Hard Disk to Wsl2

Keren Xu


Sometimes we need extra spaces to store a large amount of data. If you have an external disk and a windows pc, and want to use WSL command line tool to sync data from HPC or other cloud computing platform, the first step is to mount the disk to WSL2.
For example, if you want to set it to disk D:

sudo umount /mnt/d

sudo mount -t drvfs D: /mnt/d