How to make ISOs in Just Two Lines of Code ?

This method is applicable for only Linux distros however this can be dangerous if not followed stepwise

Shubhayan S
Dataly

--

Linux Terminal

Almost everyday there are people shifting towards Linux Distros but what makes them so special that developers are preferring more ; one of the primary reasons are due to privacy, ease of installation and minimum system requirements.

Not many GUI choices are available when it comes to generating the bootable image of Linux distributions. If you use Linux Mint or its’ derivatives, you can find mintstick to be a great tool. Or GNOME MultiWriter might be useful for any other Linux distributions. But I prefer the little ol’ disk drive burner command.

I’ll assume you have an ISO image file on any Linux distribution on your PC to keep this tutorial easy. Let’s say the ISO file is stored in your Downloads folder.

Step 1 : Plug in USB flash Drive

Assuming, the size of the ISO image is about 3 GB. You thus need to ensure that your USB flash drive is larger than 3 GB.USB flash drives standard are available with 2 GB or more. If your ISO image is 3 GB you need a USB flash drive of 4 GB or more to pick from. Say, your USB flash drive is 64GB in size.

Step 2: Open your Terminal in Linux

Open terminal in your Home and type your first command to list out the drives connected to PC .

sudo fdisk -l
64GB Pendrive Path (Image by Author)

On typing the command, you will see the path of your flash drive which is /dev/sdc in my case. You can also check the Flash Drive name as “Flash-Disk” in my case.

Next step is type the command for selecting ISO file and burning it to your USB drive. The basic strcuture of dd command for our purpose is like this:

sudo dd if=<iso-file-name> of=<flash-drive-path> status=progress bs=<byte-size> && sync
  • iso-file-name — Here, give the ISO file name and make sure its located in same path where the terminal is opened. For example kali-linux-2020.3-live-amd64.iso in my case.
  • flash-drive-path — Here, give the path of your flash drive and make sure its exactly as shown in your terminal. For example /dev/sdc in my case.

[Caution: Mistake in flash drive path can cause permanent deletion of your drive. So, be cautious in giving the path]

  • byte-size — It tells dd to read/write in 4 megabyte chunks. It ensures better performance. It doesnt matter how much size is given as generally more the byte size faster the write speed.
  • Sync makes it possible to flush out all writes before returning the command.

Summing it up here is what the command looks in my case.

sudo dd if=kali-linux-2020.3-live-amd64.iso of=/dev/sdc status=progress bs=1048576 && sync
dd Burner of ISO (Image by Author)

This should do the job. It will take some time to complete the ISO picture on your USB flash drive. The dd command does not tell you that the ISO image file has been successfully completed. Instead, the command would be executed and the command prompt returned. The prompt command would mean a task was done using the dd command. You can now use it as a live bootable USB flash drive or for installing a new Operating System in your machine.

Hope this helps! Please feel free to give me claps and follow me for more such articles.

--

--

Shubhayan S
Dataly
Writer for

People say ML and AI is the future of our generation but I believe it's much more than that. Well, I plan on integrating ML, Web and AI in the future.