In this tutorial we will learn, how to create bootable usb key for CenOS 7 installation. Currently many laptops/systems are available in market which are without CD/DVD drive.In a short words, technology is changing very fast.
First download the CentOS 7 iso file from CentOS official website. And save it in your system.
To make bootable USB key or USB pen drive for CentOS 7 installation has a few steps to follow. It includes the following steps –
1. First format the USB key.
2. Create bootable USB key for CentOS 7 installation by dd command.
Readers! we strongly recommend to read the instruction carefully.
1. First format the USB key
Take the backup from your pen drive whatever you have saved in because we are going to format the USB key now.
Insert the USB key to your system on USB port.
Run the command, it will show mounted partition including the USB key which is mounted with system.
sudo df -Th
The mounted partition for USB key will show in
/media/ . Let’s have an example from our laptop.
In above screenshot you can see, USB key got partition name as
/dev/sdc and it is mounted on directory path
/media/sharad/0E2D-6CD1 . In your system this will be different hence work accordingly. [Do’nt do copy paste of all steps, please do understand. If you do’nt understand and randomly hit the command, I am sure you will lost your data from some partition. So be careful]
Format the usb key by selecting its partition. We are formatting the USB key and making vfat file system.
sudo umount /media/
/ sudo mkfs.vfat
Now as per my USB key mounted information I will run the below command. So as per your USB key mounted partition information you have to replace /dev/sdc from below command.
sudo umount /media/sharad/0E2D-6CD1 sudo mkfs.vfat /dev/sdc
sharad@linuxworld:~$ sudo mkfs.vfat /dev/sdc mkfs.fat 3.0.26 (2014-03-07) mkfs.vfat: /dev/sdc contains a mounted filesystem. sharad@linuxworld:~$
Now USB key is formatted with VFAT filesystem. Unplug the USB key from system and plug it again. In next step we will make the USB key bootable for CentOS 7.
Create bootable USB key for CentOS 7 installation by dd command
Now we are only one step ahead. We will use dd command to create bootable USB key for CentOS 7 installation.
df -Th command and note down the USB mounted partition name.
sudo dd if=/path/CentOS.iso_file_path/ of=/dev/
NOTE: In above command syntax, the USB partition must not have number(partition number) like /dev/sdb1, /dev/sdb2, /dev/sdc2 etc. Plus it should be cleaned format with vfat.
Example from our system :
sudo dd if=/partition9/centos-7-dvd.iso of=/dev/sdc
It will take some time to make USB key bootable hence strictly advice you to wait till process get completed.
Once the dd command is completed, unplug the USB key. Now the USB key is bootable and ready for CentOS 7 installation.
You can now install CentOS 7 on your system by using this bootable USB key.
I followed exactly the same steps, but can’t get my USB to boot the system. I got no error while following the procedures, everything went smooth. On my target machine I set BIOS to boot from USB. (I validated it with one working bootable USB).
What could be wrong ?
Sharad Chhetri says
Do a try with Diskpart. But on USB hardware failure, these steps won’t work.
Thanks for reply mate.
I understand that diskpart will create or delete partitions but how should I use it in this process ?
Sharad Chhetri says
here, dosfsck command is the main player which help you to repair the filesystem. My bad! check with Gparted , it is GUI and do not lead to mistake. If this also do not help, may be hardware issue happened .
All the best.