CentOS Bootable USB on Linux

In this tutorial, we learn how to make a bootable USB stick for CentOS on the Linux terminal. Whenever I tried to make a bootable USB for CentOS using a Tool, I faced issues during installation.

Also on the CentOS Wiki Page, it suggested that dd command should be preferred for making bootable USB Stick for Centos 6.5 and above versions. I tested the below method for CentOS 6.5, 7, and 8 versions.

Step 1: Getting CentOS ISO

At the very first step, we need the CentOS ISO image which can be downloaded by the below link.

Step 2: Detect USB

This step is very important, because if you choose the wrong disk your important data may be deleted.

Find your USB device name by running the below command.

lsblk

The output may look like this

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
 sda           8:0    0 465.8G  0 disk 
 └─sda1        8:1    0 465.8G  0 part /Otherdata
 sdy           8:16   1   7.5G  0 disk 
 └─sdy1        8:17   1   7.5G  0 part /run/media/iswblog/Sandisk
 sdb           259:0    0 235.9G  0 disk 
 ├─sdb1        259:1    0   512M  0 part /boot
 ├─sdb3        259:2    0    16G  0 part [SWAP]
 └─sdb3        259:3    0 215.4G  0 part /

In my case, the USB device name is /dev/sdy but in your case, it may be different.

Step 3: Unmount USB

Most of the Linux distributions are automatic mount the USB drive when inserted. Before using the dd command, unmount the USB by using the umount command.

sudo umount /dev/sdy1

Step 4: Flashing the ISO

The last step is to flash the ISO using the dd command to the USB. It is important to make sure that you replace /dev/sdy with your USB device name. Otherwise, you may lose your data. In the first step, we download the CentOS ISO image, replace the /path-to-the-iso/CentOS-image.iso to your downloaded ISO path.

Run the below command with replaced values –

sudo dd bs=4M if=/path-to-the-iso/CentOS-image.iso of=/dev/sdy status=progress

The status parameter will show the status of the running process. This process may take some time. When the process completes you should see the below output.

1084+0 records in
1084+0 records out
45888568576 bytes (4.8 GB) copied, 35.563 s, 120 MB/s

After this output, your USB is ready to install CentOS.

Summary:

In this article, we learn how to make a bootable USB in Linux by using the dd command.

You can ask questions in the comment section.

Leave a Comment