use*_*RTY 8 windows filesystems mount windows-10 windows-subsystem-for-linux
我正在使用Ubuntu,并使用以下命令创建了系统SSD硬盘的完整副本:
dd if=/dev/sda of=ubuntu.iso
Run Code Online (Sandbox Code Playgroud)
并将其保存在作为NTFS驱动器的备份HDD上。
我现在在Windows 10 PRO上,并希望使用WSL(Ubuntu 18.04)挂载此映像。这是我正在使用的命令:
sudo mount -o ro,loop,offset=1048576 /mnt/a/ubuntu.iso /mnt/ubuntu_backup
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
mount: /mnt/ubuntu_backup: mount failed: Operation not permitted.
Run Code Online (Sandbox Code Playgroud)
相同的命令在Ubuntu上也有效。
是否可以使用WSL挂载该映像?
小智 5
尝试将 ISO 文件复制到计算机上的文件夹中(不在 WSL 内),然后使用 Windows 资源管理器装载 ISO。之后,使用
sudo mount -t drvfs [drive letter of your ISO]: /where/you/want/to/mount/it
Run Code Online (Sandbox Code Playgroud)
对你来说那就是
cp /mnt/a/ubuntu.iso /mnt/[home drive letter, most likely C, lowercase]/wherever/you/want/to/put/it
Run Code Online (Sandbox Code Playgroud)
然后运行explorer.exe,导航到将 ISO 复制到的文件夹,安装 ISO,记录驱动器盘符,然后键入
sudo mount -t drvfs [drive letter of your ISO]: /where/you/want/to/mount/it
Run Code Online (Sandbox Code Playgroud)
这应该为您提供相同的功能。之后,它会说
安装:/home/vishal/custom-iso/mnt:警告:设备写保护,安装为只读。
这是在 WSL 1 中,而不是在 WSL 2 中,但我怀疑它会以相同的方式工作。事实上,我认为 WSL 2 会更容易挂载 ISO,因为它本质上是它自己的独立虚拟机。使用 Powershell,我能够将物理驱动器安装到它,因此我认为在 WSL 2 中正确安装 ISO 没有问题