Системные вызовы Linux на C в OSX

Разобрался. Это двухэтапный процесс.

Шаг 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

Шаг 1b. (Big Sur) Загрузите расширение ядра CD9660

# Load the kext module
sudo kmutil load -p /System/Library/Extensions/cd9660.kext

Шаг 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

Шаг 3. Отключите диск

# this will fail if the disk is being used
$ umount /dev/disk2

Шаг 4. Отсоедините диск

$ hdiutil detach /dev/disk2
"disk2" unmounted.
"disk2" ejected.
2
03.09.2015, 05:48
0 ответов

Теги

Похожие вопросы