This USB stick will include:
Ubuntu Desktop 22.04.4 live (BIOS and UEFI mode boot)
GParted 1.5.0-6 live (BIOS and UEFI mode boot)
Hiren’s BootCD 1.0.2 live (UEFI mode boot)
Windows 10 22H2 installer (UEFI mode boot)
Fedora 39 live (BIOS and UEFI mode boot)
Debian Bookworm live (BIOS and UEFI mode boot)
SystemRescue live (BIOS and UEFI mode boot)
Rocky Linux 9.3 installer (BIOS and UEFI mode boot)
Connect the USB stick to your computer, become root and see the device name for the USB stick:
$ sudo -i
# lsblk -o +TRAN | grep usb
sdb 8:16 0 953.9G 0 disk usb
Umount all the filesystems that are mounted off /dev/sdb:
# findmnt | grep sdb
Initialize the USB stick:
# wipefs -a /dev/sdb # plug-in the usb stick again
Create partitions on the USB stick:
# sgdisk \
--new 1::+1M --typecode=1:ef02 --change-name=1:'BIOS boot' \
--new 2::+1024M --typecode=2:ef00 --change-name=2:'EFI System' \
--new 3::+30G --typecode=3:8300 --change-name=3:'Linux filesystem' \
--new 4::+30G --typecode=4:0700 --change-name=4:'Microsoft basic data' \
--new 5::+30G --typecode=5:0700 --change-name=5:'Microsoft basic data' \
/dev/sdb
This creates the following partition table on /dev/sdb:
# fdisk -l /dev/sdb
Disk /dev/sdb: 953,87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: able SSD 1TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 0BD19E56-77E4-4398-8C56-78C4E5A65E5B
Device Start End Sectors Size Type
/dev/sdb1 2048 4095 2048 1M BIOS boot
/dev/sdb2 4096 2101247 2097152 1G EFI System
/dev/sdb3 2101248 65015807 62914560 30G Linux filesystem
/dev/sdb4 65015808 127930367 62914560 30G Microsoft basic data
/dev/sdb5 127930368 190844927 62914560 30G Microsoft basic data
Initialize the file systems on the USB stick and mount them:
# mkfs.vfat /dev/sdb2
# mkfs.ext3 -F -b 4096 /dev/sdb3
# mkfs.ntfs -F -Q /dev/sdb4
# mkfs.ntfs -F -Q /dev/sdb5
Mount the filesystems:
# mkdir -p /mnt/sdb2 /mnt/sdb3 /mnt/sdb4 /mnt/sdb5
# mount /dev/sdb2 /mnt/sdb2
# mount /dev/sdb3 /mnt/sdb3
# mount /dev/sdb4 /mnt/sdb4
# mount /dev/sdb5 /mnt/sdb5
Download Ubuntu Desktop 22.04.4 from https://releases.ubuntu.com/22.04.4/
Download GParted 1.5.0-6 from https://gparted.org/download.php
Download Hiren’s BootCD 1.0.2 from https://mirror.bordova.com/hbcd-pe-archive/
Download Windows 10 22H2 from https://www.microsoft.com/en-us/software-download/windows10ISO
Compile nocache from https://github.com/Feh/nocache :
# git clone https://github.com/Feh/nocache.git
# cd nocache
# edit Makefile
PREFIX ?= /opt/nocache
# make
# make install
# ln -s /opt/nocache/bin/* /usr/bin
# hash -r
Copy the Ubuntu Desktop 22.04.4 installer ISO image to /mnt/sdb3:
# nocache dd if=/root/ubuntu-22.04.4-desktop-amd64.iso of=/mnt/sdb3/ubuntu-22.04.4-desktop-amd64.iso bs=1M status=progress
Copy GParted 1.5.0-6 ISO image to /mnt/sdb3:
# nocache dd if=/root/gparted-live-1.5.0-6-amd64.iso of=/mnt/sdb3/gparted-live-1.5.0-6-amd64.iso bs=1M status=progress
Copy Hiren’s BootCD 1.0.2 ISO image content to /mnt/sdb4:
# mkdir -p /mnt/hbcd
# mount -o ro,loop /root/HBCD_PE_x64_v102.iso /mnt/hbcd
# nocache rsync -av --fsync /mnt/hbcd/ /mnt/sdb4/
Copy Windows 10 22H2 ISO image content to /mnt/sdb5:
# mkdir -p /mnt/win10iso
# mount -o ro,loop /root/Win10_22H2_English_x64.iso /mnt/win10iso
# nocache rsync -av --fsync /mnt/win10iso/ /mnt/sdb5/
Install grub on the USB stick for both BIOS and UEFI mode boot:
# grub-install \
--target=i386-pc \
--boot-directory=/mnt/sdb2/boot \
/dev/sdb
# grub-install \
--target=x86_64-efi \
--efi-directory=/mnt/sdb2 \
--boot-directory=/mnt/sdb2/boot \
--removable \
--no-nvram
Display the filesystem UUIDs for /dev/sdb3 (ext3), /dev/sdb4 (ntfs) and /dev/sdb5 (ntfs). These will be used in the grub.cfg file below.
# blkid /dev/sdb3
/dev/sdb3: UUID="43ea70c0-9fc2-4d66-9f62-f1350ce5cff8" BLOCK_SIZE="4096" TYPE="ext3" PARTLABEL="Linux filesystem" PARTUUID="5fc633b9-887e-470c-af0e-01b08c041611"
# blkid /dev/sdb4
/dev/sdb4: BLOCK_SIZE="512" UUID="776312675E77722A" TYPE="ntfs" PARTLABEL="Microsoft basic data" PARTUUID="9c745d71-7a7c-4273-b7a8-3aac093841b1"
# blkid /dev/sdb5
/dev/sdb5: BLOCK_SIZE="512" UUID="6EDDB3D371C7B1CE" TYPE="ntfs" PARTLABEL="Microsoft basic data" PARTUUID="9aaf2679-08a7-44fc-aa74-ad33b8e4ca50"
Add a grub configuration file on the USB stick in /mnt/sdb2/boot/grub/grub.cfg:
default=0
timeout=10
menuentry 'Ubuntu 22.04.4 live (BIOS and UEFI)' {
insmod part_gpt
search --set=root --fs-uuid 43ea70c0-9fc2-4d66-9f62-f1350ce5cff8
set isofile='ubuntu-22.04.4-desktop-amd64.iso'
loopback loop /$isofile
linux (loop)/casper/vmlinuz audit=0 boot=casper ignore_uuid live-media-path=/casper iso-scan/filename=/$isofile toram
initrd (loop)/casper/initrd
}
menuentry "GParted 1.5.0-6 live (BIOS and UEFI)" {
insmod part_gpt
search --set=root --fs-uuid 43ea70c0-9fc2-4d66-9f62-f1350ce5cff8
set isofile='gparted-live-1.5.0-6-amd64.iso'
loopback loop ($root)/$isofile
linux (loop)/live/vmlinuz boot=live config union=overlay username=user noswap noprompt ip=frommedia toram=filesystem.squashfs findiso=$isofile
initrd (loop)/live/initrd.img
}
menuentry "Hirens BootCD 1.0.2 live (UEFI only)" {
insmod part_gpt
insmod ntfs
insmod chain
search --set=root --fs-uuid 776312675E77722A
chainloader ($root)/efi/boot/bootx64.efi
}
menuentry "Windows 10 22H2 installer (UEFI only)" {
insmod part_gpt
insmod ntfs
insmod chain
search --set=root --fs-uuid 6EDDB3D371C7B1CE
chainloader ($root)/efi/boot/bootx64.efi
}
The Ubuntu kernel parameter “toram” causes the live media to be copied to RAM so after the boot, the USB stick can be disconnected. The USB stick boot will show:Copying live_media to ram
Add the Fedora 39 Plasma spin ISO image to the USB stick:
Download the ISO image Fedora-KDE-Live-x86_64-39-1.5.iso from https://archives.fedoraproject.org/pub/fedora/linux/releases/39/Spins/x86_64/iso/ and the checksum file https://archives.fedoraproject.org/pub/fedora/linux/releases/39/Spins/x86_64/iso/Fedora-Spins-39-1.5-x86_64-CHECKSUM. Verify the download with sha256sum -c --ignore-missing Fedora-Spins-39-1.5-x86_64-CHECKSUM
, then find the CDLABEL of the ISO image.
$ file Fedora-KDE-Live-x86_64-39-1.5.iso
Fedora-KDE-Live-x86_64-39-1.5.iso: ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) ‘Fedora-KDE-Live-39-1-5’ (bootable)
The CDLABEL is “Fedora-KDE-Live-39-1-5”.
Copy the ISO image to /mnt/sdb3:
# nocache dd if=/root/Fedora-KDE-Live-x86_64-39-1.5.iso of=/mnt/sdb3/Fedora-KDE-Live-x86_64-39-1.5.iso bs=1M status=progress
Now add the following block to /mnt/sdb2/boot/grub/grub.cfg:
menuentry "Fedora 39 Plasma spin live (BIOS and UEFI)" {
insmod part_gpt
search --set=root --fs-uuid 43ea70c0-9fc2-4d66-9f62-f1350ce5cff8
set isofile='Fedora-KDE-Live-x86_64-39-1.5.iso'
set isolabel='Fedora-KDE-Live-39-1-5'
loopback loop ($root)/$isofile
linux (loop)/images/pxeboot/vmlinuz iso-scan/filename=/$isofile root=live:CDLABEL=$isolabel ro rd.live.image
initrd (loop)/images/pxeboot/initrd.img
}
Add the Debian Bookworm ISO image on the USB stick:
Compare the ISO image hash with https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/SHA256SUMS (sha256sum -c --ignore-missing SHA256SUMS
)
Copy the ISO image to /mnt/sdb3:
# nocache dd if=/root/debian-live-12.5.0-amd64-gnome.iso of=/mnt/sdb3/debian-live-12.5.0-amd64-gnome.iso bs=1M status=progress
then add the following block to /mnt/sdb2/boot/grub/grub.cfg:
menuentry "Debian Bookworm 12.5.0 live (BIOS and UEFI)" {
insmod part_gpt
search --set=root --fs-uuid 43ea70c0-9fc2-4d66-9f62-f1350ce5cff8
set isofile='debian-live-12.5.0-amd64-gnome.iso'
loopback loop ($root)/$isofile
linux (loop)/live/vmlinuz-6.1.0-18-amd64 boot=live components findiso=$isofile
initrd (loop)/live/initrd.img-6.1.0-18-amd64
}
Add the SystemRescue ISO image on the USB stick:
Download systemrescue-11.00-amd64.iso from https://www.system-rescue.org/Download/
Compare the ISO image hash with https://www.system-rescue.org/releases/11.00/systemrescue-11.00-amd64.iso.sha256 (sha256sum -b systemrescue-11.00-amd64.iso
)
Copy the ISO image to /mnt/sdb3:
# nocache dd if=/root/systemrescue-11.00-amd64.iso of=/mnt/sdb3/systemrescue-11.00-amd64.iso bs=1M status=progress
Label /dev/sdb3: # tune2fs -L Linux_ISOs /dev/sdb3
Add the following grub config to /mnt/sdb2/boot/grub/grub.cfg:
menuentry "SystemRescue live (BIOS and UEFI)" {
set isofile='systemrescue-11.00-amd64.iso'
search --set=root --fs-uuid 43ea70c0-9fc2-4d66-9f62-f1350ce5cff8
loopback loop ($root)/$isofile
linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_label='Linux_ISOs' img_loop=/$isofile
initrd (loop)/sysresccd/boot/intel_ucode.img (loop)/sysresccd/boot/amd_ucode.img (loop)/sysresccd/boot/x86_64/sysresccd.img
}
Add the Rocky Linux 9.3 to the USB stick, download the ISO image https://download.rockylinux.org/pub/rocky/9/isos/x86_64/Rocky-9.3-x86_64-dvd.iso, check its hash against https://download.rockylinux.org/pub/rocky/9/isos/x86_64/CHECKSUM (sha256sum -c --ignore-missing CHECKSUM
).
Find the CDLABEL of the ISO image.
$ file Rocky-9.3-x86_64-dvd.iso
Rocky-9.3-x86_64-dvd.iso: ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) ‘Rocky-9-3-x86_64-dvd’ (bootable)
The CDLABEL is “Rocky-9-3-x86_64-dvd”.
Copy the ISO image to /mnt/sdb3:
# nocache dd if=/root/Rocky-9.3-x86_64-dvd.iso of=/mnt/sdb3/Rocky-9.3-x86_64-dvd.iso bs=1M status=progress
and add the following block to /mnt/sdb2/boot/grub/grub.cfg:
menuentry "Rocky Linux 9.3 installer (BIOS and UEFI)" {
search --set=root --fs-uuid 43ea70c0-9fc2-4d66-9f62-f1350ce5cff8
set isofile='Rocky-9.3-x86_64-dvd.iso'
set isolabel='Rocky-9-3-x86_64-dvd'
loopback loop ($root)/$isofile
linux (loop)/isolinux/vmlinuz iso-scan/filename=/$isofile inst.stage2=hd:LABEL=$isolabel
initrd (loop)/isolinux/initrd.img
}
Umount the filesystems:
# cd /; umount /mnt/sdb2 /mnt/sdb3 /mnt/sdb4 /mnt/sdb5 /mnt/hbcd /mnt/win10iso
Boot the USB stick in either BIOS or UEFI mode.
Leave a comment