Macでのインストールメディアの作り方

1. ディスクイメージを作成

ubuntu からダウンロードしてきたISOイメージ(*.iso)からディスクイメージ(*.dmg)を作成する.

hatai@MacBook-Air ~ % cd Downloads 
hatai@MacBook-Air Downloads % ls
ubuntu-23.10.1-desktop-amd64.iso
hatai@MacBook-Air Downloads % hdiutil convert -format UDRW -o ubuntu-23.10.1-desktop-amd64.img ubuntu-23.10.1-desktop-amd64.iso
Protective Master Boot Record(MBR: 0)を読み込み中…
GPT Header(Primary GPT Header: 1)を読み込み中…
GPT Partition Data(Primary GPT Table: 2)を読み込み中…
ISO9660(DOS_FAT: 3)を読み込み中…
...............................................................................
Appended2(C12A7328-F81F-11D2-BA4B-00A0C93EC93B: 4)を読み込み中…
...............................................................................
Gap1(DOS_FAT: 5)を読み込み中…
...............................................................................
Ubuntu 23.10.1 amd64            (Apple_ISO: 6)を読み込み中…
...............................................................................
GPT Partition Data(Backup GPT Table: 7)を読み込み中…
...............................................................................
GPT Header(Backup GPT Header: 8)を読み込み中…
...............................................................................
経過時間:  7.362s
速度: 670.2Mバイト/秒
節約率: 0.0%
created: /Users/hatai/Downloads/ubuntu-23.10.1-desktop-amd64.img.dmg
hatai@MacBook-Air Downloads % ls
ubuntu-23.10.1-desktop-amd64.img.dmg
ubuntu-23.10.1-desktop-amd64.iso

2. USBメモリーに書き込む

2.1. 接続したUSBメモリーのデバイスファイル名を確認

インストールメディアに使用するUSBメモリーを接続し,デバイスファイル名を特定する.下記の例では /dev/disk4 とわかる.

hatai@MacBook-Air Downloads % diskutil list         
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:             Apple_APFS_ISC Container disk2         524.3 MB   disk0s1
   2:                 Apple_APFS Container disk3         994.7 GB   disk0s2
   3:        Apple_APFS_Recovery Container disk1         5.4 GB     disk0s3

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +994.7 GB   disk3
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            10.1 GB    disk3s1
   2:              APFS Snapshot com.apple.os.update-... 10.1 GB    disk3s1s1
   3:                APFS Volume Preboot                 6.0 GB     disk3s2
   4:                APFS Volume Recovery                921.1 MB   disk3s3
   5:                APFS Volume Data                    479.2 GB   disk3s5
   6:                APFS Volume VM                      20.5 KB    disk3s6

/dev/disk4 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *62.0 GB    disk4
   1:             Windows_FAT_32                         62.0 GB    disk4s1

2.2. USBメモリーを unmount する

インストールメディアを unmount する(物理的には接続されている状態でOSからは通常の記憶装置としては使用できない状態にする).

フォーマットの仕方によって,ひとつの論理ボリュームをアンマウントする diskutil unmount を使う場合とディスク装置全体をアンマウントする diskutil unmountDisk の場合がある. まぁしかし,下記のようにとりあえず unmount しようとしてちがっていれば unmountDisk しろと教えてくれるので,指示にしたがえばよい.

hatai@MacBook-Air Downloads % diskutil umount /dev/disk4
disk4 was already unmounted or it has a partitioning scheme so use "diskutil unmountDisk" instead
hatai@MacBook-Air Downloads % diskutil umountDisk /dev/disk4
Unmount of all volumes on disk4 was successful  

2.3. ディスクイメージをUSBメモリーに書き込む

hatai@MacBook-Air Downloads % sudo dd if=./ubuntu-23.10.1-desktop-amd64.img.dmg of=/dev/disk4 bs=1024
Password:
5052730+0 records in
5052730+0 records out
5173995520 bytes (5.2 GB, 4.8 GiB) copied, 984.807 s, 5.3 MB/s
hatai@MacBook-Air Downloads %  

参考文献


はたいたかし
https://exlight.net/
2024-02-02.