Problem creating multi-OS multiboot USB SSD/stick - USB not visible as an installation destination

Solution 1:

Multi Boot USB with Windows Installer

1) Install mkusb and guidus:

sudo add-apt-repository universe
sudo add-apt-repository ppa:mkusb/ppa
sudo apt update
sudo apt install mkusb
sudo apt install usb-pack-efi

2) Create a Windows Installer

  • Start mkusb, enter password, select Install (make a boot device).

  • Select extracting Windows Installer.

  • Select New version, works also with huge Windows iso files.

  • Select source file.

  • Select target device and accept following windows.

  • Process may take a while to complete.

3) Modify Partitions

  • Using GParted, divide the unused space into a 30GB ext4 partition labeled 'ubuntu' and the remainder into an extended partition

  • To the extended partition add a FAT32 partition labeled 'persistence' with up to 8GB of space for each persistent OS.

  • Add an ext4 or NTFS partition labeled 'isos'. Make the 'isos' partition large enough for all the ISO's you want to boot. Make it NTFS if you want a usbdata partition that Windows can also use. (The ISO boot may be harder to shut down).

enter image description here

  • Add Linux ISO files to the isos partition

4) Modify GRUB Bootloader

Mount the boot partition which is labeled WININSTFAT and edit /boot/grub/grub.cfg adding a menuentry similar to the following for each Debian based ISO file requiring persistence:

menuentry "ubuntu-20.04.2-desktop-amd64.iso persistent" {
       set isofile="/ubuntu-20.04.2-desktop-amd64.iso"
       loopback loop (hd0,5)$isofile
       linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject quiet splash fsck.mode=skip persistent persistent-path=ubuntu-20.04.2
       initrd (loop)/casper/initrd
}
  • Copy /EFI/BOOT from the ISO to sdx1 overwriting /efi/boot so the USB will boot in both BIOS and UEFI modes.

  • Copy x86_64-efi and loopback.cfg from the ISO to sdx1 /boot/grub.

5) Create the persistence files:

sudo dd if=/dev/zero of=casper-rw bs=1M count=512
sudo mkfs.ext4 -F casper-rw
  • (Replace 512 with the "size in MB" you require, max 4000)
  • For Ubuntu 20.04 and later replace casper-rw with writable
  • For an optional home-rw partition replace casper-rw with home-rw

6) Create Multi-Persistence Folders

  • Add a uniquely named folder to the FAT32 partition for each ISO file requiring persistence.

  • Add a persistence file labeled writable to each folder.

  • Add a persistence file labeled home-rw to each folder as desired.

7) Make a Backup of the Partition 1 /Boot folder at this time.

8) Add Ubuntu Full install

  • Boot Ubuntu Live from either a second Live USB or from the above USB in toram mode.

  • if booted in toram mode unmount 'isodevice': sudo umount -lrf /isodevice then replug it.

  • Start 'Install Ubuntu'

  • At "Installation type" select "Something else", click "Continue".

  • Under Device for boot loader installation select the target drive.

  • Select partition sdx3 and click change, select use as Ext4, select format this partition, and Mount point = "/" then OK.

  • If asked to Write previous changes... click Continue.

  • Click Install now.

  • Complete the installation as normal.

9) Edit GRUB

  • Copy the Windows and ISO menuentries from sdx1 /boot/grub/grub.cfg to sdx3 /boot/grub/grub.cfg. Paste them under /40_custom.

  • Copy sdx3 /boot/grub/grub.cfg to overwrite sdx1 /boot/grub/grub.cfg.

10) Confirm that everything works.

  • Confirm that the menuentries added earlier are still in place, if not, replace with the ones from backup.

Please leave a comment if you have any problems.

.

.

.

.

.

.

.

.

Here is a link to the Ubuntu Forums post: https://ubuntuforums.org/showthread.php?t=2466133&p=14055230#post14055230