قالب وردپرس درنا توس
Home / Tips and Tricks / To burn an ISO file to a USB device in Linux

To burn an ISO file to a USB device in Linux



  Plugging a USB flash drive into a laptop
Alexey Rotanov / Shutterstock

Linux users traditionally burned ISO files to DVD or CD, but many computers no longer have disk drives. Creating a bootable USB device is a better solution. It works on most computers and starts, runs and installs faster.

How bootable Linux USB devices work

As a live CD or DVD, a bootable USB device can let you run virtually on any Linux distribution without affecting your computer. You can also install a Linux distribution on your computer from it ̵

1; no CD or DVD drive is required. You cannot just copy or extract the ISO file to the USB device and expect it to work. While you are not technically burning the ISO file to a USB device, a special process is needed to take a Linux ISO file and make a bootable USB device with it.

There are two ways to do this: Some Linux distributions include a graphical USB startup disk creator tool that will do it for you. You can also use the dd command to do so from a terminal on any Linux distro. No matter which method you choose, you need the Linux distribution's ISO file.

For example, Ubuntu Linux has two built-in methods for creating a bootable USB device. A bootable USB device gives the user the same experience as a Ubuntu Live DVD. It allows you to try the popular Unix-like operating system without changing your computer. When you are ready to install Ubuntu, you can use the USB device as the installation medium.

You need an ISO image for Ubuntu installation to create the bootable USB device, so make sure you have downloaded the version of Ubuntu you want to use.

To be clear, this bootable USB device will boot into a copy of Ubuntu Linux but it does not save any changes you make. Every time you start in Ubuntu from this USB device, it will be a new instance of Ubuntu. If you want to be able to save changes and data, you need to create a bootable USB device with permanent storage.

Just insert the resulting USB device into any computer and boot from the USB device. (On some computers, you may also need to disable Secure Boot, depending on which Linux distribution you choose.)

While using Ubuntu as an example, it works the same as other Linux distributions.

How to make a bootable USB device graphically

The standard Ubuntu installation contains a program called Startup Disk Creator, which we will use to create our bootable USB device. If you use another Linux distribution, it may contain a similar tool.

For Windows users, we recommend Rufus to easily create a USB device.

Warning : This will erase the contents of the target USB device. To ensure that you accidentally do not write the wrong USB device, we recommend that you remove other connected USB devices before proceeding.

For USB devices, all USB devices with a capacity of 4 GB or more should be good. If your optional Linux ISO is larger than what is the most, you may need a larger USB device.

When you are sure that the correct USB device is the only one connected to the computer, start the Startup Disk Creator. To do so, press the Super key (that is, the Windows key on most keyboards) and type "start disk". The boot disk drive icon is created. Click the icon or press Enter.

 boot disk creator icon

The home screen creator's main window appears. The USB device will be highlighted in the lower box.

 boot disk creator with USB device highlighted

Click on the "Other" button. A default file dialog opens. Browse to the location of your Ubuntu ISO file, select it and click the "Open" button.

 file opening dialog

The boot disk start window should now resemble the screenshot below. There should be an ISO image marked in the top box and a USB device marked in the lower box.

 boot disk creator with ISO and USB device selected

Confirm that the ISO image and USB device are correct. Click on the "Start Diskette" button when you are happy to continue.

A warning appears to remind you that the USB device will be completely dried. This is your last chance to back out without making any changes to the USB device.

 warning message yes no dialog

A progress bar shows how close the creation is to completion.

 Click the button

A confirmation message seems to let you know when the creation of the bootable USB device has been completed completely. On the computer we used for this article, the process took about five minutes.

 Creative Completed Message

Click the "Cancel" button. You can now either restart the computer and boot from the USB device or unplug the USB device, take it to another computer and start it there.

How to make a bootable USB device with dd

The tool we Use to create bootable drive from the command line is the command dd .

Warning : The command must be used very carefully. dd will do exactly what you tell as soon as you say so. There are no "Are you unsure" questions or chances to back up. dd just goes right and executes the instructions you have given it. So we have to be very careful that what we say is definitely what we want it to do.

We need to know which device your USB device is associated with. That way, you know for sure which unit identity is to be transferred to dd on the command line.

In a terminal window, type the following command. The lsblk command lists the block units on your computer. Each unit has a block unit associated with it.

  lsblk 

  lsblk in a terminal window

The output of lsblk shows the devices currently connected to your computer. There is an internal hard drive on this machine called sda and there is a partition on it called sda1 .

 output from lsblk in a terminal window [19659006] Connect your USB device and use the command lsblk again. The output of lsblk will have changed. The USB device will now be listed in the output.

 the output of lsblk with USB device in a terminal window

There is a new entry in the list named sdb and it has two partitions on it. One partition is called sdb1 and is 1 KB in size. The second partition is called sdb5 and is 14.6 GB in size.

It is our USB device. The identifier we need to use is the one representing the device, not one of the partitions. In our example, this is sdb . No matter how it is named on your computer, the device must not be in the previous lsblk listing the USB device.

The command we will issue to dd is the following:

  sudo dd bs = 4M if = Downloads / ubuntu-19.04-desktop-amd64.iso of = / dev / sdb conv = fdatasync

  dd command in a terminal window

Let's break it down.

  • sudo : You must be a super user to issue dd commands.
  • dd : The name of the command we use.
  • bs = 4M : The option -bs (blockize) defines the size of each bit read from the input file and wrote to the output unit. 4 MB is a good choice because it provides a decent throughput and it is an exact multiple of 4 KB, which is the block size of the ext4 file system. This provides an effective reading and writing speed.
  • about = Downloads / ubuntu-19.04-desktop-amd64.iso : The -if (input file) option requires the path and name of the Linux ISO image that you use as the input file.
  • of = / dev / sdb : -of (output file) is the critical parameter. This must be provided with the device representing your USB device. This is the value we identified using the command lsblk earlier. in our example it is sdb so we use / dev / sdb . Your USB device may have a different identifier. Make sure you enter the correct identifier.
  • conv = fdatasync : The parameter conv dictates how dd converts the input file as it is written to the output unit. dd uses core caching when writing to the USB device. The data sync [modifier] ensures that the write buffers are flushed properly and completely before the creation process is flagged as clear.

There is no visible feedback from dd at all because creation progresses take place. It goes to work and does not report anything until it is ready.

When the bootable USB device has been created dd the amount of data written to the USB device, the elapsed time in seconds and the average data transfer rate are reported.

 creative summary message

You can check bootable USB device works by restarting the computer and booting from the USB device, or you can try to boot from it into another computer.

You now have a portable working copy of Ubuntu or other Linux distribution of your choice. It will be untouched every time you start it, and you can start it on virtually any computer you want.




Source link