# Creating a Bootable Debian USB Drive on macOS

**Prerequisites:**

- Debian ISO image (downloaded from https://www.debian.org/)
- USB drive with sufficient capacity (at least 4GB)
- macOS computer

**Steps:**

1. **Identify the USB drive's disk identifier:**

  - Open Terminal and run `diskutil list`.
  - Locate the entry for your USB drive and note its disk identifier (e.g., `disk4`).

2. **Unmount the USB drive:**

  - Run `diskutil unmountDisk /dev/diskX` (replace `X` with the correct disk identifier).

3. **Write the ISO to the USB drive:**

  - **With progress bar:**
    ```bash
    sudo dd if=/path/to/debian.iso of=/dev/rdiskX bs=1m status=progress
    ```
  - **Without progress bar:**
    ```bash
    sudo dd if=/path/to/debian.iso of=/dev/rdiskX bs=1m
    
  - Replace `/path/to/debian.iso` with the actual path to your ISO file.

4. **Wait for the process to complete:**

  - This might take a few minutes, depending on the ISO size and USB speed.

5. **Verify the process (optional):**

  - Run `diskutil list` again to check if the ISO was written correctly.

6. **Eject the USB drive:**

  - Run `diskutil eject /dev/diskX`.

**Additional notes:**

- **Password prompt:** You'll be prompted for your password when using `sudo`.
- **Double-check disk identifier:** Ensure you're using the correct one to avoid overwriting data.
- **Errors:** If you encounter errors, carefully review the commands and disk identifiers. Seek assistance if needed.
- **Progress bar options:**
  - `status=progress`: Basic progress bar within the `dd` command.
  - `pv`: Pipe the output of `dd` through `pv` for a visual progress bar.
  - `dialog`: Combine `pv` with `dialog` for a more interactive progress bar.

**Booting from the USB drive:**

1. Insert the USB drive into the target computer.
2. Start or restart the computer.
3. Hold down the Option (⌥) key while booting.
4. Select the USB drive labeled "EFI Boot" from the Startup Manager.
5. The Debian installation process will begin.