This article is about my experience of making a bootable usb of Arch linux on macOS.
Downloading the Arch Linux ISO and Verifying It #
-
Download the ISO File:
Head over to the official Arch Linux download page and find a mirror that’s closest to your location. Download the latest Arch Linux ISO from there.
-
Get the PGP Signature:
On the same page, look for the PGP signature file (it ends with
.sig
) corresponding to the ISO you’ve downloaded. Grab that file too. -
Place Both Files Together:
Make sure both the ISO file and its
.sig
signature file are in the same directory. It’ll make the verification process smoother. -
Retrieve the Signing Key:
Open Terminal and run the following command to fetch the public key of the Arch Linux developer who signed the ISO:
gpg --auto-key-locate clear,wkd -v --locate-external-key pierre@archlinux.de
-
Verify the ISO:
Next, verify the integrity and authenticity of the ISO file by running:
gpg --keyserver-options auto-key-retrieve --verify archlinux-2023.10.01-x86_64.iso.sig archlinux-2023.10.01-x86_64.iso
- Replace
archlinux-2023.10.01-x86_64.iso
and.sig
with the actual filenames if they’re different. - If everything checks out, you’ll see a message like
Good signature from "Pierre Schmitz <pierre@archlinux.de>"
, which means your ISO is legit!
- Replace
Creating a Bootable USB Drive #
Method 1: Using the Command Line #
-
Ensure You Have the ISO File:
Make sure you’ve downloaded the ISO file of the Linux distribution you want to install (we’re using Arch Linux here).
-
Insert Your USB Drive:
Plug your USB drive into your Mac.
-
Identify Your USB Drive:
Open Terminal and type:
diskutil list
Look through the list to find your USB drive and note its device identifier (something like
/dev/disk2
). -
Unmount the USB Drive:
Run:
diskutil unmountDisk /dev/diskX
- Replace
X
with your USB drive’s disk number.
- Replace
-
Write the ISO to the USB Drive:
Now, be very careful with this command:
sudo dd if=/path/to/archlinux.iso of=/dev/rdiskX bs=1m
- Replace
/path/to/archlinux.iso
with the path to your downloaded ISO file. - Replace
X
with your USB drive’s disk number. - Using
rdiskX
(the raw disk device) can speed up the process a bit.
Enter your password when prompted.
- Replace
A Few Tips:
- Check Progress:
dd
doesn’t show progress by default. If you’re curious, pressCtrl + T
to get a status update. - Double-Check the Disk Number: Accidentally writing to the wrong disk can be disastrous. Make sure you’re targeting the correct drive.
- Be Patient: The process can take several minutes, so don’t panic if it seems like nothing is happening.
Method 2: Using a GUI Tool (USBImager) #
If you prefer a graphical interface, you can use USBImager.
-
Download USBImager:
Visit the USBImager GitLab repository and download the macOS version of the tool.
-
Fix Permission Issues (If Any):
You might run into permission errors when launching USBImager. Here’s how to fix it:
-
Option 1: Temporarily set the
SUDO_ASKPASS
environment variable:export SUDO_ASKPASS=/usr/local/bin/askpass
-
Option 2: Permanently set it by adding the line above to your shell configuration file (like
~/.zshrc
or~/.bash_profile
). Then reload your shell:source ~/.zshrc # or source ~/.bash_profile
You can confirm it’s set by running:
echo $SUDO_ASKPASS
-
-
Launch USBImager with sudo:
sudo /Applications/USBImager.app/Contents/MacOS/usbimager
You’ll be prompted for your password.
-
Create the Bootable USB:
- Open USBImager.
- Select the ISO file you’ve downloaded.
- Choose your USB drive as the target.
- Click Write.
- The tool will write the ISO to your USB drive and verify it afterwards.
Restoring Your USB Drive for Regular Use #
After you’re done installing Arch Linux, you might want to use your USB drive for regular storage again. Here’s how to reset it:
-
Insert the USB Drive:
Plug the USB drive back into your Mac.
-
Identify the USB Drive:
In Terminal, run:
diskutil list
Note the device identifier for your USB drive.
-
Unmount the USB Drive (Optional):
macOS usually does this automatically, but if needed:
diskutil unmountDisk /dev/diskX
Replace
X
with your disk number. -
Erase and Reformat the USB Drive:
Run:
diskutil eraseDisk FAT32 USB_DRIVE MBR /dev/diskX
- FAT32: This sets the file system to FAT32. You can use
ExFAT
orMS-DOS
if you prefer. - USB_DRIVE: Choose a name for your USB drive.
- MBR: This sets the partition scheme to Master Boot Record.
- Replace
/dev/diskX
with your USB drive’s device identifier.
- FAT32: This sets the file system to FAT32. You can use
And that’s it! Your USB drive is now formatted and ready to be used like any regular storage device.