Ubuntu – Cannot install Ubuntu on the flash drive

bootlive-usbstartup-disk-creatorsystem-installationusb

I'm trying to install Ubuntu on a flash drive, using a live session from another flash drive (let's call the USB key I'm live running Ubuntu on, "USB1", and the USB key I want to install Ubuntu on, "USB2", alright?).

So I'm starting a live session on the USB1, select "Try Ubuntu", launch Startup Disk Creator as recommended here, and basically select USB2 as the target and start installing.
But when I try to boot on my newly created USB2, I've got an error (--[ end Kernel panic - not syncing: No working init found.) and I believe it's because, when I check the USB2 partitions on another computer, I can see it turned my 16GB USB2 into a 5MB one with just 3 files on it: bootx64.efi, grubx64.efi and mmx.64.efi.

Just… why? It is supposed to install the OS on it, right?
I was using Ubuntu "focal" on my USB1.

Many thanks. Tell me if I'm not clear enough.

Best Answer

Encrypted 20.04 Full Install USB for BIOS and UEFI

Ubuntu 20.04 makes Full Disk Encryption easy.

step by step

  • Unplug HDD

  • Boot Live USB in BIOS mode, insert Target drive.

  • Start Install Ubuntu 20.04 LTS.

  • Select Language, Keyboard, Wireless, Normal Installation, Install third Party... .

  • At Installation type Tag "Erase disk and install Ubuntu" and then select "Advanced features". Click "Use LVM with the new Ubuntu installation" and then "Encrypt the new Ubuntu installation for security" as shown below.

enter image description here

  • Choose a security key. Overwrite empty disk space if inclined.

  • Select Country, then User name and Password.

  • When Installation completes the drive will boot encrypted in BIOS mode.

  • Open the 20.04 ISO file and copy boot and ESP folders to partition 1.

enter image description here

  • Copy grub.cfg from Partition 5 /boot/grub/ to Partition 1 /boot/grub/ overwriting the existing grub.cfg.

  • Re-Install GRUB:

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

  • Encrypted Full install USB should now be working in BIOS and UEFI modes.

Related Question