Thursday, April 6, 2023

How to make iso to bootable usb & vise-versa in Centos 7 Linux

 if you are in linux you need to run following command to create bootable USB Stick from ISO of CEntOS.
In rpm linux run following commands :
in root account :-


1 # lsblk 

this will show you name, ..., size,...,..., MountPoint.
note down name of filwsystem from first collumn NAME. e.g. sde1
 

2 # umount /dev/sdx1
e.g. # umount /dev/sde1
 

3. The last step is to flash the CentOS ISO image to the USB drive. Make sure you replace /dev/sdx with your drive and do not append the partition number. Also, replace /path/to/CentOS-7-x86_64-DVD-1810.iso with the path to the ISO file. If you downloaded the file using a web browser , then it should be stored in the Downloads folder located in your user account. for ease of work you may copy ISO in /opt or /software folder or filesystem.
run command :-
 

# dd bs=4M if=/path/to/Centos7-Everthing.iso of=/dev/sde status=progress oflag=sync
 

here in "of=/dev/sde" name of "sde" is NAME of filesystem that we noted earlier as "sde1", also note that here we given "sde" not "sde1".
now you have bootable USB from ISO of Centos Linux.

You can build bootable USB from any bootable iso of any softrware. For example from redo-rescue-4.3.iso downloaded from internet. i.e. if iso is bootable  image then usb stick build will be bootable.

Run following command to build ISO from USB stick :-

# dd if=/dev/sdx1 of=/path/to/iso-file.iso 

this will create complete usb image to iso file. Here sdx1 in /dev/sdx1 is usb drive file system name and also here we given "sdx1" not "sdx" as for command for ISO to USB "dd" command.

No comments:

Post a Comment