Creating a CentOS 8 Bootable USB on macOS
This guide walks through downloading a CentOS 8 ISO, verifying its signature and checksum, and writing it to a USB drive — all from macOS.
Update: CentOS 8 reached end of life in December 2021, and the original mirrors are gone. The download links below now point to vault.centos.org, where the old releases are archived. The process itself works the same for any ISO.
Verify the Signing Key
Before trusting the downloaded files, verify they were signed by CentOS. Grab the official signing key from centos.org/keys.
1 | wget https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official
|
Check that the key’s fingerprint matches the one published on the keys page.
1 2 3 4 | $ gpg --show-keys --fingerprint RPM-GPG-KEY-CentOS-Official pub rsa4096 2019-05-03 [SC] 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D uid CentOS (CentOS Official Signing Key) <[email protected]> |
If the fingerprint matches, import the key into your keyring.
1 | gpg --import ./RPM-GPG-KEY-CentOS-Official |
Download and Verify the ISO
Download the ISO and its signed checksum file from the vault.
1 2 | wget https://vault.centos.org/8.0.1905/isos/x86_64/CentOS-8-x86_64-1905-dvd1.iso wget https://vault.centos.org/8.0.1905/isos/x86_64/CHECKSUM.asc |
Verify that the checksum file was signed with the key you just imported.
1 | gpg --verify ./CHECKSUM.asc |
Now verify the ISO against the checksum. macOS doesn’t ship sha256sum, but coreutils from brew provides it.
1 2 3 | $ brew install coreutils $ sha256sum -c CHECKSUM.asc 2>&1 | grep OK CentOS-8-x86_64-1905-dvd1.iso: OK |
Build the Bootable Media
Plug in the USB drive and identify its disk identifier — look for the external, physical disk matching its size. Here it’s disk2.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | $ diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *500.3 GB disk0 1: EFI EFI 314.6 MB disk0s1 2: Apple_APFS Container disk1 499.8 GB disk0s2 /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +499.8 GB disk1 Physical Store disk0s2 1: APFS Volume Macintosh SSD - Data 198.7 GB disk1s1 2: APFS Volume Preboot 84.4 MB disk1s2 3: APFS Volume Recovery 528.5 MB disk1s3 4: APFS Volume VM 5.4 GB disk1s4 5: APFS Volume Macintosh SSD 10.9 GB disk1s5 /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *30.8 GB disk2 1: EFI EFI 209.7 MB disk2s1 2: Microsoft Basic Data Untitled 30.5 GB disk2s2 |
Unmount the drive’s volumes (this leaves the device itself available for writing).
1 2 | $ diskutil unmountDisk /dev/disk2 Unmount of all volumes on disk2 was successful |
Copy the image to the USB with dd. Note the r in /dev/rdisk2 — the raw device bypasses macOS buffering and writes several times faster. Double-check the disk number; dd will happily overwrite the wrong disk.
1 2 3 4 | $ sudo dd if=CentOS-8-x86_64-1905-dvd1.iso of=/dev/rdisk2 bs=1m 6805+0 records in 6805+0 records out 7135559680 bytes transferred in 448.409708 secs (15913036 bytes/sec) |
Once dd finishes, eject the drive with diskutil eject /dev/disk2 and it’s ready to boot.