We'll see how to create a bootable Linux/Ubuntu USB drive, from an ISO image, on OS X using command line commands.
Step 1: Download the Ubuntu Image
The first step is to download the Ubuntu image from the official website. Live CD images allow to run Ubuntu without installing it. Here, we'll use an old Ubuntu 16 image from https://releases.ubuntu.com/xenial/: ubuntu-16.04.6-desktop-i386.iso
Step 2: Identify the USB Drive
Next you'll need to identify the USB drive that you want to use for the installation. You can do this by opening up a Terminal window and typing:
$ diskutil list
This command will list all of the disks currently connected to your computer. Identify the USB drive that you want to use for the installation and take note of its device identifier (e.g., /dev/disk2).
Step 3: Unmount the USB Drive
Before you can write the Ubuntu image to the USB drive, you need to make sure that it's unmounted. To do this, type the following command into the Terminal:
$ diskutil unmountDisk /dev/disk2
Note: Make sure to replace /dev/disk2 with the device identifier of your USB drive.
Step 4: Write the Ubuntu Image to the USB Drive
Now that your USB drive is unmounted, you can write the Ubuntu image to it using the dd command. Type the following command into the Terminal:
$ sudo dd if=~/Downloads/ubuntu-16.04.6-desktop-i386.iso of=/dev/rdisk2 bs=1048576
Note: Make sure to replace ~/Downloads/ubuntu-16.04.6-desktop-i386.iso with the path to the Ubuntu image on your computer, and /dev/rdisk2 with the device identifier of your USB drive.
The dd command will take some time to complete, so be patient. Once it's finished, you should see a message indicating how many bytes were transferred.
Step 5: Eject the USB Drive
Finally, you need to eject the USB drive to ensure that all of the data has been written correctly. Type the following command into the Terminal:
$ diskutil eject /dev/disk2
Note: Make sure to replace /dev/disk2 with the device identifier of your USB drive.
That's it! You've successfully created a bootable Ubuntu USB drive using command line commands on OS X. You can now use this USB drive to install or run Ubuntu on any computer that supports booting from USB.
Source: https://thornelabs.net/posts/create-a-bootable-ubuntu-usb-drive-in-os-x/
No comments:
Post a Comment