Score:2

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

pl flag

I have a very fast Sandisk Extreme Pro flash stick. I also have a Lenovo X1 Carbon G6 notebook which has 1TB Samsung NVME inside with Windows 10 installed taking the whole SSD. BIOS is configured with secure boot and Windows is installed on a single partition with BitLocker encryption.

I want to create on this USB stick multi-boot multi-os/utilties installation with should allow me to:

  • Install Ubuntu on this USB and in other computers in the future - grub menu - install Ububnu or boot live CD (no persistence)
  • Boot from Ubuntu installed on this USB with persistence - grub menu - boot Ubuntu
  • Put Windows 10 and Windows 2019 installation options - grub menus - install windows 10/2019
  • Boot extra tools, like partition management tools, etc.

On another computer that has Ubuntu installed, I downloaded Ubuntu 20.03 LTS ISO file and used mkusb to create a 'persistent' install option on the stick and fed ISO to it. After creating USB was completed, I looked at gparted and disks and see I that disk/partition information is displayed differently.

UBS stick partitions

Anyway, I removed the USB stick, plugged at X1, pressed F12 to select the bootable device and booted from the USB stick. The boot was successful, and I was presented with the option to install or try ububntu.

I selected to install and went all the way to select where to install it. I was presented with three options - Install Ubuntu alongside with Windows Boot Manager, erase the disk and 'Something Else'. I selected the last option so to be able to select USB as a destination but the only option displayed was the existing NMVE internal drive, which is not what I want obviously.

So my questions from this experience are:

  • what I've missed during the process of creating the USB stick with mkusb?
  • should I use some other tool if mkusb is not the right one?
  • why gparted and disks show disk/partition layout differently?
  • Is it actually possible to install ubuntu on the same device you boot it from or you need different devices?

Just to reiterate - the internal 1TB nmve drive should be left untouched and all the modifications/installations need to be done on the USB drive itself. I should be able to boot ubuntu, install required apps/data on it and keep all that data on the USB stick. Plus, after that, I want to add an option to boot from additional ISO images.

Thanks in advance.

C.S.Cameron avatar
cn flag
What I think you want takes a fairly complex answer. You will need to install Windows installer using mkusb. Then you will need to set the disk up to boot Linux ISO files. You will need to set up a persistent partition for Ubuntu or if you need multi boot multi persistence, you will need a partition for persistent-path folders. If you want a Full install of Ubuntu, you will need to install it using either a second USB, 4GB or larger, or by booting toram. Using a second USB is easiest. Do you need a Full install of Ubuntu? If so a 32GB USB is not large enough. I will wait for your confirmation
Invisible999 avatar
pl flag
@C.S.Cameron, Thanks and let me ask regarding the last point first - to install (not do the live USB with persistence, but rather install), Ubuntu on the stick, 32GB is not sufficient and I need a larger stick? How much larger? 64GB, 128GB? More? Second question - will liveUSB with persistence allow me to boot from the USB on machines with different architecture - like AMD and Intel?
C.S.Cameron avatar
cn flag
My Full install Ubuntu USB takes up about 13GB with a few programs installed. Windows installer Win-2H takes up 6GB. Each ISO will be about 3GB plus about 8GB for a writable and home-rw file. This might work for a while but will soon fill up. If you just want proof of concept, give it a try. This should work with AMD and Intel boards and in BIOS and UEFI boot modes. It won't work on ARM boards, unless you are using Ubuntu for ARM, I think. Recommended size depends on how many ISO's you want to carry and how much persistence for each. A lot of pro's are recommending small external SSD's.
denNorske avatar
sl flag
I am not sure if this could help you, but you say you have Windows 10 installed.. would it be an option for you to check out a tool called YUMI? It is available from pendrivelinux: https://www.pendrivelinux.com/yumi-multiboot-usb-creator/ - scroll down and you will see the UEFI version too. It has interactive steps on how to set up each image, and then boot from the drive and you can select which OS you want to install/run from the pendrive. It also allows for persistent storage. If your question is for "how do i make this with mkusb" I am afraid I can't help with that.
C.S.Cameron avatar
cn flag
@Denny: I think YUMI now has a version that works on both BIOS and UEFI computers, but each OS has max 4GB persistence. Ventoy has both Windows and Linux versions. It can have unlimited persistence but I think it only installs Windows in UEFI mode. The reason I went to so much trouble below, was that I understood the OP also wants a Full install of Ubuntu as well as Persistence installs.
Score:4
cn flag

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

sudodus avatar
jp flag
+1, Let us hope this will work for the original poster :-)
C.S.Cameron avatar
cn flag
So far my tests are working but I do not have a pendrive large enough for Ubuntu Full install plus Persistent installs. I've had to test them separately. Boots for me both BIOS and UEFI. For Windows installer does mkusb make msdos partition table when run on UEFI machine? I have not been able to make bios_grub partition.
sudodus avatar
jp flag
In this case mkusb clones an MSDOS partition table, which does not need a bios_grub partition. This is different from when mkusb-dus makes a persistent live drive. (Windows, when installed, wants a GPT to boot in UEFI mode, but the Windows installer.accept an MSDOS partition table in both boot modes).
C.S.Cameron avatar
cn flag
Ahh, like selecting MSDOS at the Persistent Live Settings window in dus?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.