How to create a bootable usb from the terminal in any distribution

Linux Bootable USB Pendrive

There are times when it is necessary to create some bootable usb With an operating system, no matter which one we are talking about, in my case there are times when I have the need to create a USB with Windows and go with my clients for whatever is needed. 

In these cases, I always search some good program for poof the create the usb bootableforgetting me completely of what not needed nothing more  that using the terminal to be able to do this work. 

Although there are several programs, it is still very good to do everything from the terminal, here I showed you how to create a bootable usb only with the use of the terminal. 

By using the dd command You have to do several things so I will explain them step by step. 

The first thing will be to insert the usb with which we will work, open a terminal and type the command lsblk to see what mount point it is in, in my case it appears as / dev / sdb 

[darkcrizt@localhost ~]$ lsblk
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0 465.8G  0 disk
├─sda1            8:1    0   200M  0 part /boot/efi
├─sda2            8:2    0     1G  0 part /boot
└─sda3            8:3    0 464.6G  0 part
├─fedora-root 253:0    0    50G  0 lvm  /
├─fedora-swap 253:1    0     5G  0 lvm  [SWAP]
└─fedora-home 253:2    0 409.6G  0 lvm  /home
sdb               8:16   1  14.4G  0 disk 

 

Now we will proceed to disassemble it, and then give it the appropriate format this is with the commands umount y mkfs.vfat 

[darkcrizt@localhost ~]$ umount /dev/sdb
umount: /dev/sdb: no montado.
[darkcrizt@localhost ~]$ mkfs.vfat -F 32 /dev/sdb -I
mkfs.fat 4.1 (2017-01-24)
mkfs.vfat: unable to open /dev/sdb: Permission denied
[darkcrizt@localhost ~]$ sudo mkfs.vfat -F 32 /dev/sdb -I
[sudo] password for darkcrizt:
mkfs.fat 4.1 (2017-01-24)
 

 

At this point we will use the dd command where we indicate the mounting point of our usb as well as the path of the disk image that will be copied to the usb 

sudo dd if=/ruta-de-iso of=/dev/sdb
genymotion-player-3.0
Related article:
Some of the best known Android emulators for Linux

Here lo único is wait for end the process, in order to proceed to remove the usb and test it.  


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

8 comments, leave yours

Leave a Comment

Your email address will not be published.

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Marrian said

    Hello david
    I always add to the command bs = 4mb && sync
    for it to transfer more data in the block and then do a full dump to the flash drive before unmounting it.
    Greetings and thanks for the note
    Mariano

  2.   Daniel said

    Interesting, I only did it with gparted. Greetings.

  3.   braytac said

    There is a totally unnecessary step. It has no. It makes sense to format the device if you are going to use dd. It won't change anything. In fact, the format of the pendrive will remain as a structure. iso9660. No trace of fat32 will remain.
    skip all that:
    »[Darkcrizt @ localhost ~] $ mkfs.vfat -F 32 / dev / sdb -I
    mkfs.fat 4.1 (2017-01-24)
    mkfs.vfat: unable to open / dev / sdb: Permission denied
    [darkcrizt @ localhost ~] $ sudo mkfs.vfat -F 32 / dev / sdb -I
    [sudo] password for darkcrizt:
    mkfs.fat 4.1 (2017-01-24) »
    , and much better a bs. with 4 or 8 to speed up the copy. If the pen does not have a light, it is better to add sync as mentioned in the comments.

  4.   MAICOLL QUINTERO said

    Only with the last step you can do everything without the need for anything else, what I do is go to the location where I have the iso. Example downloads cd Downloads once there if or if you have to root sudo su and put your password, then we just place the usb memory and then you execute the ls command to see the files found there we see our iso so we only execute sudo dd if = ISO NAME.ISO of = / dev / sdb ONLY COPY THE NAME OF THE ISO INCLUDING THE .ISO SO I FIND THERE ONLY ONE STEP IS THE LAST SHE DOES JUST EVERYTHING I SURE THEM I HAVE TESTED WITH MORE THAN 10 DISTRICTS AND FUCNIONA EXELNTE

  5.   Edgar said

    Hi, the tutorial works for me with any linux-based system, but with windows 7 (for example) no, what could I be doing wrong? Thank you so much

  6.   mabs1136 said

    it gives me error :( it says that the file or directory does not exist when giving command sudo dd if = NAMEISO.ISO of = / dev / sdb

  7.   jot said

    You have to go to the folder where the iso image is, use the cd command, for example, if you have it in downloads it would be like this »cd / home / username / Downloads«, then add the previous command. Another option is to place the iso in the user's personal folder and then run the previous command again

  8.   4lejandr0 said

    Friend mabs1136, you only copy as is the code as indicated in the tutorial or also your pendrive is sdb. For example, mine is mounted as sdd1.