You’ve downloaded Ubuntu ISO from a mirror and want to test or install it to your computer. There are many ways to do this but I’ll share my method which requires no additional tools or software in this post. Additionally you can use this method in order to create bootable USBs for other ISOs if your ISO is hybrid image.
Unlike other methods my method does not require other tools or software to create that bootable USB, in fact it only uses dd command that is standard in Linux.
After 12.04 (I guess) all Ubuntu ISOs are hybrid ISO. This means when you dd the ISO directly to USB device then your USB will be bootable already. That’s that much easy.
But there is an important point in that process. dd command may be destructive if your destination device is not correct. So to ensure the device you double check your destination with the commands:
lsusb lsblk dmesg fdisk
whichever gives you the precise information that you make sure it is the correct device.
After this short information I’ll give command to create (prepare) bootable USB below:
dd if=<iso-file> of=<destination-device> oflag=direct bs=8M
in that command if is the hybrid iso (remember your ISO files are already hybrid for the releases after 12.04).
of is the output device. Note that it is the device not the partition. For example it will be: /dev/sdb is an device and if it is your destination device it is a valid entry. But /dev/sdb1 is a partition and even /dev/sdb is your destination device giving /dev/sdb1 for of parameter will not create a bootable USB because /dev/sdb1 is a partition. So this parameter has to be device not partition.
oflag ensures caching of block device is turned of while executing dd.
bs is the block size and 8M is a fairly good parameter for the command.
For an example, if your device is /dev/sdb and you’re creating a bootable USB from ubuntu-16.04.1-desktop-amd64.iso then your command would be:
dd if=ubuntu-16.04.1-desktop-amd64.iso of=/dev/sdb oflag=direct bs=8M
Note that you may need to use sudo with that command.