I used two USB sticks for this installation. The first (/dev/sdb) contained the F33 MATE installer and the second USB stick (/dev/sdc) was the target for the installation. You can boot the same root file system in BIOS and UEFI modes.
The ISO image name is F33-MATE-x86_64-LIVE-20201215.iso
Boot the F33 installer’s live session in UEFI mode, open a terminal and become root:$ sudo -i
List your USB devices:
# lsblk -o +TRAN | grep -i usb
sdb 8:16 1 59.6G 0 disk usb
sdc 8:32 1 14.9G 0 disk usb
If you have some partitions mounted off the target USB stick, umount them first:
# grep sdc /proc/mounts
# umount /run/media/liveuser/UUID
Erase the target USB stick’s partitions:
# sgdisk -Z /dev/sdc
Create partitions on the target USB stick:
# sgdisk \
--new 1::+256M --typecode=1:ef02 --change-name=1:'BIOS boot' \
--new 2::+256M --typecode=2:ef00 --change-name=2:'EFI System' \
--new 3::-0 --typecode=3:8300 --change-name=3:'Linux filesystem' \
/dev/sdc
Show the target USB stick’s partition table:
# fdisk -l /dev/sdc
Disklabel type: gpt
Device Start End Sectors Size Type
/dev/sdc1 2048 526335 524288 256M BIOS boot
/dev/sdc2 526336 1050623 524288 256M EFI System
/dev/sdc3 1050624 31350750 30300127 14.4G Linux filesystem
Start the F33 installer “Install to Hard Drive”.
Select the target for the installation (/dev/sdc, 16 GiB) and use the Advanced Custom partitioner (Blivet-GUI).
Format /dev/sdc2 as EFI system partition and set its mount point to /boot/efi
Format /dev/sdc3 as ext4 and set its mount point to /
I had to disable secure boot because grub complained about the kernel’s invalid
signature when booting the USB stick after the installation.
Reboot the computer and boot the newly created USB stick in UEFI mode.
After logging in, install grub on the USB stick for BIOS mode boot:
List your USB devices:# lsblk -o +TRAN | grep -i usb
sdb 8:32 1 14.9G 0 disk usb
# grub2-install --target=i386-pc --boot-directory=/boot /dev/sdb
# grub2-mkconfig -o /boot/grub2/grub.cfg
Now you can also boot the USB stick on a BIOS mode computer or in qemu-system-x86_64 in BIOS mode.
To boot the USB stick in BIOS mode in Qemu:
$ qemu-system-x86_64 -machine type=q35,accel=kvm \
-enable-kvm -cpu host -smp 2 -m 2048 \
-device virtio-net,netdev=vmnic -netdev user,id=vmnic,hostfwd=tcp::5222-:22 \
-device qemu-xhci,id=xhci -device usb-tablet,bus=xhci.0 \
-vga virtio -device intel-hda -device hda-duplex \
-no-quit -drive format=raw,file=/dev/sdb
To boot the USB stick in UEFI mode in Qemu:
First install edk2-ovmf (https://github.com/tianocore/tianocore.github.io/wiki/OVMF), then add these two options to the above qemu-system-x86_64 command:
-bios /usr/share/edk2/ovmf/OVMF_CODE.fd \
-smbios type=0,vendor=0vendor,version=0version,date=0date,release=0.0,uefi=on \
Leave a comment