规划建筑园林设计 發表於 2026-5-5 09:02:51

技术市集 | 如何通过WSL 2在Windows上挂载Linux磁盘?

<section></section>
<p><img src="https://storage.deepin.org/thread/202406270254278081_zh.png" alt="" width="900" height="383" /></p>
<p>你是否常常苦恼,为了传输或者共享不同系统的文件需要频繁地在 Windows 和 Linux 系统之间切换,既耽误工作效率,也容易出错。</p>
<p>那么有没有一种办法,能够让你在Windows系统中像访问本地硬盘一样来操作Linux系统中的文件呢?</p>
<p>希望这篇文章分享的实用操作能够帮助到有需要的朋友。</p>
<p>&nbsp;</p>
<section></section>
<section></section>
<section></section>
<section>
<section data-role="outer">
<section data-role="title" data-tools="135编辑器" data-id="141089">
<section>
<section>
<section>
<section>
<section>
<h1 style="text-align: center;"><strong data-brushtype="text">先决条件</strong></h1>
</section>
</section>
<section>
<section></section>
</section>
</section>
</section>
</section>
</section>
<section data-role="paragraph">需要在Windows 10 2004 及更高版本(Build 19041 及更高版本)或 Windows 11系统的前提下操作。</section>
<section data-role="paragraph"></section>
<p data-role="paragraph">
</section>
<section data-role="outer">
<section data-role="title" data-tools="135编辑器" data-id="141089">
<section>
<section>
<section>
<section>
<section>
<h1 style="text-align: center;"><strong data-brushtype="text">第一步:在 Windows 上安装 WSL</strong></h1>
</section>
</section>
</section>
</section>
</section>
</section>
<section>1.以管理员模式打开 PowerShell 或 Windows 命令提示符:</p>
<ul class="list-paddingleft-1">
<li>按下Win + X组合键,打开快速访问菜单。</li>
<li>在菜单中选择“Windows PowerShell(管理员)”,以管理员身份运行PowerShell。</li>
</ul>
<p>2.输入<span style="text-decoration: underline;"> wsl install </span>命令。</p>
<p><img loading="lazy" src="https://storage.deepin.org/thread/202406270217167887_微信图片_20240627101103.jpg" alt="" width="984" height="258" /></p>
</section>
</section>
</section>
<p>完成后重新启动电脑。</p>
<p>3.电脑重启后,你需要为新安装的 Linux 子系统创建一个用户账户和密码。</p>
<blockquote><p><em>备注:适用于 Linux 的 Windows 子系统 (WSL) 是 Windows 的一项功能,可用于在 Windows 计算机上运行 Linux 环境,而无需单独的虚拟机或双引导。WSL 旨在为希望同时使用 Windows 和 Linux 的开发人员提供无缝高效的体验。</em></p></blockquote>
<p>&nbsp;</p>
<section>
<section data-role="outer">
<section data-role="title" data-tools="135编辑器" data-id="141089">
<section>
<section>
<section>
<section>
<section>
<h1 style="text-align: center;"><strong data-brushtype="text">第二步:在WSL 2中挂载磁盘</strong></h1>
</section>
</section>
<section>
<section></section>
</section>
</section>
</section>
</section>
</section>
</section>
<section data-id="us-4148222" data-tools="135编辑器">
<section>
<h2><strong>获取驱动器列表</strong></h2>
</section>
</section>
<ol class="list-paddingleft-1">
<li>以管理员模式打开 PowerShell 或 Windows 命令提示符;</li>
<li>运行命令(<span style="text-decoration: underline;">wmic diskdrive list brief</span>),获取可用驱动器列表。</li>
</ol>
</section>
<p><img loading="lazy" src="https://storage.deepin.org/thread/202406270217256389_微信图片_20240627101224.jpg" alt="" width="853" height="99" /></p>
<p><strong>命令解释:</strong></p>
<p><span style="text-decoration: underline;">wmic diskdrive list brief </span>是一个用于列出系统中所有磁盘驱动器的 Windows Management Instrumentation Command-line (WMIC) 命令。WMIC 是 Windows 操作系统中用于管理系统的一个命令行工具。</p>
<ol class="list-paddingleft-1">
<li><strong>Caption</strong>: 磁盘驱动器的简短描述,通常与 Model 类似,但可能包含更多的用户友好信息。</li>
<li><strong>DeviceID</strong>: 磁盘驱动器的设备标识符。</li>
<li><strong>Model</strong>: 磁盘驱动器的型号。</li>
<li><strong>Partitions</strong>: 磁盘驱动器上的分区数量。</li>
<li><strong>Size</strong>: 磁盘驱动器的大小,以字节为单位。</li>
</ol>
<p>&nbsp;</p>
<section>
<section data-id="us-4148222" data-tools="135编辑器">
<section>
<h2><strong>WSL 挂载</strong></h2>
</section>
</section>
<p>在我们的例子中,我们的外置硬盘是 PHYSICALDRIVE1 ,你可以使用命令加载它:</p>
<p><span style="text-decoration: underline;">wsl --mount \\.\PHYSICALDRIVE1 --partition 1</span></p>
<p><img loading="lazy" src="https://storage.deepin.org/thread/202406270217411847_微信图片_20240627101421.jpg" alt="" width="856" height="88" /></p>
</section>
<p><strong>命令解释:</strong></p>
<ol class="list-paddingleft-1">
<li><strong>wsl</strong>: 这是启动 Windows Subsystem for Linux 的命令行工具。</li>
<li><strong>--mount</strong>: 该选项用于挂载物理磁盘或其分区到 WSL 中。</li>
<li><strong>.\PHYSICALDRIVE1</strong>: 这是指定的物理驱动器。在 Windows 中,物理驱动器通常标识为 \\.\PHYSICALDRIVE0,\\.\PHYSICALDRIVE1 等等,这里指的是第二个物理驱动器。</li>
<li><strong>--partition 1</strong>: 这是指定要挂载的分区编号。</li>
</ol>
<p>要挂载指定文件系统,可使用以下命令:<span style="text-decoration: underline;">wsl --mount \\.\PHYSICALDRIVE1 --partition 1 -t ext3</span></p>
<p><img loading="lazy" src="https://storage.deepin.org/thread/202406270222182195_微信图片_20240627102141.jpg" alt="" width="856" height="79" /></p>
<p>&nbsp;</p>
<section>
<section data-id="us-4148222" data-tools="135编辑器">
<section>
<h2><strong>图形化访问挂载的硬盘</strong></h2>
</section>
</section>
<p>要访问已挂载的磁盘,请打开 Windows 文件资源管理器,然后打开 Linux 类别并导航到/mnt/wsl</p>
</section>
<section><img loading="lazy" src="https://storage.deepin.org/thread/202406270222271107_微信图片_20240627102158.jpg" alt="" width="980" height="266" /></section>
<section></section>
<p>&nbsp;</p>
<section>
<section data-id="us-4148222" data-tools="135编辑器">
<section>
<h2><strong>卸载磁盘</strong></h2>
</section>
</section>
<p>你可以使用命令卸载磁盘:</p>
<p><span style="text-decoration: underline;">wsl --unmount \\.\PHYSICALDRIVE1</span></p>
<p><img loading="lazy" src="https://storage.deepin.org/thread/202406270223421920_微信图片_20240627102329.jpg" alt="" width="551" height="46" /></p>
<p>&nbsp;</p>
</section>
<section></section>
<section></section>
<section>
<section data-role="title" data-tools="135编辑器" data-id="141089">
<section>
<section>
<section>
<section>
<section>
<h1 style="text-align: center;"><strong data-brushtype="text">总结</strong></h1>
</section>
</section>
</section>
</section>
</section>
</section>
<p>对于需要频繁在Windows和Linux系统之间切换的用户来说,Windows 挂载 Linux 磁盘是一个比较实用的操作,能够在不同操作系统之间方便地进行文件共享和操作。感兴趣的朋友快来试试吧!</p>
<p>最后,特别感谢deepin(深度)论坛用<em>户东夷浪子</em>创作此教程,也欢迎各位用户能积极投稿,我们会定期精选内容进行展示宣传,共同将这个技术市集搞的红红火火。</p>
</section>
<p>&nbsp;</p>
<section></section>
<section>

<div class="entry-content">
<h1><strong>附录:</strong></h1>
<p><strong>(1)deepin V23 RC2 :</strong>https://www.deepin.org/zh/download/</p>
<p><strong>(2)deepin 历史版本镜像(含 deepin V15):</strong>https://distrowatch.com/index.php?distribution=deepin</p>
<p>&nbsp;</p>
<p style="text-align: right;">内容来源:deepin(深度)社区</p>
<p style="text-align: right;">转载请注明出处</p>
</div>
</article>
</section>
                        </div>
頁: [1]
查看完整版本: 技术市集 | 如何通过WSL 2在Windows上挂载Linux磁盘?