在 OS X Yosemite (v10.11.5) 上工作,我无法挂载 Debian 安装程序 ISO(Debian 下载页面上的 debian-8.5.0-amd64-CD-1.iso )。我收到这个错误...
$ hdiutil mount debian-8.5.0-amd64-CD-1.iso
hdiutil: mount failed - no mountable file systems
Run Code Online (Sandbox Code Playgroud)
作为一种解决方法,我可以按照Debian 安装程序文档中的“创建映像副本”步骤将 CD 安装到 Linux VM 中。
是否可以在没有 Linux VM 的帮助下直接从 Mac 读取文件内容?最终,我要做的是编写一个脚本,该脚本可以下载最新的稳定 ISO,使用预查看数据编辑 ISO,然后在 VM 上执行 Debian 的自动安装。这主要用于学习目的,但在未来可能会有用。
pop*_*nja 14
弄清楚了。这是一个两步过程。
步骤 1. 作为块设备附加
# the '-nomount' option avoids the 'mount failed' error
$ hdiutil attach -nomount debian-8.5.0-amd64-CD-1.iso
/dev/disk2 Apple_partition_scheme
/dev/disk2s1 Apple_partition_map
/dev/disk2s2 Apple_HFS
# verify disk is a block device (indicated by 'b' at line start)
$ ls -l /dev/disk2
br--r----- 1 amorphid staff 1, 5 Jul 27 19:41 /dev/disk2
Run Code Online (Sandbox Code Playgroud)
步骤 1b。(Big Sur) 加载CD9660内核扩展
# Load the kext module
sudo kmutil load -p /System/Library/Extensions/cd9660.kext
Run Code Online (Sandbox Code Playgroud)
步骤 2. 使用 cd9660(又名 ISO9660)文件系统挂载磁盘
# create mount point
$ mkdir -p /tmp/debian-installer
# mount the disk
$ mount -t cd9660 /dev/disk2 /tmp/debian-installer
# see da filez!
$ ls -l /tmp/debian-installer
total 2296
-r--r--r-- 1 root wheel 9468 Jun 4 09:24 README.html
-r--r--r-- 1 root wheel 185525 Jun 1 00:52 README.mirrors.html
-r--r--r-- 1 root wheel 100349 Jun 1 00:52 README.mirrors.txt
-r--r--r-- 1 root wheel 461 Jun 4 08:37 README.source
-r--r--r-- 1 root wheel 6000 Jun 4 09:24 README.txt
-r--r--r-- 1 root wheel 146 Jun 4 08:37 autorun.inf
dr-xr-xr-x 1 root wheel 2048 Jun 4 08:37 boot
dr-xr-xr-x 1 root wheel 2048 Jun 4 08:37 css
lr-xr-xr-x 1 root wheel 1 Jun 4 08:37 debian -> .
dr-xr-xr-x 1 root wheel 2048 Jun 4 08:37 dists
dr-xr-xr-x 1 root wheel 4096 Jun 4 08:37 doc
dr-xr-xr-x 1 root wheel 2048 Jun 4 08:37 efi
dr-xr-xr-x 1 root wheel 2048 Jun 4 08:37 firmware
-r--r--r-- 1 root wheel 180335 Jun 2 03:18 g2ldr
-r--r--r-- 1 root wheel 8192 Jun 2 03:18 g2ldr.mbr
dr-xr-xr-x 1 root wheel 2048 Jun 4 08:37 install
dr-xr-xr-x 1 root wheel 2048 Jun 4 08:37 install.amd
dr-xr-xr-x 1 root wheel 4096 Jun 4 08:37 isolinux
-r--r--r-- 1 root wheel 275432 Jun 4 09:24 md5sum.txt
dr-xr-xr-x 1 root wheel 4096 Jun 4 08:37 pics
dr-xr-xr-x 1 root wheel 2048 Jun 4 08:37 pool
-r--r--r-- 1 root wheel 368480 Jun 2 03:18 setup.exe
dr-xr-xr-x 1 root wheel 2048 Jun 4 08:37 tools
-r--r--r-- 1 root wheel 233 Jun 4 08:37 win32-loader.ini
Run Code Online (Sandbox Code Playgroud)
步骤 3. 卸载磁盘
# this will fail if the disk is being used
$ umount /dev/disk2
Run Code Online (Sandbox Code Playgroud)
步骤 4. 分离磁盘
$ hdiutil detach /dev/disk2
"disk2" unmounted.
"disk2" ejected.
Run Code Online (Sandbox Code Playgroud)