Linux Create A Bootable USB Pen

last updated in Categories , , ,

How do I create a bootable USB pen drive to start my CentOS / Fedora Linux? How do I create a bootable USB flash pen for installation of Linux, and for creation of rescue and other special-purpose boot disks using command line options?

You need to format your USP pen device as Win FAT32. Once formatted type the following commands to make it bootable.

Our Device Names

  1. USB Pen Device Name : /dev/sdb1
  2. DVD Mount : /media/cdrom0
  3. USB Mount Point : /media/usb
  4. USB File System : Win FAT32
  5. ISO or DVD Image : Fedora / CentOS / RHEL
WARNING! These examples may crash your computer or result in data loss if not executed properly. You must understand device names, file systems and required to use fdisk partition table manipulator for Linux. This howto intended to simplify first-time installation of Linux, and for creation of rescue and other special-purpose boot disks.

To find information about your devices and current partitions run:
# dmesg | less
# dmesg | egrep -i 'cd|dvd'
# fdisk -l

Use the first command to identify the USB device name.


Type the following command to mount Fedora 12 iso image:
# mount Fedora-12-x86_64-netinst.iso -o loop /media/cdrom0/
# DVD=/media/cdrom0
# ls -l $DVD

Sample outputs:

total 6
dr-xr-xr-x 3 root root 2048 2009-11-09 05:37 EFI
drwxr-sr-x 3 root  499 2048 2009-11-09 05:37 images
drwxr-sr-x 2 root  499 2048 2009-11-09 05:36 isolinux

You need to use files stored in isolinux directory to create a bootable usb pen.

Format Usb

Create the fdisk partition:
# fdisk /dev/sdb
You need to create only 1 partition. Next format the partition:
# USB=/media/usb
# mkdosfs /dev/sdb1

Finally mount the partition:
# mkdir -p /media/usb
# mount /dev/sdb1 /media/usb
# USB=/media/usb

Copy Required Files

Type the following commands:
# cp -av $DVD/isolinux/* $USB
# cd $USB
# rm isolinux.bin TRANS.TBL
# mv isolinux.cfg syslinux.cfg

Also copy the installer’s initial RAM disk $DVD/images/pxeboot/initrd.img (for CentOS / RHEL Linux use $DVD/RedHat/images/pxeboot/initrd.img file) CD/DVD onto the usb drive:
# cp -v $DVD/images/pxeboot/initrd.img $USB

Unmount the USB drive

# umount /dev/sdb1

Make the USB Bootable

Type the following command to make the USB drive bootable
# syslinux /dev/sdb1
# mount /dev/sdb1 $USB

syslinux is a boot loader for the Linux operating system which operates off an MS-DOS/Windows FAT filesystem.

Install Grub

Type the following command to install GRUB on the USB device:
# grub-install --root-directory=$USB /dev/sdb
Create grub.conf:
# cd $USB
# mkdir -p boot/grub

Edit the grub.conf file

root (hd1,0)
title Fedora Linux 
kernel /vmlinuz
initrd /initrd.img

Finally, unmount the USB pen drive, enter:
# umount /dev/sdb1
Your USB pen is ready and should be bootable from the USB device. This can be used to install Fedora or CentOS or RHEL. You can also copy other required tools (such as sniffers or data recovery tools) on this pen. This is left as exercise for the reader.

Unetbootin Installer of Linux/BSD Distributions (GUI Tools)

If command line options are too complicated to follow. Try UNetbootin, which allows you to create bootable Live USB drives for a variety of Linux distributions from Windows or Linux, without requiring you to burn a CD. To install to a partition or USB drive type the following command:
$ sudo apt-get install unetbootin
Sample outputs:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  lsb-desktop m4 aggregate lsb pax lsb-graphics lsb-core ncurses-term lsb-cxx
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
The following NEW packages will be installed:
  unetbootin unetbootin-translations
0 upgraded, 2 newly installed, 0 to remove and 9 not upgraded.
Need to get 428kB of archives.
After this operation, 1,843kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 karmic/universe unetbootin 356-1 [223kB]
Get:2 karmic/universe unetbootin-translations 356-1 [205kB]
Fetched 428kB in 2s (156kB/s)                   
Selecting previously deselected package unetbootin.
(Reading database ... 254825 files and directories currently installed.)
Unpacking unetbootin (from .../unetbootin_356-1_amd64.deb) ...
Selecting previously deselected package unetbootin-translations.
Unpacking unetbootin-translations (from .../unetbootin-translations_356-1_all.deb) ...
Processing triggers for desktop-file-utils ...
Processing triggers for man-db ...
Setting up unetbootin (356-1) ...
Setting up unetbootin-translations (356-1) ...

Type the following command to start unetbootin:
$ unetbootin

Fig.01: UNetbootin install Linux/BSD distributions to a partition or USB drive
Fig.01: UNetbootin install Linux/BSD distributions to a partition or USB drive

