如何在 Linux 中挂载 Bitlocker 加密的 Windows 分区
加密 分区 Windows

> 
> 情况是这样的。我的系统自带 Windows 10 Pro，并且带有 BitLocker 加密功能。我 [甚至在 Windows 启用了 BitLocker 加密的情况下，以双启动模式安装了 Ubuntu](https://itsfoss.com/dual-boot-ubuntu-windows-bitlocker/)。
> 
> 
> 


![](/data/attachment/album/202111/22/144133k6n9xsnnt46t0z94.jpg)


你可以轻松地从 Linux 中访问 Windows 文件。没有什么高科技的东西。只要进入文件管理器，点击通常位于“<ruby> 其他位置 <rt>  Other Locations </rt></ruby>”标签下的 Windows 分区。


![Mounting Windows partition through the file manager in Linux desktop](/data/attachment/album/202111/22/144146t9qo6pytmpqdpu2t.png)


对于 BitLocker 加密的 Windows 分区来说，这个过程也不是太复杂。只是当你试图挂载 Windows 分区时，它会要求你输入密码。


![Password required for encrypted Windows drive mount in Linux](/data/attachment/album/202111/22/144147a3u888k89c88oes8.png)


这是能工作的。在我的情况中，我输入了 48 位 BitLocker 恢复密码，它解密了 Windows 分区，并在带有 GNOME 40 的 Ubuntu 21.10 中毫无问题地挂载了它。


试试你的 BitLocker 密码。如果这不起作用，试试恢复密码。对于普通的 Windows 10 Pro 用户，恢复密码存储在你的微软账户中。


[BitLocker Recovery Password in Micrsoft Account](https://account.microsoft.com/devices/recoverykey?refd=support.microsoft.com)


输入恢复密码，你会看到 Windows 分区和它的文件现在可以访问。勾选“<ruby> 记住密码 <rt>  Remember Password </rt></ruby>”框也是为了进一步使用而节省时间。


![Encrypted Windows partition now mounted in Linux](/data/attachment/album/202111/22/144147hb5zs8kjuu5uv5pj.png)


如果上述方法对你不起作用，或者你不熟悉命令行，还有一个替代方法。


这个方法包括使用一个叫做 [Dislocker](https://github.com/Aorimn/dislocker) 的工具。


### 使用 Dislocker 在 Linux 中挂载 BotLocker 加密的 Windows 分区（命令行方法）


使用 Dislocker 分为两部分。第一部分是解开 BitLocker 的加密，并给出一个名为 `dislocker-file` 的文件。这基本上是一个虚拟的 NTFS 分区。第二部分是挂载你刚刚得到的虚拟 NTFS 分区。


你需要 BitLocker 密码或恢复密码来解密加密的驱动器。


让我们来看看详细的步骤。


#### 步骤 1：安装 Disclocker


大多数 Linux 发行版的仓库中都有 Dislocker。请使用你的发行版的包管理器来安装它。


在基于 Ubuntu 和 Debian 的发行版上，使用这个命令：



```
sudo apt install dislocker

```

![Installing Dislocker in Ubuntu](/data/attachment/album/202111/22/144148y36p9e9ztz699l9u.png)


#### 步骤 2：创建挂载点


你需要创建两个挂载点。一个是 Dislocker 生成 `dislocker-file` 的地方，另一个是将这个 `dislocker-file`（虚拟文件系统）作为一个回环设备挂载。


没有命名限制，你可以给这些挂载目录起任何你想要的名字。


逐一使用这些命令：



```
sudo mkdir -p /media/decrypt
sudo mkdir -p /media/windows-mount

```

![Creating mount points for dislocker](/data/attachment/album/202111/22/144148v100x4xd0bvidzre.png)


#### 步骤 3：获取需要解密的分区信息


你需要 Windows 分区的名称。你可以使用文件资源管理器或像 Gparted 这样的 GUI 工具。


![Get the partition name](/data/attachment/album/202111/22/144148c5dmmedf16ef9m5t.png)


在我的例子中，Windows 分区是 `/dev/nvme0n1p3`。对你的系统来说，这将是不同的。你也可以使用命令行来达到这个目的。



```
sudo lsblk

```

#### 步骤 4：解密分区并挂载


你已经设置好了一切。现在是真正的部分。


**如果你有 BitLocker 密码**，以这种方式使用 `dislocker` 命令（用实际值替换 `<partition_name>` 和 `<password>`）：



```
sudo dislocker <partition_name> -u<password> -- /media/decrypt

```

如果你只有恢复密码，请以这种方式使用该命令用实际值替换 `<partition_name>` 和 `<password>`）：



```
sudo dislocker <partition_name> -p<recovery_password> -- /media/decrypt

```

在解密该分区时，应该不会花很长时间。你应该在指定的挂载点看到 `dislocker-file`，在我们的例子中是 `/media/decrypt`。现在挂载这个 dislocker-file：



```
sudo mount -o loop /media/decrypt/dislocker-file /media/windows-mount

```

![](/data/attachment/album/202111/22/144149mye8qve8hirmxqjv.png)


完成了。你的 BitLocker 加密的 Windows 分区已经被解密并挂载到 Linux 中。你也可以从文件资源管理器中访问它。


![Mounting Dislocker decrypted Windows partition with file manager](/data/attachment/album/202111/22/144149lqqvg3gvgk5r44sd.png)


#### 文件系统类型错误的故障排除提示


如果你遇到这样的错误：



```
mount: /media/windows-mount: wrong fs type, bad option, bad superblock on /dev/loop35, missing codepage or helper program, or other error.

```

你应该在挂载时指定文件系统。


对于NTFS，使用：



```
sudo mount -t ntfs-3g -o loop /media/decrypt/dislocker-file /media/windows-mount

```

对于 exFAT，使用：



```
sudo mount -t exFAT-fuse -o loop /media/decrypt/dislocker-file /media/windows-mount

```

#### 解除对 Windows 分区的挂载


你可以从文件管理器中取消挂载的分区。只要**点击名为 windows-mount 的分区旁边的卸载符号**。


或者，你可以使用卸载命令：



```
sudo umount /media/decrypt
sudo umount /media/windows-mount

```

我希望这对你有帮助。如果你还有问题或建议，请在评论中告诉我。




---


via: <https://itsfoss.com/mount-encrypted-windows-partition-linux/>


作者：[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

Here’s the scenario. My system came with Windows 10 Pro and that came with BitLocker encryption. I [installed Ubuntu in the dual boot mode even with the BitLocker encryption](https://itsfoss.com/dual-boot-ubuntu-windows-bitlocker/) enabled for Windows.

You can easily access the Windows files from within Linux. No hi-fi stuff here. Just go to the file manager and click on the Windows partition which is located usually under the “Other Locations” tab.

![mount encrypted windows partition in linux](https://itsfoss.com/content/images/wordpress/2021/11/mount-encrypted-windows-partition-in-linux-800x476.png)

The process is not too complicated with BitLocker encrypted Windows partition as well. It’s just that when you try to mount the Windows partition, it will ask for the password.

![password needed for encrypted windows drive mount in linux](https://itsfoss.com/content/images/wordpress/2021/11/password-needed-for-encrypted-windows-drive-mount-in-Linux.png)

It works though. In my case, I entered the 48 digit BitLocker recovery password and it decrypted the Windows partition and mounted it without any issue in Ubuntu 21.10 with GNOME 40.

Try your BitLocker password. If that does not work, try the recovery password. For normal Windows 10 Pro users, the recovery password is stored in your Microsoft account.

[BitLocker Recovery Password in Micrsoft Account](https://account.microsoft.com/devices/recoverykey?refd=support.microsoft.com&ref=itsfoss.com)

Enter the recovery and you’ll see that Windows partition and its files are accessible now. Checking the “Remember Password” box is also a time saver for further usage.

![encrypted windows partition mounted in linux](https://itsfoss.com/content/images/wordpress/2021/11/encrypted-windows-partition-mounted-in-Linux-800x491.png)

If the above does not work for you or if you are stuck with the command line, there is an alternative method.

This method involves using a tool called [Dislocker](https://github.com/Aorimn/dislocker?ref=itsfoss.com).

## Mount BotLocker encrypted Windows partition in Linux with Dislocker [Command Line Method]

Dislocker process works in two parts. The first part decrypts the BitLocker encryption and gives a file named dislocker-file. This is basically a virtual NTFS partition. The second part is basically mounting the virtual NTFS partition you just got.

You’ll need either the BitLocker password or the recovery password to decrypt the encrypted drive.

Let’s see the steps in details.

### Step 1: Install Disclocker

Dislocker is available in the repositories of most Linux distributions. Please use your distribution’s package manager to install it.

On Ubuntu and Debian based distributions, use this command:

`sudo apt install dislocker`


![install dislocker ubuntu](https://itsfoss.com/content/images/wordpress/2021/11/install-dislocker-ubuntu.png)

### Step 2 : Create mount points

You’ll need to create two mount points. One for where Dislocker will generate the dislocker-file and the other one which will mount this dislocker-file (virtual filesystem) as a loop device.

There is no naming restrictions and you may name these mount directories anything you want.

Use these commands one by one:

```
sudo mkdir -p /media/decrypt
sudo mkdir -p /media/windows-mount
```


![creating mount points for dislocker](https://itsfoss.com/content/images/wordpress/2021/11/creating-mount-points-for-dislocker.png)

### Step 3: Get the partition info which needs to be decrypted

You need the name of the Windows partition. You can use the file explorer or GUI tools like Gparted.

![show device name gparted](https://itsfoss.com/content/images/wordpress/2021/11/show-device-name-gparted-800x416.png)

In my case, the Windows partition is /dev/nvme0n1p3. It will be different for your system. You may also use command line for this purpose.

`sudo lsblk`


### Step 4: Decrypt the partition and mount

You have everything set up. Now comes the real part.

I**f you have the BitLocker password**, use the dislocker command in this fashion (replace <partition_name> and <password> with actual values):

`sudo dislocker <partition_name> -u<password> -- /media/decrypt`


Please note that **there is no space between u and password**.

If you only have the recovery password, use the command in this fashion (replace <partition_name> and <recovery_password> with actual values):

`sudo dislocker <partition_name> -p<recovery_password> -- /media/decrypt`


Again, there is **no space between p and password**.

It should not take a long time in decrypting the partition. You should see the dislocker-file in the designated mount point, /media/decrypt in our case. Now mount this dislocker-file:

`sudo mount -o loop /media/decrypt/dislocker-file /media/windows-mount`


![mount dislocker decrypted windows partition](https://itsfoss.com/content/images/wordpress/2021/11/mount-dislocker-decrypted-windows-partition.png)

You are done. Your BitLocker encrypted Windows partition is decrypted and mounted in Linux. You can access it from the file explorer as well.

![discloker mount encrypted windows partition](https://itsfoss.com/content/images/wordpress/2021/11/discloker-mount-encrypted-windows-partition-800x483.png)

### Troubleshooting tips for wrong fs type error

If you get an error like this:

`mount: /media/windows-mount: wrong fs type, bad option, bad superblock on /dev/loop35, missing codepage or helper program, or other error.`


You should specify the filesystem while mounting.

For NTFS, use:

`sudo mount -t ntfs-3g -o loop /media/decrypt/dislocker-file /media/windows-mount`


For exFAT, use:

`sudo mount -t exFAT-fuse -o loop /media/decrypt/dislocker-file /media/windows-mount`


### Unmount the Windows partition

You can unmount the mounted partition from the file manager. Just **click the unmount symbol** beside the partition named windows-mount.

Otherwise, unmount command is always there for you.

```
sudo umount /media/decrypt
sudo umount /media/windows-mount
```


I hope it helps you. If you still have questions or suggestions, please let me know in the comments.