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

3 Answers 3

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
up vote 17 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
    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

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

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.