Creating a Full Install of Ubuntu 24.04 to USB that works in both BIOS and UEFI
Following is based on using a 64GB 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 24.04 USB or DVD using SDC, mkusb, dd, Disks, Etcher, Rufus, etc. (See Note 1 at bottom)
Turnoff 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, click "Next".
Select Accessibility in Ubuntu, click "Next"
Select your keyboard layout, click "Next"
Select Internet connection, click "Next"
Select Try Ubuntu, - click Close
Insert the target flash drive.
Start GParted, Click Authenticate.
Unmount any mounted partitions on the Target drive..
Select Device tab and create a GPT partition table on the Target drive.
Create a 5GB 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 15GB 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.
- Do not reboot or unplug the target USB.
- Start Install Ubuntu.
- Choose Language, click "Next".
- Select Accessibility in Ubuntu, click "Next"
- Select your keyboard layout, click "Next"
- Select Internet connection, click "Next"
- Select Interactive installation, click "Next"
- Select Default or Extended apps, click "Next"
- Install proprietary software, click "Next"
- At "Installation type" select "Manual installation", click "Next".
- Under Device for boot loader installation select the target drive sdx.
- 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 "Next
- Click Install now.
- Confirm partitions to be formatted if asked, click continue.
- Insert your name, computer name, username, password and select if you want to log in automatically or require a password. - Click "Continue".
- Select your location. click "Next".
- Review your choices and click Install
- 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).
- For method of creating Full Encryption BIOS/UEFI USB drive see: How to Make BIOS/UEFI Flash Drive with Full Disk Encryption