{"id":5989,"date":"2020-09-10T10:08:58","date_gmt":"2020-09-10T17:08:58","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/commandline\/?p=5989"},"modified":"2020-09-10T10:11:14","modified_gmt":"2020-09-10T17:11:14","slug":"access-linux-filesystems-in-windows-and-wsl-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/commandline\/access-linux-filesystems-in-windows-and-wsl-2\/","title":{"rendered":"Access Linux filesystems in Windows and WSL 2"},"content":{"rendered":"<p>Starting with <a href=\"https:\/\/blogs.windows.com\/windows-insider\/2020\/09\/10\/announcing-windows-10-insider-preview-build-20211\/\">Windows Insiders preview build 20211<\/a>, WSL 2 will be offering a new feature: <code>wsl --mount<\/code>. This new parameter allows a physical disk to be attached and mounted inside WSL 2, which enables you to access filesystems that aren\u2019t natively supported by Windows (such as ext4).<\/p>\n<p>So, if you\u2019re dual booting with Windows &amp; Linux using different disks, you can now access your Linux files from Windows!<\/p>\n<h2>Getting started<\/h2>\n<p>To mount a disk, open a PowerShell window with administrator privileges and run:<\/p>\n<pre><code>wsl --mount &lt;DiskPath&gt;\n<\/code><\/pre>\n<p>To list the available disks in Windows, run:<\/p>\n<pre><code>wmic diskdrive list brief\n<\/code><\/pre>\n<p>To unmount and detach the disk from WSL 2, run<\/p>\n<pre><code>wsl --unmount &lt;Diskpath&gt;\n<\/code><\/pre>\n<p>The disks paths are available under the &#8216;DeviceID&#8217; columns. Usually under the <code>\\\\.\\\\\\.\\PHYSICALDRIVE*<\/code> format. Below is an example of mounting a specific partition of a given hard disk into WSL and browsing its files.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/mountScreenshot.png\" alt=\"terminal with wsl text\" width=\"1366\" height=\"910\" class=\"aligncenter size-full wp-image-6116\" srcset=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/mountScreenshot.png 1366w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/mountScreenshot-300x200.png 300w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/mountScreenshot-1024x682.png 1024w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/mountScreenshot-768x512.png 768w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/p>\n<h2>Accessing these files with File Explorer<\/h2>\n<p>Once mounted, it\u2019s also possible to access these disks through the Windows explorer by navigating to \\wsl$ and then to the mount folder.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/accessEXT4.png\" alt=\"Accessing an EXT4 partition with file explorer\" width=\"1366\" height=\"816\" class=\"aligncenter size-full wp-image-6117\" srcset=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/accessEXT4.png 1366w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/accessEXT4-300x179.png 300w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/accessEXT4-1024x612.png 1024w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2020\/08\/accessEXT4-768x459.png 768w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><\/p>\n<h2>Limitations<\/h2>\n<p>By default, <code>wsl --mount<\/code> attempts to mount the disk as ext4. To specify a filesystem, or for more advanced scenarios, check out <a href=\"https:\/\/docs.microsoft.com\/windows\/wsl\/wsl2-mount-disk\">Mount a disk in WSL 2<\/a>.<\/p>\n<p>Also please note that this feature comes with the limitation that only physical disks can be attached to WSL 2. At this time, it\u2019s not possible to attach a single partition. More details on the limitations <a href=\"https:\/\/docs.microsoft.com\/windows\/wsl\/wsl2-mount-disk#limitations\">here<\/a>.<\/p>\n<h2>Give us your feedback!<\/h2>\n<p>If you run into any issues, or have feedback for our team please file an issue on our <a href=\"https:\/\/github.com\/microsoft\/wsl\/issues\">Github<\/a> , and if you have general questions about WSL you can find all of our team members that are on Twitter on <a href=\"https:\/\/twitter.com\/i\/lists\/1131397802204864512\/members\">this twitter list<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Starting with Windows Insiders preview build 20211, WSL 2 will be offering a new feature: wsl &#8211;mount. This new parameter allows a physical disk to be attached and mounted inside WSL 2, which enables you to access filesystems that aren\u2019t natively supported by Windows (such as ext4). So, if you\u2019re dual booting with Windows &amp; [&hellip;]<\/p>\n","protected":false},"author":36386,"featured_media":4568,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5989","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-commandline"],"acf":[],"blog_post_summary":"<p>Starting with Windows Insiders preview build 20211, WSL 2 will be offering a new feature: wsl &#8211;mount. This new parameter allows a physical disk to be attached and mounted inside WSL 2, which enables you to access filesystems that aren\u2019t natively supported by Windows (such as ext4). So, if you\u2019re dual booting with Windows &amp; [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts\/5989","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/users\/36386"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/comments?post=5989"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts\/5989\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/media\/4568"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/media?parent=5989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/categories?post=5989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/tags?post=5989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}