根據 WSL 跨文件系統配置 介紹中 Automount Settings章節的描述,WSL 會自動將 windows 檔案系統通過 DrfFS 檔案系統掛載到 /mnt 路徑下。
如需將 windows 檔案系統挂載到 WSL 的指定位置,首先需要停用自動掛載:編輯 /etc/wsl.conf 檔案,添加以下内容:
[automount]
enabled=false
然後,在 /etc/fstab 檔案中配置掛載:
C: /mnt/c drvfs errors=remount-ro 0 1
F: /path/to/mount/point drvfs defaults,uid=<loginuid>,gid=<logingid> 0 0