Ubuntu/Debian Linux/Unix Howto Setup Install Syslinux Bootable USB with EFI and MBR from Command Line/CLI Terminal

There aren't too many simple guides that show you how to use commands to setup your USB or other drive as a normal bootable drive where you can easily boot custom kernels or whatever OS you would like.

1. Get the tools we need:

We install "syslinux" for MBR and "syslinux-efi" for EFI and "MBR" as we need a tool that embeds the actual MBR into our USB:

sudo apt install syslinux syslinux-efi mbr

2.) Format the Drive as VFAT/FAT:

This assumes your USB is partitioned and is partition 1 on drive sdj /dev/sdj1

mkfs.vat /dev/sdj1

#you may need to mark the partition as bootable in fdisk by hitting the "b" flag

3.) Install MBR onto the drive

Install the MBR on /dev/sdj

sudo install-mbr /dev/sdj

Now install syslinux to the partition

sudo syslinux -i /dev/sdj1

Download syslinux 6.04

https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/Testing/6.04/syslinux-6.04-pre1.zip

Extract it.

Install the EFI syslinux:

Mount it first:

mount /dev/sdj1 /mnt/sdj1

cd /mnt/sdj1

mkdir -p EFI/BOOT

#copy the EFI32 and EFI64 binaries to EFI/BOOT directory on your USB

BOOTIA32.efi BOOTX64.efi ldlinux.e32 ldlinux.e64

#file locations from .zip file linked above

./efi64/com32/elflink/ldlinux/ldlinux.e64

./efi64/efi/syslinux.efi #rename this to BOOTX64.efi

 

4.) Create your syslinux.cfg:



add this to syslinux.cfg in the root:

 DEFAULT realtechtalk
  SAY Now booting the kernel from realtechtalk.com SYSLINUX...
 LABEL realtechtalk
  KERNEL kernelfs
  APPEND initrd=initrd.img

 #you can  add extra kernel flags after initrd=initrd.img by adding a specify a flag. eg initrd=initrd.img ro quiet nosplash

More from Syslinux Documentation

Congrats you should now have an MBR and EFI compatible Bootable USB!


Tags:

ubuntu, debian, linux, unix, howto, install, syslinux, bootable, usb, efi, mbr, cli, terminalthere, aren, guides, commands, custom, kernels, os, quot, embeds, sudo, apt, format, vfat, assumes, partitioned, partition, sdj, dev, mkfs, vat, cfg, default, booting, kernel, realtechtalk, label, kernelfs, append, targetdev, nvme, initrd, initramfs, tar, gz,

Latest Articles

  • ssh Too many authentication failures not prompting for password
  • LightDM Mint Ubuntu Debian won't start errors Nvidia Graphics
  • WARNING: Unable to determine the path to install the libglvnd EGL vendor library config files. Check that you have pkg-config and the libglvnd development libraries installed, or specify a path with --glvnd-egl-config-path. Linux Ubuntu Mint Debian E
  • How To Upgrade Linux Mint 18.2 to 18.3 to 19.x and 20.x
  • MP3s Won't Play / ID3 Version 2.4 Issues in Cars and Other MP3 Players/CDs/DVDs Solution
  • LXC Containers LXD How to Install and Configure Tutorial Ubuntu Debian Mint
  • GlusterFS HowTo Tutorial For Distributed Storage in Docker, Kubernetes, LXC, KVM, Proxmox
  • Ubuntu Mint audio output not working pulseaudio "pulseaudio[13710]: [pulseaudio] sink-input.c: Failed to create sink input: too many inputs per sink."
  • How To Shrink Dynamically Allocated VM QEMU KVM VMware Disk Image File
  • How To Enable Linux Swapfile Instead of Partition Ubuntu Mint Debian Centos
  • 404 Not Found [IP: 151.101.194.132 80] apt update Debian 11 Bullseye Solution The repository 'http://security.debian.org bullseye/updates Release' does not have a Release file.
  • WARNING: Can't download daily.cvd from db.local.clamav.net freshclam clamav error solution
  • (firefox:9562): LIBDBUSMENU-GLIB-WARNING **: Unable to get session bus: Failed to execute child process "dbus-launch" (No such file or directory) Solution
  • Debian Mint Ubuntu Which Package Provides missing top, ps and w Solution
  • Vbox Virtualbox DNS NAT Network Mode NOT working
  • Docker Tutorial HowTo Install Docker, Use and Create Docker Container Images Clustering Swarm Mode Monitoring Service Hosting Provider
  • Zoom Password Error 'That passcode was incorrect' - Solution Wrong Passcode Wrong Meeting Name
  • How To Startup and Open Remote/Local Folder/Directory in Ubuntu Linux Mint automatically upon login
  • How To Reset Windows Server Password 2019, 2022, 7, 8, 10, 11 Recovery and Removal Guide Using Linux Ubuntu Mint Debian
  • How To Create OpenVPN Server for Secure Remote Corporate Access in Linux Debian/Mint/Ubuntu with client public key authentication