Did You Know?
Got a tip? Let us know

LFCS - Linux Foundation Certified SysAdmin - Exam Preparation Guide

Install Linux from USB Device or Boot into Live Mode Using Unetbootin and dd Command

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

Installing Linux from a USB mass storage device or logging into Live Linux Environment is a cool Idea. Booting from a USB mass storage device is sometimes necessary, especially when the ROM media device is not working. Booting Windows from a USB mass storage device is not difficult, and with the availability of various software it has been just a few clicks away. Booting into a windows machine requires only three files, namely boo.ini, ntldr and ntdetect.com. But booting into a Linux machine is a complex process which requires a whole lot of files and process in well defined execution manner. The booting process is complex but creating a boot-able usb media is very interactive and fun.

We will be creating USB boot-able image in two different way
  1. Unetbootin (An Open Source Project, freely available)
  2. dd (Data Description)
For creating a Usb boot-able image, certain basic requirements are:
  1. Usb Mass Storage Device (Pen Drive)
  2. Linux Image in CD/DVD/ISO or Internet connection (Not recommended for large images)
  3. Windows/Linux Platform

Let us start with Unetbootin

Use Apt/Yum to get the required Unetbootin package or download the tar-ball from the below link for your platform.

  1. http://unetbootin.sourceforge.net/

Insert Your USB pen-drive into the Windows/Linux machine and Launch Unetbootin, you will be greeted with a windows similar to.

Unetbootin Create Bootable Linux

Check the content above the red line. Type should be Usb Device, strictly and if more than one usb device is plugged in you need to know the name of exact Usb device you need to work upon. A wrong selection will lead to wipe your hard disk, so be aware. You can browse to the stored disk image on your hard drive, from the Unetbootin window.

Unetbootin

Or alternatively download from the internet, in real time. Although it is a time taking process and may result into error, when larger image is downloaded.

Unetbootin Bootable USB Device

Click OK, and the process of downloading and/or extracting image will start. It will take time depending upon the size of download and/or the file size of ISO image. Once completed, click ‘exit‘.

Plug out the usb storage device safely and plug it into the machine you want to boot. Restart it and set that usb storage device to boot first from the BIOS menu which may be F12, F8, F2 or Del depending upon you machine and build.

You will be greeted with a window as below, from where you can boot into Live Linux Mode and/or Install on Hard Disk from there, directly.

Unetbootin Boot Screen

Pros of using Unetbootin
  1. Most of the processing is automated.
  2. Easy to use.
  3. Make it possible to create boot-able stick from windows/Linux.
Cons of using Unetbootin
  1. One wrong selection of disk and all your Data and Installation on primary HDD is wiped.

Creating Boot-able USB Device using dd Command

dd command originally was a part of UNIX, which is implemented in Linux. The dd command is capable of striping headers, extracting parts of binary files. It is used by the Linux kernel Makefiles to make boot images.

The basic syntax of dd command is
dd if=<source> of=<target> bs=<byte size>; sync

The bite Size is generally “some power of 2, and usually not less than 512 bytes i.e., 512, 1024, 2048, 4096, 8192, 16384, but can be any reasonable whole integer value.

sync option allows you to copy everything using synchronized I/O.

Run the below command with modification depending upon your source and destination.

# dd if=/home/server/Downloads/kali-linux-1.0.4-i386.iso of=/dev/sdb1 bs=512M; sync

It will take time to create the boot-able disk depending upon the size of ISO image and your RAM capacity.

Don’t interrupt the boot stick creation, once the process is completed, you will get something like this in your terminal.

4+1 records in
4+1 records out
2547646464 bytes (2.5 GB) copied, 252.723 s, 10.1 MB/s

Now safely eject the disk, plug it into the machine you want to boot with Linux, and Yup don’t forget to change the booting option in your BIOS, setting your flash stick to boot primarily.

When USB is booted, You will be greeted with a window similar to.

Unetbootin Installing Linux

Pros of the above method:
  1. Least possible error in making copy
  2. No extra/ third party tool required
Cons of the Above method:
  1. No room for error, an error and everything is wiped.
  2. Non-interactive way.
  3. You should know, what you are doing, as you won’t get any manual/prompt/help at run time, you must be good in terminals.

Remember, All the distro don’t allow Live Environment, but most of the today’s distro does. You will be able to log into a live Linux Environment only if supported.

The above article do not aims at comparing the two method. Before writing anything we gives hours in testing and executing the process to ensure you get 100% working solution.

If you gets stuck at somewhere, feel free to contact us in comment section. For any damage to data/disk, as a result of above method neither the Author nor Tecmint is responsible.

That’s all for Now. I will soon be here again, with another interesting article, you people will love to read. Till then stay healthy, safe, tuned and connected to Tecmint.

I am a major in computer science, love to research nix. I love to write codes and scripts, review distros, experiment Foss Technologies, write technical articles, Hack, of course Ethically. I am working as System Administrator (nix) for a NGO.

Linux Services & Free WordPress Setup

Our post is simply ‘DIY’ aka ‘Do It Yourself, still you may find difficulties and want us to help you out. We offer wide range of Linux and Web Hosting Solutions at fair minimum rates. Please submit your orders by Clicking Here.

4 Responses

  1. Rob in Madison says:

    Avishek: Thanks for the very clear instructions. I have an old Compaq desktop with Debian 6 running. I downloaded a Debian 7 live image and installed it to a USB thumb drive using dd just as you described it here.

    If I change the boot order in BIOS to place the USB drive first in line, and restart, the machine does boot into the USB drive’s OS. BUT! something very weird happens: the power supply fan slows way down, and after about fifteen or twenty seconds, the mouse no longer gets responses when I click on menu items, and the mouse pointer freezes.

    At that point I have to turn the power off and on manually to restart.

    Any ideas?

    Regards
    Rob

  2. DON says:

    The ISO image should be in DD or in USB,and thank you

  3. Jim says:

    Hello,

    My PC seems to get stuck in a “rebooting” loop when I try to boot Ubuntu from my flash drive. It opens the main menu (as shown in your last screenshot above), but once I select any option it just reboots again. The BIOS is set for USB Device first. Any suggestions?

    Thanks you

    • Avishek Kumar says:

      Try making your flash drive boot-able again.
      checksum you image file to confirm your iso is intact.
      Use iso as per you architecture.

Leave a Reply

This work is licensed under a (cc) BY-NC | TecMint uses cookies. By using our services, you comply to use of our cookies. More info: Privacy Policy.
© 2012-2014 All Rights Reserved.