LiveUSB – What Does It Mean to Make a Bootable USB?

isomountusb

I have to install Ubuntu on a PC and I saw I have to make a bootable LiveUSB from the Ubuntu iso file. However, I can't understand what's the technical difference between making a bootable LiveUSB with a program like Rufus, and copying a .iso file on a USB. Why is not enough to copy it?

Best Answer

As the nature of question is more of layman (at least, that is what I understood), I would like to focus and attempt to answer in plain words rather than technically in order to solve questioner @holo gram's doubt.

What happens when a CPU is powered on?

As you may be knowing RAM or the Physical memory is the only place from where the CPU reads and executes instruction. But RAM is volatile memory, so when a CPU is powered on the RAM is empty.

So during this time from where does the instructions are loaded into RAM? Its typically HDD.

But computer being a dummy machine how does it understands where in the HDD to look for the first instructions?

What is BIOS (Basic Input/Output System)?

  1. BIOS is the program to start after you turn on your computer.
  2. BIOS conducts a power-on self-test for all of the different hardware components in the system to make sure everything is working properly.
  3. It searches and loads the boot loader program.
  4. You can change the order of bootloader sequence i.e. it is part of the BIOS.
  5. BIOS looks into MBR (Master Boot Record) or GPT (GUID Partition Table) where it finds the actual boot loader program.
  6. In LINUX its typically GRUB (Grand Unified Bootloader). A system can have multiple kernel instances present, so in that case it will ask you for which one?
  7. BIOS is not only a program but also a firmware. i.e, this BIOS part is hard wired in the motherboard chip.

enter image description here Figure-1: A typical BIOS Chip.

Having this background, now the question is, "How to load an iso file from a "non-bootable" pendrive?"

Your primary question was "is it not enough to copy iso file into USB to boot?"

The answer is "yes, you can do" provided that you have to re-write BIOS program by yourself. Instead of BIOS looking for bootloaders, let BIOS do the job of a bootloader! In your case, iso file can be loaded directly from a pendrive just after copying! No problems, BIOS program can be made capable of doing this!

But what are the repercussions?

  1. BIOS, hence forth, will never have the knowledge of whereabouts of bootloaders because it does that job by itself.
  2. Addition of bootloader code into BIOS makes it fatter and may not fit into memory chip. Thus you are meddling with hardware too!
  3. There will not be any boot record in hard disk because BIOS knows how to boot. Hard disk will contain only programs and data.
  4. If you have a dual booted desktop, BIOS loads only Ubuntu iso and not Microsoft windows iso because it has no knowledge about that iso file.
  5. So you will rewrite BIOS program again to incorporate windows iso. This process will make BIOS program still fatter.
  6. If you bring another new iso file tomorrow, then you will have to sit and rewrite BIOS to incorporate that too!
  7. Rewriting and making BIOS program bigger and bigger introduces bugs and errors, thus chances are more for your computer to fail to boot frequently.

So instead of meddling around BIOS program, it is always safer to have a compact bug-free BIOS program having knowledge restricted only to look for bootloaders. This makes it necessary to make your pendrive bootable using tools such as Rufus.

What is a bootloader in a "bootable" pendrive?

Bootloader is a program that resides in a tiny partition having around 300 MB size formatted in fat32 filesystem.

Your iso file will get attention of BIOS only when the following two conditions are satisfied:

  • There must be a bootloader present in the pendrive (this is possible only if pendrive becomes bootable using tools like Rufus).
  • Your bootloader should precede over others in the order of sequence of bootloaders in BIOS setup (refer figure-2). i.e. it should occupy first in the priority list.

After your pendrive attracts BIOS's attention, BIOS approaches pendrive's tiny boot partition and loads bootloader. Then your bootloader subsequently loads your iso image.

Therefore, if you simply copy an iso file in pendrive, then nothing will happen and remain there like a rock for ever! As mentioned above, your iso image should draw the attention of BIOS for action to start!

enter image description here Figure-2: A typical BIOS setup with a sequence of bootloaders

Creating an UEFI bootable Linux USB stick

We will create a bootable USB stick with Linux by starting from a Linux distribution’s ISO. Since we want to create a USB stick that will be able to boot a UEFI system, we will require an ISO that can do this. The ISO requires a special EFI bootloader.

Make sure that you download the AMD64 version of the ISO! You can download this ISO from the following link:  http://releases.ubuntu.com/18.04/ To create the bootable USB stick from the ISO, we use the Rufus tool on Windows. You can download Rufus from official website https://rufus.akeo.ie and latest version is Rufus 3.4 whose size is 1 MB.

Procedure to prepare bootable USB stick for Bionic Beaver using Rufus:

  1. Click “Select” in order to browse the location of Ubuntu ISO file and select the same.
  2. Set “Partition scheme” to “GPT” which is the default partition scheme for UEFI computer.
  3. Select “Target system” as “UEFI (non CSM).
  4. Set “New Volume Label” as “Ubuntu 18.04.2 LTS amd64”.
  5. Select “File system” to be “FAT32 (default)”.
  6. Set “Cluster size” to “4096 bytes (default)”
  7. Enable “Quick format” and select “2 passes” as show in the screenshot below.
  8. Make sure that Rufus hasn’t changed the partitioning scheme after you have selected the ISO.
  9. Click Start button to prepare bootable Ubuntu USB stick.

enter image description here Figure-3: Ubuntu 18.04.02 Bionic Beaver

Procedure to prepare bootable USB stick for Disco Dingo using Rufus:

Please follow suit the same procedure for Bionic Beaver as given above except for two changes step-1 and step-4:

  • Step-1: Browse for Ubuntu 19.04 LTS amd64 ISO file and select the same.

  • Step-4: Set “New Volume Label” as “Ubuntu 19.04 amd64”.

enter image description here Figure-4: Ubuntu 19.04 Disco Dingo

When Rufus is ready, you will have your USB stick with a UEFI bootloader. Booting a machine with this stick allows you to boot Ubuntu 18.04.02 LTS live session so that you have access to all default Ubuntu utilities. Ubuntu ISO files can be downloaded from the following URL: http://releases.ubuntu.com

How can I upgrade ubuntu using bootable USB?

You just need to access bios of your PC, and boot from bootable USB, then select "install Ubuntu"

Then a bunch of options will appear (see the image below). Select "upgrade ubuntu" . Done

enter image description here Figure-5: Installation type

Related Question