- Make a bootable USB drive on any Linux distro
- Make a bootable USB drive in Linux
- Options explained:
- Restore the USB drive
- Conclusion
- How to write/create a Ubuntu .iso to a bootable USB device on Linux using dd command
- Step 1: Find your usb device name
- Step 2: Create a bootable USB stick on Linux
- Ubuntu to create a bootable Ubuntu USB flash drive from terminal
- Another example
- Understanding dd command options
- Step 3: You are done
- Conclusion
- How to Create Linux Bootable USB from Linux Command-Line
- Step to Create Bootable Linux USB:
- How to Create Bootable USB from ISO using Linux Terminal
- Check USB Drive
- Download Linux ISO File
- Create Bootable Drive from Terminal
- Conclusion
- How to Create a Bootable USB Stick from the Ubuntu Terminal
- Step 1: Download the Ubuntu ISO file
- Step 2: Open the Terminal
- Step 3: Unmount the USB if it is mounted
- Step 4: Create a bootable Ubuntu stick
- Karim Buzdar
Make a bootable USB drive on any Linux distro
In this post, you will learn how to make a bootable USB drive in Linux system using the native Linux tools.
I know that many of you are scared of the Linux command line. Of course, you can use graphical programs to make a bootable USB in Linux. But believe me, you will benefit so much if learn the Linux command line tools. For example, if you need to make a bootable USB drive in Linux, different distributions provide different graphical programs to do that, but every Linux distribution has the same built-in tool to do the same job. So, you will benefit for it long-term.
Make a bootable USB drive in Linux
To make a bootable USB drive in Linux, you just need to learn one simple command. The command is dd .
Options explained:
sudo means to give admin privileges to this command.
dd is the program name.
bs=4M means to use a block size of 4M, so the system will read and write the data in chunks of 4M. This option is simply meant to speed up the process.
if specifies the source to read. Simply put, this is an ISO file of the Linux image you download from the Linux distribution website.
path-to-the-ISO — path to the ISO file. For example,
of specified the destination or where to write this ISO file. In other words, it is your USB drive. This is the most important part of the command, If you do mistake here, you can screw up your whole system. So, be very-very careful.
/dev/sdX means the name assigned to a device by your Linux system. It is some kind of analogy of disks C, D, E in Windows systems.
To find out the name Linux assigned to your flash drive, run this command:
Then you need to analyze the output like the one above. Usually, the USB devices are listed at the end. You find your flash drive by its size. It usually has only one partition. I know that my flash drive is 15Gb. So, its name is sdd. This name is not permanent and it depends on the order the drives are mounted to the system. So, you need to check your USB drive name every time you insert it into the computer
status=progress is not necessary. However, it is helpful because it will show you the progress during the writing process. Without this option, nothing will be printed on the terminal screen.
sync is actually another command, not an option. Sync clears the cache. Thanks to the && signs it will be executed as a chain with dd. This will make sure that all the data is written to the flash drive and nothing is left in the cache.
NOTE: I also need to WARN you that this procedure will wipe all the data from your USB flash drive. So, if you have any important data on it, copy it somewhere else before you run this command. I also recommend to back up the data from other hard drives, so you do not destroy them accidentally.
So, when you are sure that there is no valuable data on the flash drive and you specified all the names correctly, especially the of option, press Enter.
It usually takes several minutes to complete. When the process is finished, you can reboot your system and boot from a newly created bootable USB.
That is the way you can make a bootable USB drive in Linux.
Restore the USB drive
After you have used the bootable USB flash drive, you need to restore it back to its normal not-bootable state. So, to do that, you need to remove the bootable system from it. Run this command:
Then, where again sdX is your flash drive name without any number (in my case it is sdd). You can check it with:
After that create a new partition on it:
Select dos option.
And press enter to create a new partition.
Keep it at its maximum size. So, press enter.
Next, press enter again to make it primary. Navigate with the arrow keys to write and press Enter to write the changes.
Finally, type yes to confirm and quit the program.
Then, run this command, to check if a new partition has been created:
As you can see, the new partition has been created. It is named sdd1 in my example.
Then, format this partition as FAT file system:
Where ‘ALU’ is the label I give to this drive, you can use your name instead. And sdd1 is the partition name. Unlike in all the previous steps, where you used the device names, in this command you need to specify the partition name which ends with the number.
After these uncomplicated steps, your flash drive is like new and you can use it to store files.
Conclusion
Now you know how to make a bootable USB drive in Linux. You can now proceed to the installation process or test Linux live distributions.
So, leave your comment and give your opinion about this tutorial. Did you like it? Did you know about this tool?
Источник
How to write/create a Ubuntu .iso to a bootable USB device on Linux using dd command
I downloaded a Ubuntu .iso file named artful-desktop-amd64.iso on a Debian Linux system. How do I write or burn a Ubuntu .iso to a USB device for installation purpose from Linux terminal?
You need to use the dd command to create a bootable USB stick to install Ubuntu Linux on your Laptop or Desktop. Creating a bootable Ubuntu USB stick is easy from Linux or Unix-like system such as MacOS.
Tutorial details | |
---|---|
Difficulty level | Easy |
Root privileges | Yes |
Requirements | Ubuntu ISO file |
Est. reading time | 3 minutes |
Step 1: Find your usb device name
Insert your USB stick and type the following df command to see if it is mounted automatically on a Debian Linux desktop:
$ df
Sample outputs:
You need to unmount /media/vivek/data:
$ sudo umount /media/vivek/data
Or
$ sudo umount /dev/sdd1
Another option is to run dmesg command to find out usb device name:
$ sudo dmesg
Sample outputs:
It is clear that /dev/sdd is my usb stick device name.
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
Step 2: Create a bootable USB stick on Linux
Warning: Be careful with the USB stick/pen/disk names. Wrong names always result in data loss. Make sure you type the correct name.
Type the following dd command to create a bootable USB image from a .ISO file:
$ sudo dd if= artful-desktop-amd64.iso of= /dev/sdd bs=1M status=progress
However, I like to verify my download. For example:
$ ls -l ubuntu-20.04.1-live-server-amd64.iso
$ echo «443511f6bf12402c12503733059269a2e10dec602916c0a75263e5d990f6bb93 *ubuntu-20.04.1-live-server-amd64.iso» \
| shasum -a 256 —check
You should get the following output:
ubuntu-20.04.1-live-server-amd64.iso: OK
Click to enlarge
Ubuntu to create a bootable Ubuntu USB flash drive from terminal
In this example I am going to create a bootable flash drive for ubuntu-18.04.3-live-server-amd64.iso file as follows:
$ sudo dd if= /isos/ubuntu-18.04.3-live-server-amd64.iso of= /dev/sdb bs=1M status=progress
Another example
$ sudo dd if= /isos/ubuntu-19.04-live-server-amd64.iso of= /dev/sdb bs=1M status=progress
Sample output:
Understanding dd command options
- dd : Start the dd command to write DVD/CD iso image.
- if=/iso/ubuntu.iso : Path to input file.
- of=/dev/sdd : Path to destination USB disk/stick.
- bs=1M : read and write up to BYTES bytes at a time. In this example, 1M at a time.
- status=progress : Display progress bar while writing image to the USB stick such as /dev/sdd. See “Linux dd Command Show Progress Copy Bar With Status” for more info.
Step 3: You are done
That’s all! You now have Ubuntu on a USB stick, bootable and ready to install on your Laptop, Desktop or server based system.
Conclusion
You learned how to create a bootable usb pen drive from downloaded Ubuntu desktop or server .ISO image. See Ubuntu download page.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Источник
How to Create Linux Bootable USB from Linux Command-Line
Q. How do I create a bootable Linux USB drive on a Linux system. I want to create of bootable us of Ubuntu 14.04 LTS. I have an Ubuntu 14.04 ISO image. I also have Ubuntu 14.04 installed on my system. Now, This article will help you to create a bootable Linux USB drive on Linux operating system through the command line.
The users running the Windows operating system visit the below link to make a bootable Linux USB on their system.
Step to Create Bootable Linux USB:
Follow the below steps to make bootable Linux USB
- Install Required Package – First of all, install all the required packages for this tutorial using the following command.
- Mount ISO – Now, create a mount point on your system and mount Linux ISO image using the following command. For example, I used Ubuntu14.04.iso image and /media/iso as mountpoint.
- Attach USB – Now attach your USB drive to your computer to which you need to make bootable. Generally, the USB mounts automatically. But in any case, it’s not mounted using the following command to mount it manually.
Read this: How To Format USB Drive in Linux Command Line
Now rename some required files and directories as like below. Navigate to USB drive
And, you have all done. Your USB flash drive is ready. Now you can connect this USB to a computer which you need to install Linux operating system and boot it from USB.
Источник
How to Create Bootable USB from ISO using Linux Terminal
There are many third-party tools to create a bootable Linux USB Drive. Here I will show you how to create a bootable USB flash from ISO file using the Linux terminal.
Before we start make sure you have downloaded the .ISO file and have a USB flash drive with not less than 4GB capacity.
Check USB Drive
Connect the USB flash drive to your machine and check if it’s connected successfully. Use lsblk command to list all information about the attached block devices.
From the list find your USB drive’s mounted partition. In our case it’s /dev/sdc1. It is mounted by default.
Next, we must unmount the USB flash drive by the following command:
Make sure to change according to your USB drive and check if it has been unmounted again with lsblk command.
You must see the output without mount point in front of sdc1:
Download Linux ISO File
Here we will create a Ubuntu bootable flash drive, first go to ubuntu website and download the iso file to your Linux computer. Or you can download iso file from the command line using wget or curl command.
This will download iso file to the current directory.
Create Bootable Drive from Terminal
We are going to use dd command to create a bootable USB flash drive.
Where /path/to/input.iso is the path where .iso image downloaded. Make sure to change with your USB disk letter accordingly. The point here is to write the disk name itself (e.g. /dev/sdc) and not the partition (e.g. /dev/sdc1 ).
Where bs is read and write BYTES bytes at a time, if is the input file, of is the output file. The conv=fdatasync bit is important as dd can return before the write operation finishes.
By default the progress of the command will not be displayed, to view the progress you can use pv command:
Note: From 8.24 version of GNU Coreutils, dd command has the option to show the progress.
After the process is finished you can use USB as a bootable drive for ubuntu installation or repair.
Conclusion
Using the terminal to create a bootable USB drive is much easier and way faster than with GUI tools. Also, it is very useful to know how to do it in a terminal, because there isn’t always a GUI available. The main disadvantage, in this case, is that there is no double-check option for dd . GUI tools help you to identify and select the target drive, and provide a final checkpoint, where you can double-check, that you will be writing to the correct drive.
Источник
How to Create a Bootable USB Stick from the Ubuntu Terminal
You may want to create a bootable USB stick of Ubuntu yourself for various reasons. Some of these reasons are:
- Install/Upgrade Ubuntu
- Have the experience of the Ubuntu desktop without involving your system configurations
- Using the USB stick to fix a configuration issue with the standard tools provided with the Ubuntu ISO package
There are many ways to create a bootable USB in Ubuntu. Some involve using the system tools, while others depend on installing external packages. In this article, we will use the Ubuntu command line, the terminal, to create a bootable Ubuntu USB flash drive. We will do this with the dd command. The Terminal is a great alternative for performing your tasks from the Ubuntu user interface. Using the terminal makes certain tasks more efficient and even faster. The command-line tools don’t consume too many resources and therefore are a good alternative to the widespread graphical applications, especially if you don’t get along with older hardware.
We have run the commands and procedures mentioned in this article on an Ubuntu 20.04 LTS system.
Please follow these steps in sequence to create a bootable Ubuntu USB via your terminal:
Step 1: Download the Ubuntu ISO file
Open the Official Ubuntu website through any installed web browser and download the Ubuntu ISO through the following download link:
Click on any Ubuntu package you want to install. I will click on the Download Ubuntu Server 20.04 LTS link under Ubuntu Server. This will open the file save dialog. Select the Save File option and then click OK. The .iso package will be saved to your Downloads folder.
Step 2: Open the Terminal
Open your Ubuntu command line, the Terminal, either through the Ubuntu Application Launcher search or by using the Ctrl+Alt+T shortcut.
Step 3: Unmount the USB if it is mounted
Before you write your USB stick, you need to make sure that it is not automatically mounted to your Ubuntu. Insert the USB into your system and then run the following command in order to fetch your USB’s name:
The last line in the output of my df command lists the USB that is mounted to my Ubuntu system.
Note down the device name (/dev/sdb1 in my case) and the path it is mounted on (/media/sana/Ubuntu-Server 20.04.2 LTS amd64 in my case). Advertisement
There are two ways you can unmount the USB from your Ubuntu:
1. By using the path your USB is mounted on:
For example, I would use the following path to unmount the USB:
2. You can also use the device name to unmount it:
For example, I would use the following device name to unmount the USB:
Step 4: Create a bootable Ubuntu stick
Now that you have unmounted the USB, you know your ISO image’s name and path, and you know your device name, it takes only one command to create a bootable USB. This is the dd command syntax you can use in your Terminal:
$ sudo dd bs=4M if=/path/to/ISOfile of=/dev/sdx status=progress oflag=sync
Tip: Instead of typing the command, you can copy it from here and paste in the Terminal by using the Ctrl+Shift+V, or by using the Paste option from the right-click menu.
I will be using the following command to write the Ubuntu ISO on my USB:
The command will start writing the ISO on your USB and display a status bar.
After a few minutes, your bootable USB with the Ubuntu ISO written on it will be ready.
So, of the many ways to create a bootable USB, we have looked at the Terminal application for this purpose. You must have seen that it does not require the installation of an additional application and takes much less time than some UI applications do. Through this example and many others, I have recently become an advocate of preferring the command line over the UI, even for people who are not very familiar with terminal commands. This is exactly why I try to explain the procedure as simply as possible.
Karim Buzdar
About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn
Источник