8

Every issue of Ubuntu LTS since 8.04, I have made a Full install of Ubuntu to USB flash drive, and recorded each step. Ubuntu installation method has changed since those days.

This has been intended to make a guide/check list for users wishing to create Full install Ubuntu family bootable drives that ares up to date for each generation.

For 22.04 these instructions should work for both creating and running the drive booted from either BIOS or UEFI.

The question is:

How to Create a Full Install of Ubuntu 22.04 to USB device with Step by Step instructions that work in either BIOS or UEFI.

1 Answer 1

12

Creating a Full Install of Ubuntu 22.04 to USB that works in both BIOS and UEFI

Following is based on using a 16GB Target drive, you may adjust partition sizes for a larger drive.

The following looks like a long procedure but it should take less than ten minutes to do the work.

  • Create a Live 22.04 USB or DVD using SDC, UNetbootin, mkusb, dd, etc. (See Note 1 at bottom)
  • Turn off and unplug the computer.
  • Unplug the power cable from the hard drive or unplug the hard drive from the laptop. (See Note 2 at bottom) This is important if the computer boots in UEFI mode.
  • Plug the computer back in.
  • Insert and boot the Live USB or Live DVD. (Booting BIOS mode preferred).
  • Select Language and Try Ubuntu.
  • Insert the target flash drive.
  • Start GParted.
  • Unmount any mounted partitions on the Target drive..
  • Select Device tab and create a GPT partition table on the Target drive.
  • Create a 1GB NTFS or FAT32 partition on the right side. (optional Linux / Windows data partition, See Note 3 at bottom). Size may be increased on larger drives.
  • Create a 1MB partition on the left side, format as unformatted.
  • Create a 300MB FAT32 partition next to the 1MB partition.
  • Create a 9GB ext4 partition next to the 300MB partition.
  • In the remaining space create an ext4 partition, (optional for /home partition on larger USB).
  • Highlight the 1MB partition.
  • Apply All Operations.
  • Flag the 1MB partition as bios_grub.
  • Flag the 300MB partition as boot,esp.

enter image description here

  • Do not reboot or unplug the target USB.
  • Start Install Ubuntu.
  • Select Language, click "Continue".
  • Select Keyboard layout, click "Continue".
  • Select Wireless network, (optional), click "Continue".
  • Select installation preference and select "Download updates while installing Ubuntu", (optional), and Select "Install third-party software ...", (optional), click "Continue".
  • If asked about unmounting partitions that are in use, select Yes, click "Continue".
  • Do not use Advanced feature disk encryption for this install method. (See Note 4 at bottom).
  • At "Installation type" select "Something else", click "Continue".
  • Under Device for boot loader installation select the target drive.
  • Select partition sdx4 and click change, select use as Ext4, select “format this partition”, and Mount point = "/" then OK.
  • If asked to Write previous changes... click Continue.
  • Select partition sdx5 and click change, select use as Ext4, select format this partition, and Mount point = "/home" then OK. (optional).
  • Click Install now.

enter image description here

  • Confirm partitions to be formatted if asked, click continue.
  • Select your location. click "Continue".
  • Insert your name, computer name, username, password and select if you want to log in automatically or require a password. - Click "Continue".
  • Wait until install is complete.
  • Turn off computer and re-plug in the HDD.
  • Replace the computer's cover.

Note 1: Problems

  • If there are any problems booting, first try re-installing GRUB:

    sudo mount /dev/sdx3 /mnt
    sudo grub-install --boot-directory=/mnt/boot /dev/sdx

  • Next, if there is an efi entry in fstab, # it out.

Note 2: Hard drive removal.

  • You may omit disabling the hard drive in BIOS boot if after partitioning you choose to install grub to the root of the USB drive you are installing Ubuntu to, (ie sdx not sdx1). Be cautious, many people have overwritten the HDD MBR as default location for boot loader is sda, any items in the internal drive's grub will be added to the USB's grub. You may do an update-grub later. If you leave the HDD plugged in with UEFI install, fstab may use the HDD's UUID for /boot/efi. In this case # or delete the /boot/efi.UUID line in fstab.

Note 3: Apple compatibility.

  • If you own an Apple computer make this partition FAT32.

Note 4: Encryption (optional).

6
  • Would appear this needs to be done on an x64/eufi capable PC?? Have tried on an x64 BIOS PC (failed), and also on a 32bit eufi machine (failed...)
    – hornetster
    Aug 2, 2022 at 9:35
  • If you want to make a system that can boot in both UEFI and BIOS mode on a computer, that does not work in UEFI mode, you can use a method that uses a template to create the boot structure, or use an image a whole system, that can has the desired properties. This can be done using a compressed image of Ubuntu Server - extract and clone it to a drive (internal or external), and later on, if you wish, install a desktop environment, for example Lubuntu. See this link to a thread at the Ubuntu Forums.
    – sudodus
    Aug 2, 2022 at 9:51
  • What is the 1GB NTFS or FAT32 partition for?
    – velut luna
    Aug 2, 2022 at 13:51
  • 1
    @velutluna, If I understand correctly, it is a data partition readable also by Windows (NTFS) or also by Windows and MacOS (FAT32 or exFAT). This is helpful if you want to transfer files between computers with different operating systems.
    – sudodus
    Aug 2, 2022 at 14:08
  • @hornetster: Try the above, I have eliminated a couple steps. It is working on all my computers. Please let me know if it is working for you with 22.04.1. I have mostly tested using BIOS boot. several of the computers were over 10 years old. Aug 15, 2022 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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