{"id":34136,"date":"2024-06-27T10:34:09","date_gmt":"2024-06-27T02:34:09","guid":{"rendered":"https:\/\/www.deepin.org\/?p=34136"},"modified":"2024-06-27T11:05:19","modified_gmt":"2024-06-27T03:05:19","slug":"how-to-mount-a-linux-disk-on-windows-via-wsl-2","status":"publish","type":"post","link":"https:\/\/www.deepin.org.cn\/en\/how-to-mount-a-linux-disk-on-windows-via-wsl-2\/","title":{"rendered":"Technical Share | How to Mount a Linux Disk on Windows via WSL 2?"},"content":{"rendered":"<section><\/section>\n<p><img loading=\"lazy\" src=\"https:\/\/storage.deepin.org\/thread\/202406270254441847_en.png\" alt=\"\" width=\"900\" height=\"383\" \/><\/p>\n<div class=\"content___hMdwe\">\n<div class=\"markdown___Ho3m0\">\n<p>Do you often find it frustrating to frequently switch between Windows and Linux systems to transfer or share files across different operating systems, which not only delays work efficiency but also prone to errors?<\/p>\n<p>Is there a way to operate files in a Linux system as if you were accessing a local hard drive within the Windows system? I hope the practical operations shared in this article can help friends in need.<\/p>\n<\/div>\n<\/div>\n<div id=\"chat-actions\" class=\"actions___FWoZ6\">\n<div class=\"MuiStack-root chatSegmentActions___Len3_ css-1xhj18k\"><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<section><\/section>\n<section><\/section>\n<section><\/section>\n<section>\n<section data-role=\"outer\">\n<section data-role=\"title\" data-tools=\"135\u7f16\u8f91\u5668\" data-id=\"141089\">\n<section>\n<section>\n<section>\n<section>\n<section>\n<h1 style=\"text-align: center;\"><strong>Prerequisites<\/strong><\/h1>\n<\/section>\n<\/section>\n<section>\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section data-role=\"paragraph\">\n<div class=\"MuiBox-root css-3ztqy4\">\n<div id=\"chat-segment-cpucvu86n7mq9vtq7cc0\" class=\"segment___n0QmU left___gUK6C\">\n<div class=\"container___hZllz\">\n<div class=\"main___dsnkV\">\n<div class=\"content___hMdwe\">\n<div class=\"markdown___Ho3m0\">\n<p>The operation must be performed on a Windows 10 version 2004 or higher (Build 19041 or higher) or Windows 11 system.<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n<\/section>\n<section data-role=\"outer\">\n<section data-role=\"title\" data-tools=\"135\u7f16\u8f91\u5668\" data-id=\"141089\">\n<section>\n<section>\n<section>\n<section>\n<section>\n<h1 style=\"text-align: center;\"><strong>Step One: Install WSL on Windows<\/strong><\/h1>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p>1\u3001Open PowerShell or the Windows Command Prompt in Administrator mode:<\/p>\n<\/section>\n<p>Press the Win + X key combination to open the Quick Access menu.<\/p>\n<p>In the menu, select \"Windows PowerShell (Administrator)\" to run PowerShell as an administrator.<\/p>\n<section data-role=\"outer\">\n<section>2\u3001Enter the <code class=\"inlineCode___KhxNe\">wsl --install<\/code> command.<img loading=\"lazy\" src=\"https:\/\/storage.deepin.org\/thread\/202406270217167887_\u5fae\u4fe1\u56fe\u7247_20240627101103.jpg\" alt=\"\" width=\"984\" height=\"258\" \/><\/section>\n<\/section>\n<\/section>\n<p>After the completion, restart your computer.<\/p>\n<p>3\u3001After the computer restarts, you will need to create a user account and password for the newly installed Linux subsystem.<\/p>\n<div id=\"chat-actions\" class=\"actions___FWoZ6\">\n<div class=\"MuiStack-root chatSegmentActions___Len3_ css-1xhj18k\"><\/div>\n<\/div>\n<blockquote><p>Note: The Windows Subsystem for Linux (WSL) is a feature of Windows that allows you to run a Linux environment on your Windows computer without the need for a separate virtual machine or dual boot. WSL is designed to provide a seamless and efficient experience for developers who wish to use both Windows and Linux.<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<section>\n<section data-role=\"outer\">\n<section data-role=\"title\" data-tools=\"135\u7f16\u8f91\u5668\" data-id=\"141089\">\n<section>\n<section>\n<section>\n<section>\n<section>\n<h1 style=\"text-align: center;\"><strong>Step Two: Mount the Disk in WSL 2<\/strong><\/h1>\n<\/section>\n<\/section>\n<section>\n<section><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section data-id=\"us-4148222\" data-tools=\"135\u7f16\u8f91\u5668\">\n<section>\n<h2><strong>Obtain the list of drives<\/strong><\/h2>\n<\/section>\n<\/section>\n<div class=\"container___hZllz\">\n<div class=\"main___dsnkV\">\n<div class=\"content___hMdwe\">\n<div class=\"markdown___Ho3m0\">\n<ul>\n<li>Open PowerShell or the Windows Command Prompt in Administrator mode;<\/li>\n<li>Run the command <code class=\"inlineCode___KhxNe\">wmic diskdrive list brief<\/code> to get the list of available drives.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div id=\"chat-actions\" class=\"actions___FWoZ6\">\n<div class=\"MuiStack-root chatSegmentActions___Len3_ css-1xhj18k\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n<p><img loading=\"lazy\" src=\"https:\/\/storage.deepin.org\/thread\/202406270217256389_\u5fae\u4fe1\u56fe\u7247_20240627101224.jpg\" alt=\"\" width=\"853\" height=\"99\" \/><\/p>\n<p><strong>Command Explanation:<\/strong><\/p>\n<p><code class=\"inlineCode___KhxNe\">wmic diskdrive list brief<\/code> is a Windows Management Instrumentation Command-line (WMIC) command used to list all the disk drives in the system. WMIC is a command-line tool in the Windows operating system used for managing the system.<\/p>\n<ul>\n<li>Caption: A brief description of the disk drive, usually similar to the Model, but may contain more user-friendly information.<\/li>\n<li>DeviceID: The device identifier for the disk drive.<\/li>\n<li>Model: The model of the disk drive.<\/li>\n<li>Partitions: The number of partitions on the disk drive.<\/li>\n<li>Size: The size of the disk drive, in bytes.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<section>\n<section data-id=\"us-4148222\" data-tools=\"135\u7f16\u8f91\u5668\">\n<section>\n<h2><strong>WSL Mounting<\/strong><\/h2>\n<\/section>\n<\/section>\n<p>In our example, our external hard drive is PHYSICALDRIVE1, you can use the command to mount it:<\/p>\n<p><span style=\"text-decoration: underline;\">wsl --mount \\\\.\\PHYSICALDRIVE1 --partition 1<\/span><\/p>\n<p><img loading=\"lazy\" src=\"https:\/\/storage.deepin.org\/thread\/202406270217411847_\u5fae\u4fe1\u56fe\u7247_20240627101421.jpg\" alt=\"\" width=\"856\" height=\"88\" \/><\/p>\n<\/section>\n<p><strong>Command Explanation:<\/strong><\/p>\n<div class=\"MuiBox-root css-3ztqy4\">\n<div id=\"chat-segment-cpud3aj5cfuq3pf7djf0\" class=\"segment___n0QmU left___gUK6C\">\n<div class=\"container___hZllz\">\n<div class=\"main___dsnkV\">\n<div class=\"content___hMdwe\">\n<div class=\"markdown___Ho3m0\">\n<ul>\n<li>WSL: This is the command-line tool for launching the Windows Subsystem for Linux.<\/li>\n<li>--mount: This option is used to mount a physical disk or its partition into WSL.<\/li>\n<li>.\\PHYSICALDRIVE1: This is the specified physical drive. In Windows, physical drives are usually identified as \\.\\PHYSICALDRIVE0, \\.\\PHYSICALDRIVE1, and so on, where this refers to the second physical drive.<\/li>\n<li>--partition 1: This is the partition number that is specified to be mounted.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div id=\"chat-actions\" class=\"actions___FWoZ6\">\n<div class=\"MuiStack-root chatSegmentActions___Len3_ css-1xhj18k\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"MuiBox-root css-6gx9d4\"><\/div>\n<\/div>\n<\/div>\n<div class=\"content___hMdwe\">\n<div class=\"markdown___Ho3m0\">\n<p>To mount a specified file system, you can use the following command:\u00a0 <span style=\"text-decoration: underline;\">wsl --mount \\\\.\\PHYSICALDRIVE1 --partition 1 -t ext3<\/span><\/p>\n<\/div>\n<\/div>\n<p><img loading=\"lazy\" src=\"https:\/\/storage.deepin.org\/thread\/202406270222182195_\u5fae\u4fe1\u56fe\u7247_20240627102141.jpg\" alt=\"\" width=\"856\" height=\"79\" \/><\/p>\n<p>&nbsp;<\/p>\n<section>\n<section data-id=\"us-4148222\" data-tools=\"135\u7f16\u8f91\u5668\">\n<section>\n<h2><strong>Graphical Access to Mounted Hard Drive<\/strong><\/h2>\n<\/section>\n<\/section>\n<p>To access the mounted disk, please open the Windows File Explorer, then go to the Linux category and navigate to <code class=\"inlineCode___KhxNe\">\/mnt\/wsl<\/code>.<\/p>\n<\/section>\n<section><img loading=\"lazy\" src=\"https:\/\/storage.deepin.org\/thread\/202406270222271107_\u5fae\u4fe1\u56fe\u7247_20240627102158.jpg\" alt=\"\" width=\"980\" height=\"266\" \/><\/section>\n<section><\/section>\n<p>&nbsp;<\/p>\n<section>\n<section data-id=\"us-4148222\" data-tools=\"135\u7f16\u8f91\u5668\">\n<section>\n<h2><strong>Unmount the Disk<\/strong><\/h2>\n<\/section>\n<\/section>\n<p>You can use the command to unmount the disk:\u00a0 <span style=\"text-decoration: underline;\">wsl --unmount \\\\.\\PHYSICALDRIVE1<\/span><\/p>\n<p><img loading=\"lazy\" src=\"https:\/\/storage.deepin.org\/thread\/202406270223421920_\u5fae\u4fe1\u56fe\u7247_20240627102329.jpg\" alt=\"\" width=\"551\" height=\"46\" \/><\/p>\n<p>&nbsp;<\/p>\n<\/section>\n<section><\/section>\n<section><\/section>\n<section>\n<section data-role=\"title\" data-tools=\"135\u7f16\u8f91\u5668\" data-id=\"141089\">\n<section>\n<section>\n<section>\n<section>\n<section>\n<h1 style=\"text-align: center;\"><strong>Summary<\/strong><\/h1>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<div data-index=\"88\" data-known-size=\"290\" data-item-index=\"280\">\n<div class=\"MuiBox-root css-1x6e6a7\">\n<div class=\"MuiBox-root css-3ztqy4\">\n<div id=\"chat-segment-cpud4fhldu5lbpt80h10\" class=\"segment___n0QmU left___gUK6C\">\n<div class=\"container___hZllz\">\n<div class=\"main___dsnkV\">\n<div class=\"content___hMdwe\">\n<p>For users who frequently need to switch between Windows and Linux systems, mounting a Linux disk in Windows is a practical operation that facilitates file sharing and operations between different operating systems. Friends who are interested, come and give it a try!<\/p>\n<p>Finally, special thanks to the deepin (Deep OS) forum user Dongyi Langzi for creating this tutorial. We also welcome all users to contribute actively. We will regularly select and showcase quality content to promote this technical marketplace together, making it prosperous and thriving.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<div class=\"MuiBox-root css-15p9n5u\">\n<h1><strong>Appendix\uff1a<\/strong><\/h1>\n<section><\/section>\n<p><strong>\uff081\uff09\u00a0deepin V23 RC ISO :<\/strong><a href=\"https:\/\/www.deepin.org\/en\/download\/\">\u00a0https:\/\/www.deepin.org\/en\/download\/<\/a><\/p>\n<p><strong>\uff082\uff09deepin Previous Versions\uff08include deepin V15\uff09\uff1a<\/strong><a href=\"https:\/\/distrowatch.com\/table.php?distribution=deepin\">\u00a0https:\/\/distrowatch.com\/table.php?distribution=deepin<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: right;\">Content source: deepin community<br \/>\nReprinted with attribution<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/section>","protected":false},"excerpt":{"rendered":"<p>Do you often find it frustrating to frequently switch between Windows and Linux systems to transfer or share files across different operating systems, which not only delays work efficiency but also prone to errors? Is there a way to operate files in a Linux system as if you were accessing a local hard drive within the Windows system? I hope the practical operations shared in this article can help friends in need. &nbsp; Prerequisites The operation must be performed on a Windows 10 version 2004 or higher (Build 19041 or higher) or Windows 11 system. &nbsp; Step One: Install WSL ...<a href=https:\/\/www.deepin.org.cn\/en\/how-to-mount-a-linux-disk-on-windows-via-wsl-2\/>Read more<\/a><\/p>\n","protected":false},"author":11164,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[155,93],"tags":[],"_links":{"self":[{"href":"https:\/\/www.deepin.org.cn\/en\/wp-json\/wp\/v2\/posts\/34136"}],"collection":[{"href":"https:\/\/www.deepin.org.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.deepin.org.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.deepin.org.cn\/en\/wp-json\/wp\/v2\/users\/11164"}],"replies":[{"embeddable":true,"href":"https:\/\/www.deepin.org.cn\/en\/wp-json\/wp\/v2\/comments?post=34136"}],"version-history":[{"count":6,"href":"https:\/\/www.deepin.org.cn\/en\/wp-json\/wp\/v2\/posts\/34136\/revisions"}],"predecessor-version":[{"id":34142,"href":"https:\/\/www.deepin.org.cn\/en\/wp-json\/wp\/v2\/posts\/34136\/revisions\/34142"}],"wp:attachment":[{"href":"https:\/\/www.deepin.org.cn\/en\/wp-json\/wp\/v2\/media?parent=34136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.deepin.org.cn\/en\/wp-json\/wp\/v2\/categories?post=34136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.deepin.org.cn\/en\/wp-json\/wp\/v2\/tags?post=34136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}