linux选择磁盘的安装文件系统,关于在 WSL 2 中安装 Linux 磁盘的入门 | Microsoft Docs...

开始在 WSL 2 (preview 中安装 Linux 磁盘)Get started mounting a Linux disk in WSL 2 (preview)

04/08/2021

本文内容

如果要访问 Windows 不支持的 Linux 磁盘格式,则可以使用 WSL 2 来装入磁盘并访问其内容。If you want to access a Linux disk format that isn't supported by Windows, you can use WSL 2 to mount your disk and access its content. 本教程将介绍如何识别要附加到 WSL2 的磁盘和分区,如何装载这些磁盘和分区,以及如何对其进行访问。This tutorial will cover the steps to identify the disk and partition to attach to WSL2, how to mount them, and how to access them.

备注

需要管理员访问权限才能将磁盘附加到 WSL 2。Administrator access is required to attach a disk to WSL 2.

WSL 2 mount 命令不支持装入磁盘 (或属于当前正在使用的磁盘) 的分区。The WSL 2 mount command does not support mounting a disk (or partitions that belong to the disk) that is currently in use. wsl --mount 即使只请求了一个分区,也始终会附加整个磁盘。wsl --mount always attaches the entire disk even if only a partition is requested. 无法装载 Windows 安装磁盘。You can't mount the Windows installation disk.

先决条件Prerequisites

需要在 Windows 10 版本20211或更高版本上才能访问此功能。You will need to be on Windows 10 Build 20211 or higher to access this feature. 可以加入 Windows 预览 体验计划 ,以获取最新的预览版。You can join the Windows Insiders Program to get the latest preview builds.

装载未分区的磁盘Mounting an unpartitioned disk

在这种最简单的情况下,如果磁盘不包含任何分区,则可以使用命令直接装载该磁盘 wsl --mount 。In this simplest case, if you have a disk that doesn't have any partitions, you can mount it directly using the wsl --mount command. 首先需要标识该磁盘。First you need to identify the disk.

确定磁盘Identify the disk

若要列出 Windows 中的可用磁盘,请运行:To list the available disks in Windows, run:

wmic diskdrive list brief

磁盘路径位于 "DeviceID" 列下。The disks paths are available under the 'DeviceID' columns. 通常在 \\.\PHYSICALDRIVE* 格式下。Usually under the \\.\PHYSICALDRIVE* format.

装载磁盘Mount the disk

然后,在 Powershell 中,可以使用上面发现的磁盘路径装载磁盘。Then in Powershell you can mount the disk using the Disk path discovered above.

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值