Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there any way to create a bootable Ubuntu USB flash drive from the terminal without using any third-party applications like YUMI,Unetbootin, etc.

I tried to create a bootable Ubuntu flash drive with dd method,

sudo umount /dev/sdb
sudo dd if=/path/to/ubuntu.iso of=/dev/sdb bs=1M

It create files on the USB disk, but when I try to boot the USB disk it shows a Operating System Not Found error.

share|improve this question
    
You have to make sure that your USB flash drive is NOT mounted. Check with lsblk. If necessary, do sudo umount /dev/sdb (probably sdb1, sdb2). Add ;echo $? after your dd copy command. So: sudo dd if=... of=... bs=4M; echo $? If the commandd ends, the returning value should be 0. –  user85164 Nov 8 '13 at 7:21
    
i follwed your steps,but it also creates the same files as sudo umount /dev/sdb sudo dd if=/path/to/ubuntu.iso of=/dev/sdb bs=1M creates.It doesn't create any ubninit,ldlinux.sys,etc files which are mainly important a linux os to boot. –  Avinash Raj Nov 8 '13 at 9:38

5 Answers 5

up vote 23 down vote accepted

Creating a bootable Ubuntu USB flash drive from terminal

  • Place the ubuntu.iso file in any one of your hard disk partition.

  • Then mount the ubuntu.iso file.For this run the below commands in terminal,

    sudo mkdir /media/iso
    sudo mount -o loop /path/to/ubuntu.iso /media/iso
    
  • Then copy all the files from /media/iso to your mounted usb flash drive folder in /media.

    Insert your usb flash drive.My usb flashdrive partition screenshot.
    

    enter image description here

    It will automatically mounted,whenever you insert it.Your usb partition must be mounted inside /media.Let us assume your usb drive mounted inside /media/xxxx folder.Then run the below command,

    cp -a /media/iso/. /media/xxx
    
  • Then paste the ldlinux.sys file inside your USB flash drive partition(In my case /dev/sdd1) to make the usb bootable .For this run the below commands,

    sudo apt-get install syslinux mtools
    sudo syslinux -s /dev/sdd1
    
  • Open the /media/xxx and rename the isolinux directory to syslinux.Then go into the renamed syslinux folder and rename the file isolinux.cfg to syslinux.cfg.

  • Reboot your pc and change the boot-order in bios to USB.Now your ubuntu usb flash drive will booted up and you can install it.

This method will works for any linux distributions,not only ubuntu.You don't need to install any third party softwares to make linux usb flash drive.

share|improve this answer
    
I am trying it at the moment, could you please specify what/why you use: cp -a rather than cp -r –  moldovean Jul 19 at 15:44
1  
You need sudo for the syslinux command. –  Cammy_the_block Nov 4 at 4:55

You have two choices.

If you desire a graphical interface, use usb-creator (it is in the ubuntu repos)

enter image description here

If you want a command line tool, use dd

sudo umount /dev/sdb
sudo dd if=/path/to/ubuntu.iso of=/dev/sdb bs=1M

Just be sure "/dev/sdb" is the flash drive you wish to use (it will destroy the data on the flash drive).

See https://help.ubuntu.com/community/Installation/FromUSBStick for additional information.

share|improve this answer
    
i want only command line tools,not gui tool(like startup disk creator).According to the dd method,only 3 folders and 1 file was created in my usb.While i trying to boot it says operating system not found error.Files like ubninit,menu.c32,ubnpathl.txt,ubnfilel.txt,ldlinux.sys are missing(which are very important to boot live ubuntu usb). –  Avinash Raj Nov 8 '13 at 5:00
    
I tried the dd method with ubuntu.iso and it worked! it too a lot of time however to be written on an USB. I wonder what bs=1M stands for. I found this site manpages.ubuntu.com/manpages/karmic/en/man1/dd.1.html . Now I wonder if changing the value will make to copying to the USB faster? And what are the risks.. maybe someone knows. –  moldovean Aug 17 at 7:42
    
The bs is the block size. dd will read 1MB of data into the memory and then proceed to write it at the disk as a whole. Using a very small block size you will get a lot of CPU overhead. Using a very big block size may result in unexpected side effects, e.g. longer pauses of no disk activity and/or big RAM usage. 1M or 4M usually is a good value when making a disk from an ISO. More info on block sizes: stackoverflow.com/questions/6161823/… –  ApolloLV Nov 11 at 18:28

Use dd.

 sudo dd if=input.iso of=/dev/sdc

where input.iso is the input file, and /dev/sdc is the USB device you're writing to. This method is fast and has never failed me.

share|improve this answer
1  
it doesn't work for me. –  Avinash Raj Nov 16 '13 at 1:16
    
Really? Are you sure you have the correct .iso file name including path, and the correct /dev for your USB drive? How does it fail? Is there an error message, or does it just fail to boot? Are you sure the .iso isn't corrupt? –  Marc Nov 16 '13 at 10:25
    
it creates only read only files,this method doesn't copy ldlinux.sys file to the usb drive.See my answer it works,you can try the method i posted. –  Avinash Raj Nov 16 '13 at 12:01
    
I just created a bootable Lubuntu live USB on a 2GB drive last weekend using this command, and used it to install Lubuntu on an old computer. –  Marc Nov 16 '13 at 15:51
1  
You could have a corrupt .iso. Have you checked it? Are you certain the .iso is actually a copy of something that is bootable? –  Marc Nov 16 '13 at 16:00
$ dd if=ubuntu-14.04.1-desktop-amd64.iso of=/dev/sdX bs=1MB

Don't use the path to bit.

  1. Use the cd command to get to the folder that contains the .iso file
  2. use the command dd if=FILE NAME HERE.iso of=/dev/sdX bs=1MB
  3. Wait until the console output looks something like this:

    1028+1 records in
    1028+1 records out
    1028653056 bytes (1.0 GB) copied, 55.4844 s, 18.5 MB/s
    
  4. Boot from the usb.

Note: Make sure you write to the correct device a usb will not always be mounted at: dev/sdX where X can be any letter.

share|improve this answer
$ sudo mkfs.vfat -F32 /dev/sdx /* Formating the card */    
$ sudo mount ubuntu.iso /mnt /* Mounting the iso image */    
$ sudo cp -rvf /mnt/* /dev/sdx /* Copying contents to card */    
rename isolynux folder into syslinux     
rename syslinux/isolinux.cfg to syslinux/syslinux.cfg    
rename syslinux/isolinux.bin to syslinux/syslinux.bin    
run syslinux -s /dev/sdx    
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.