I'm trying to partition a USB drive with a bootable partition using Kubuntu 18.04.1 and a data partition. What I'm trying to accomplish is the following:
Use GPT partition table to UEFI Boot
2GB partition to write the Kubuntu.iso to an boot from
The boot partition should NOT be persistent, in other words it would act like I booted from a CD/DVD-ROM I burned with the
.iso
Boot with UEFI Boot: Enabled and Secure Boot: Enabled
nGB partition formatted as NTFS to use between (K)ubuntu, CentOS, and Windows
What did work so far:
As expected, simply DD-ing the Kubuntu.iso to my flash drive and booting from the USB drive with UEFI Boot Enabled and Secure Boot Enabled. But this leaves much wasted space on the drive and gparted and partition manager do NOT show the device with any partition table. The Windows partition utility (the name escapes me) does see how much space is being used. Trying to partition the unused space breaks the drive. When I try to boot from it, it simply gives me a GRUB prompt. I feel this might be close.
I created an MBR partition table with two primary partitions and toggling the boot flag on the 2GB partition I created. The 2GB partition is typed as a FAT32. I then followed the advice found here and a link there in. Basically I partition the drive as described above and:
isohybrid --partok Kubuntu.iso //this is supposed to make the .iso bootable from a partition dd if=Kubuntu.iso of=/dev/sdX1 //write the modified .iso to the partiton install-mbr /dev/sdX //part of the system-utils package found on Ubuntu repositories.
However, I have to have UEFI Boot Disabled and therefore Secure Boot Disabled. I at least think meeting the above requirements is plausible. I suspect that even If I were to use this method with GPT I could boot with UEFI Boot Enabled, but Secure Boot might have to be Disabled due to modifying the Kubuntu.iso. I'm not sure if isohybrid modifies any of the binary's that get loaded at boot.
What else I've tried:
I've tried a similar method found here https://askubuntu.com/a/423402, but instead of a MBR I created a GPT table with the same partition layout then:
isohybrid --partok Kubuntu.iso //this is supposed to make the .iso bootable from a partition
dd if=Kubuntu.iso of=/dev/sdX1 //write the modified .iso to the partiton
and tried
isohybrid --uefi --partok Kubuntu.iso //this is supposed to make the .iso bootable from a partition
dd if=Kubuntu.iso of=/dev/sdX1 //write the modified .iso to the partiton
No combination of UEFI Boot: Enabled with Secure Boot: Enabled||Disabled would boot from the the flash drive.