4

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?

  • What do you mean by "mount the iso file on a USB"? – Pilot6 Mar 14 at 19:15
  • Where did you see it? we don't mount the ISO on a USB, we make a bootable USB from an ISO... – Ravexina Mar 14 at 19:17
  • I mean using a specific program, as Rufus, to "install"/ to "mount" (now, I'm not any more sure which is the right word) the ubuntu iso file on the USB. – holo gram Mar 14 at 19:19
  • 1
    You need a bootloader to boot in BIOS mode, either grub, (mkusb) or syslinux, (Rufus, Etcher, etc). For UEFI boot you can extract the ISO to USB, but not just copy it. – C.S.Cameron Mar 15 at 3:28
  • 2
    +1 This is the very question I had when I have failed to create a bootable disk with Knoppix, as well as Ubuntu, over ten years ago. – clearkimura Mar 15 at 11:27
6

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.

Use Rufus as follows:

  1. Click “Select” to order to browse to 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-desktop-amd64-Bionic Beaver”.
  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

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-4: Installation type

  • The question wan not "How to make a bootable USB", but why you need a program to make it, etc. – Pilot6 Mar 14 at 19:47
  • Answer is their in the first para @Pilot6. The ISO requires a special EFI bootloader – Marmayogi Mar 14 at 20:13
  • EFI is not always required. – Pilot6 Mar 14 at 20:17
  • The context is that you need a bootloader, may not be EFI. You may say GRUB. – Marmayogi Mar 14 at 20:24
  • 2
    If you only need UEFI boot, you can just extract ISO to a FAT32 formatted flash drive with the boot flag. UEFI only USB key, just extract ISO ( 7 zip or similar) to FAT32 formated flash & set boot flag. askubuntu.com/questions/395879/… Grub can boot many ISO directly with its loopmount command, but you then have to have grub installed. BIOS boot requires a boot loader in MBR or the hybrid DVD/flash drive that dd creates when copying ISO to flash drive. Only some ISO are the hybrid type (Windows is not). – oldfred Mar 15 at 2:39
4

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?

There must be a bootloader - The computer's UEFI/BIOS system must find code, that will let the boot process continue until the whole operating system is running.

  • In the old style BIOS mode (alias CSM alias legacy mode), part of the bootloader resides at the 'head end' of the drive.

  • In the newer style UEFI mode, part of the bootloader resides in an EFI system partition.

  • In both cases the process is linked further from the first bootloader stages until the whole operating system is running.

In order to make this happen, the drive must contain program code at the relevant locations of the drive (a CD or DVD disk, a USB pendrive, a memory card, an SSD or a hard disk drive).

Ubuntu iso files contain code that is matching what is needed for booting.

  • A 32-bit iso file can be burned to DVD disk or cloned to a USB pendrive or memory card and it will be bootable in BIOS mode.

  • A 64-bit iso file can be burned to DVD disk or cloned to a USB pendrive or memory card and it will be bootable in BIOS mode and also in UEFI mode.

There are several cloning tools,

  • The Startup Disk Creator in Ubuntu 16.04 LTS and newer versions,
  • Disks alias gnome-disks in Linux
  • mkusb in Linux
  • Win32 Disk Imager in Windows,
  • Rufus in dd mode in Windows.

There are also several extracting tools. They do not clone, but create or use a file system and extract the content from the iso file, and when necessary, also create a bootloader, and check that the bootloader points to the relevant files for the boot process to succeed.

Obviously this is more complicated and therefore extracting tools must be modified, when the boot structure of a new version of Ubuntu is modified. But if you want to create a persistent live drive of Ubuntu, you must use an extracting tool.

Examples of extracting tools.

  • mkusb in Ubuntu and Debian (can make persistent live drives)
  • unetbootin in Linux, Windows and MacOS (can make persistent live drives)
  • Rufus in standard mode (in Windows) has a good reputation as a reliable tool (but can not make persistent live drives).

If you simply copy the iso file to a standard USB drive, the iso file will sit there as a file in a file system. No bootloader will be found (unless it was put there earlier with another method/tool), and it will not be a bootable drive.

If you want to look behind the curtains and 'do it yourself', use the following links (and links from them),

  • 1
    This is the authoritative answer that I've been waiting for. – karel Mar 15 at 9:00
  • 1
    +1 This is probably the best answer amongst other answers, should there be no other answer that could explain in layman's terms or something less technical for most end users. – clearkimura Mar 15 at 13:16
3

If you want to install Ubuntu, you need to make a bootable LiveUSB.

iso is an image of a bootable disk.

If you simply copy an iso file to a USB disk, you won't be able to boot from it.

A bootable media has specific data in specific sectors, so BIOS or UEFI can start a system from it.

  • This doesn't match my experience. I installed Ubuntu on a new laptop less than a week ago, with an USB stick I created simply by dd if=downloaded.iso of=/dev/sdc, no special magical software. It booted just fine. – Henning Makholm Mar 15 at 0:33
  • Extracting an ISO to USB works for UEFI boot. – C.S.Cameron Mar 15 at 3:19
  • @HenningMakholm dd is the "magical software" in your case. – Pilot6 Mar 15 at 4:59
  • As mentioned extract/copy files from mounted ISO to USB stick. – Paul Benson Mar 15 at 6:33
  • @Pilot6 I don't think so. There are many answers saying that dd doesn't actually do anything that plain cp downloaded.iso /dev/sdc wouldn't do just as well, and that using dd for block devices is just a traditional bit of voodoo. – Henning Makholm Mar 15 at 8:41
2

You don't burn an ISO to a UFD. You do that with CDs and DVDs. Basically you don't need Rufus or any 3rd party USB booting tool as so many keep insisting.

If you are making this from Windows 10, first of all format the UFD with FAT32 by running diskmgmt.msc from a command prompt (cmd) with administrator privileges. You right click on the UFD and format it as described. Then mount the ISO file by right clicking it and choosing mount option. When open just copy the files over to the UFD and it will be bootable. It's as simple as that.

  • 1
    Regarding acronym in this answer: UFD refers to USB Flash Drive. – clearkimura Mar 15 at 11:43
  • This works for booting Ubuntu live in UEFI mode, but not for booting in BIOS mode. – sudodus Mar 15 at 19:34
  • Most users today own a reasonably modern computer with UEFI (BIOS) and use it in that mode. I haven't used Legacy BIOS for a few years to try this out, but would imagine in that case you'd need to first make the UFD 'active' in Windows, or in Linux set a 'boot' flag to the UFD. – Paul Benson Mar 15 at 19:52
1

The .iso file is already bootable, however, it's aimed at CDs and DVDs which have a different layout than a flash drive. Namely, the CD volume descriptor and the boot catalog don't exist on a flash drive, so they are simply lost when you extract the .iso file on it. Because of that, you need special magic to re-create the boot info on the flash drive (add a boot partition and put the bootloader there), unless your BIOS is smart enough to find the appropriate bootloader file without the CD boot catalog.

  • +1 This is probably the answer I would agree for something less technical and good enough for most end users. – clearkimura Mar 15 at 16:35
1

First a quick primer on PC bootup.

From a software point of view USB sticks are more like hard drives than optical discs.

Optical discs use their own filesystems, most commonly ISO9660 with extensions (hence why image files of optical discs use the ".iso" file extension), sometimes UDF. An extension called El Torito is used to indicate where boot images can be found. A traditional PC bios loads and runs the boot image in 16 bit real mode. There are options for floppy or hard-drive emulation, but most modern CDs just use the "no emulation" mode.

Hard drives and USB sticks on the other hand are booted on a traditional PC bios by reading the first sector of the drive and running the code from there. They also usually have a partition table in that sector.

UEFI is a bit different, it boots from removable hard disk like media (including USB sticks) by reading a file from a known filesystem path (on permanent hard drives it is suppposed to use a list of boot paths stored by the firmware, though sometimes the "removable media path" is used for fixed drives too). UEFI boots from CD by loading a FAT16 image specified in the el-torito metadata and then reading a file from a known path in that fat16 image.


Just copying an ISO file to the drive as a file is not going to work. The BIOS isn't looking for an ISO file.

Copying the ISO file to the drive as raw data (e.g. using dd) wouldn't traditionally be expected to work either. However with modern Linus ISOs it often does, i'll get back to that later.

Therefore traditionally special tools were/are needed to take such a CD image, extract the relavent parts and build a bootable USB stick image.

However linux distro maintainers decided this was rather inconvinient. A single image that could be directly written was considered highly desirable. Fortunately ISO9660 reserves the first 32KiB of the medium as a "system area".

32KiB may not sound like much, but it's more than enough room to include both MBR boot code for traditional PC booting and a GPT partition table for uefi booting. So linux distro maintainers decided to do just that. This is known as isohybrid

1

A Quick and Simple Method to Boot USB

For a UEFI system use 7Zip to extract the contents of the ISO file to the USB.

Move the contents of the Ubuntu folder to root of the USB if necessary.

Boot ISO File on USB

You can also boot an ISO on USB by using your desktop grub to loop mount it. Add the following menuentry, (or similar), to /etc/grub.d/40_custom:

menuentry "Ubuntu-18.04.1-desktop-amd64.iso" {
    set root=(hd2,1)
        loopback loop /Ubuntu-18.04.1-desktop-amd64.iso
        linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/Ubuntu-18.04.1-desktop-amd64.iso splash --
        initrd (loop)/casper/initrd.lz
    }

And in Terminal run:

sudo update-grub
0

The .iso is a disk image file, and if it's directly flashed to the disk, your computer won't be able to read it as bootable. The flashing just reads the .iso and puts it in a format that the computer can boot from. In a way, it's like a .zip archive in that the stuff it contains has to be extracted to be usable.

0

.iso is non-functional when copied

An .iso file is useless when copied to a disk partition or array of disks which can create gaps in the image or spread it over non-sequential sectors or even different disks.

.iso is a disk image in file format

An .iso is a file containing a disk image itself. A special program is needed (in your case Rufus) to imprint an .iso disk file image to the beginning of an optical disc or USB in your case. If the optical disc or USB was already formatted with an operating system and contains data it will be wiped out when the .iso disk file image is imprinted on it. When you copy a file on the other hand (including an .iso), it does not destroy a disk.

Live moniker makes Ubuntu different than Windows

The live moniker is because unlike most installation disks (or USBs) you can try Ubuntu (live) before installing it. Windows installation media on the other hand does not let you "try" Windows. You have to wipe out your hard drive or SSD when installing Windows. Only after installation can you use Windows.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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