Mounting Windows file systems.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 02 Jun 2021 16:39:36 +0300
changeset 2508 fe9788ce44ba
parent 2507 8e8c8adde585
child 2509 6a1fb2d1bee7
Mounting Windows file systems.
wsl.rst
--- a/wsl.rst	Thu Apr 22 10:57:04 2021 +0300
+++ b/wsl.rst	Wed Jun 02 16:39:36 2021 +0300
@@ -61,13 +61,34 @@
   wslconfig /t debian
   wslconfig /terminate debian
 
-Mounting external drives
-========================
+Mounting Windows file systems
+=============================
+
+From January 2018 WSL 1 allows to mount external NTFS file systems as ``drvfs``. ``metadata`` option
+allows ``chmod`` operation on NTFS volumes, metadata will be shared across all WSL distros though.
+
+https://devblogs.microsoft.com/commandline/chmod-chown-wsl-improvements/
+  Chmod/Chown WSL Improvements.
+
+To preserve customization between WSL reloads update ``/etc/wsl.conf`` with something like::
 
-::
+  [automount]
+  enabled = true
+  mountFsTab = false
+  options = "metadata,noatime,uid=1000,gid=1000,umask=022,fmask=077"
+
+Equivalent CLI call is::
+
+  sudo mount -t drvfs 'C:\' /mnt/c -o metadata,noatime,uid=1000,gid=1000,umask=022,fmask=077
+
+https://devblogs.microsoft.com/commandline/automatically-configuring-wsl/
+  Automatically Configuring WSL.
+
+To mount attached USB stick::
 
   sudo mkdir /mnt/f
   sudo mount -t drvfs f: /mnt/f
 
 https://docs.microsoft.com/en-us/windows/wsl/wsl-config
   ``/etc/wsl.conf`` configuration options.
+