Linux Subsystem for Windows / Drive mounts and how to manipulate them? RRS feed

  • Question

  • Hi!

    First post on the TechNet/MSDN forums here. Tried searching for a WSL specific discussion, but couldn't find it - so if one does exist, please let me know and I'll go there.

    Anyone else playing with WSL yet? I've been waiting for some native tools for some time now, very happy it's finally made it to Windows 10.

    So I'd like to discuss drive mounts in W10 WSL. I see we use a rootfs wrapper for '/' and then in /mnt/ we have a directory 'c'.. it's all done by the API it seems, no other explanation on the WSL side as to how that translates back to NTFS.

    So I create another partition in my volume and use a NTFS folder mount point rather than a drive letter. Get an IO Error when trying to access it from /mnt/c/mountpoint. It's kinda expected, early beta and all. Now I create a drive letter mount, but have no idea how to, or if I can even update /mnt/ inside WSL to reflect this new Windows drive. I haven't rebooted yet, but I want to understand how the mapping is done in runtime, rather than just reboot and hope it works.

    Anyone from WSL team know how this mapping works behind the scenes?


    Monday, April 11, 2016 4:32 PM

All replies

  • I have been playing with the WSL also and seeing what I can do with it. I want to understand how things are mapped, where they are stored, etc.  I haven't found any documentation on what you can do with it yet except for this video by Paul DeCarlo.

    Here is the video where he runs X11 on the WSL.

    Monday, April 11, 2016 5:17 PM
  • For anyone reading this wondering if it works after a restart, indeed it does. The additional drive letter shows up, and is accessible.

    After a restart, the mount point is still not working, giving an IO error.

    Likely, restarting a service would be enough to refresh this information so that bash can read it from the API, but I don't know what the architecture looks like in that much detail. Be useful to be able to mount devices/drives and know how to quickly refresh the subsystem or API, without a restart.

    That would be a good topic for a future Q/A or video from the MS Linux Subsystem team.

    Monday, April 11, 2016 5:46 PM
  • WSL uses the DrvFs file system. WSL automatically mounts all fixed drives with supported file systems under /mnt, such as /mnt/c, /mnt/d, etc. Currently, only NTFS and ReFS volumes are supported. So that means if you have  FAT, EXFATor others they will not be automatically mounted.

    To my knowledge, manual mounting is still not supported.

    some more info here;

    1. Files under the Linux root (i.e. “/”) are controlled by the subsystem. This allows for Linux specific behavior including but is not limited to:
      • Files which contain invalid Windows filename characters
      • Symlinks created for non-admin users
      • Changing file attributes through <g class="gr_ gr_89 gr-alert gr_spell gr_run_anim gr_inline_cards ContextualSpelling ins-del multiReplace" data-gr-id="89" id="89">chmod</g> and <g class="gr_ gr_90 gr-alert gr_spell gr_run_anim gr_inline_cards ContextualSpelling ins-del multiReplace" data-gr-id="90" id="90">chown</g>
      • Support case sensitivity
    2. Files in mounted drives are controlled by Windows and have the following behaviors:
      • Support case sensitivity
      • All permissions are set to best reflect the Windows permissions

    • Edited by Junglecoder Monday, February 6, 2017 9:43 AM
    Monday, February 6, 2017 9:43 AM
  • It is now 2020 (1/26/2020 to be exact) Microsoft has had time to think about this and as I see it they have given up. I stick a USB thumb drive in and nothing, WSL Version 2 does nothing.

    As time moves on Microsoft stands still while customers move to distributed systems with Linux back-ends and phone/table Android front-ends what is missing is any Windows.....

    Sunday, January 26, 2020 10:56 PM