【问题标题】:Mount disk image on WSL (Windows subsystem for Linux)? [closed]在 WSL(Linux 的 Windows 子系统)上挂载磁盘映像? [关闭]
【发布时间】:2019-05-21 07:15:35
【问题描述】:

我使用的是 Ubuntu,并使用以下命令创建了系统 SSD 硬盘的完整副本:

dd if=/dev/sda of=ubuntu.iso

并将其保存在 NTFS 驱动器的备份 HDD 上。

我现在使用的是 Windows 10 PRO,并希望使用 WSL (Ubuntu 18.04) 挂载此映像。这是我正在使用的命令:

sudo mount -o ro,loop,offset=1048576 /mnt/a/ubuntu.iso /mnt/ubuntu_backup

这是我得到的错误:

 mount: /mnt/ubuntu_backup: mount failed: Operation not permitted.

同样的命令也适用于 Ubuntu。

是否可以使用 WSL 挂载此映像?

【问题讨论】:

  • 目前显然不支持循环设备:Link

标签: windows windows-10 filesystems mount windows-subsystem-for-linux


【解决方案1】:

尝试将 ISO 文件复制到计算机上的文件夹中(不在 WSL 中),然后使用 Windows 资源管理器安装 ISO。之后,使用

sudo mount -t drvfs [drive letter of your ISO]: /where/you/want/to/mount/it

对你来说是

cp /mnt/a/ubuntu.iso /mnt/[home drive letter, most likely C, lowercase]/wherever/you/want/to/put/it

然后运行explorer.exe,导航到您将ISO复制到的文件夹,挂载ISO,记录驱动器号,然后键入

sudo mount -t drvfs [drive letter of your ISO]: /where/you/want/to/mount/it

这应该为您提供相同的功能。之后会说

安装:/home/vishal/custom-iso/mnt:警告:设备写保护, 以只读方式安装。

这是在 WSL 1 中,而不是在 WSL 2 中,但我怀疑它会以相同的方式工作。事实上,我认为 WSL 2 会更容易挂载 ISO,因为它本质上是它自己的独立虚拟机。使用 Powershell,我能够将物理驱动器挂载到它,所以我认为在 WSL 2 中正确挂载 ISO 没有问题

【讨论】:

  • 该文件以 .iso 扩展名命名,但它不是 ISO 文件,只是磁盘的原始映像。
  • 常规方式:- mount -o - 循环不起作用,这是解决 forWSL 的一项出色工作
猜你喜欢
  • 2019-04-15
  • 2017-10-01
  • 2014-04-15
  • 1970-01-01
  • 2021-05-05
  • 1970-01-01
  • 2019-07-03
  • 1970-01-01
  • 2020-12-10
相关资源
最近更新 更多