Say Hello To “USB Startup Disk Creator”

You can also use “USB Startup Disk Creator” utility in Ubuntu that creates a persistent Ubuntu image on a USB disk. This is called a “Live USB”. You can use the Live USB to install Ubuntu on your computer or to run Ubuntu without affecting your system hardware. You need USB disk 1 GB (2GB is suggested) or larger in size and Ubuntu systems 8.10 or later. You also need Ubuntu ISO Image which can be downloaded from the official website. To start USB Startup Disk Creator visit
System > Administration > USB Startup Disk Creator

Fig.02: Ubuntu - USB Startup Disk Creator
Fig.02: Ubuntu - USB Startup Disk Creator

  • Click the Other… button and specify the Ubuntu image you downloaded in the previous step.
  • Under USB Disk to use your USB disk is highlighted.
  • To make the Live USB a writeable disk, indicate how much memory to use for extra storage. If you don’t want the Live USB to be modifiable, select the second option, Discarded on Shutdown.
  • Finally click Make Startup Disk to make a Live USB.

Finally, you can always use LiveCDs to recover or fix Linux system issues.


  • See man pages – fdisk, mkfs, syslinux, and usb-creator-gtk (Ubuntu specific tool)

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

20 comment

  1. The “USB Startup Disk Creator” utility in Ubuntu could also create an OpenSuse startup usb pen for me from the OpenSuse iso and the great thing is, you don’t have to format the pen for a new setup.

  2. HI,

    Could you give the link or make an article how to make bootable usb on linux (ubuntu) for XP or vista.

  3. hey dude who is using windows now . common wake up this is 2010 . u can get anything and more in Linux .so throw away windows and have the fun with Linux

  4. Hi

    The tutorial seems to have the right steps but it is not compatible with CentOS if you have configured your USB drive on Redhat & vice versa.

    I tried to install CentOS with my USB stick on which I followed the above steps for creating it as USB bootable drive. I created it on RHEL 5.3 but when I started installation for CentOS it said install media not matching with the boot media.

  5. I’ve tried to load an ISO image of Ubuntu 10.10 using usb-creator.exe and clicking on “other”. When I choose the ISO image it doesn’t come up in the box on top. Nothing happens and the “create Startup Disk” button is still greyed out. What could be wrong here?

  6. Instead using “#dmesg” I would rather use “#sudo fdisk -l”. It’s safer and avoid confusions.

  7. HI,

    Could you give the link or make an article how to make bootable usb on linux (ubuntu) for XP or vista..

  8. Two questions:
    1) What does the option called “indicate how much memory to use for extra storage” do, exactly? If I leave it at zero (the way it comes preset), is that the same as checking “discard on shutdown”?

    2) Are there any advantages to Startup Disk Creator vs. UNetBootin, or vice versa?

  9. My two cents –
    I was using the above steps to create a F15 x86_64 bootable pen drive for doing a from the corresponding dvd .iso. The objective is to use it for installation since the CD / DVD drive on the target machine is not working.

    However, after doing each step as directed, found that the space used on the pen drive was only around 100 megs.Since the .iso is around 3.5 gigs, was suspecting that the substantial set of files have not been transferred so ran the Unetbootin and could immediately see what was missing – the package files!

    Not sure if I missed something here but might be worth considering an update to the article to cover this aspect :)

  10. I didn’t get too far into this tutorial because there are a lot of missing steps. For example, what commands do I execute in fdisk? fdisking the USB drive doesn’t do anything but ask for more commands. I assumed I had to delete the old partition and create a new one, so I did that. Then I tried mkdosfs but it wouldn’t do it because the drive was mounted. So I had to unmount the drive. Then the computer didn’t know what to do with /media/usb in the next step, so I finally just gave up. Thanks for the guide, but I think there are a lot of holes that need to be filled in. Also, it would be nice if it was a little more general, since this seemed to be based on the assumption that there are certain files in the ISO image.

  11. getting the following message wile grub installation:-
    #grub-install –recheck –root-directory=/mnt /dev/sdd
    Probing devices to guess BIOS drives. This may take a long time.
    The file /mnt/boot/grub/stage1 not read correctly.

    Any Clue what it can be.

  12. Hey,

    how do I make a bootable windows usb stick? I installed ubuntu to test it but after a week I found a lot of problems:

    – no properly printer drivers
    – on skype I sound like shit (no noise cancelation)
    – not really a gaming OS.
    – my cpu fan is constantly running, it is very loud.

    .. now I want to coe back to windows but don’t know how, I don’t have a empty dvd right now..

  13. Hurrah! In the end I got a website from where I know how to genuinely obtain helpful facts regarding my study and knowledge.

  14. Don’t waste your time with the command line instructions, they are not working (at least for CentOS), and yes, I read carefully, and repeated the instructions twice.

    Still, have a question? Get help on our forum!