[syslinux] How do I create a syslinux bootable GPT UEFI Linux disk?

Ady Ady ady-sf at hotmail.com
Mon Nov 7 12:18:38 PST 2016

> I need to create one bootable UEFI disk partition that contains all
> the space on the disk. The steps must work in a shell script.
> Ideally with syslinux/extlinux but if not possible then grub. 
> How to do this? Surely it should be dead easy, a handful of lines?
> Nothing I do works. 
> This is what I have so far:
> echo remove all partitions
> sudo /usr/local/sbin/sgdisk -Z /dev/${DISK_DEVICE_NAME_CURRENT_OS}
> echo create GPT partition
> sudo /usr/local/sbin/sgdisk -n 1:: /dev/${DISK_DEVICE_NAME_CURRENT_OS}
> echo format file system
> sudo mkfs.ext4 -F /dev/${DISK_DEVICE_NAME_CURRENT_OS}1
1_ For (generic) UEFI systems, you should be using FAT32. Please 
consider relevant size limitations.
> sudo mkdir -p /mnt/target
> sudo mount /dev/${DISK_DEVICE_NAME_CURRENT_OS}1 /mnt/target
> sudo mkdir -p  /mnt/target/boot
2_ "/boot/" is not the default generic path for the default (U)EFI 
> sudo /usr/local/sbin/extlinux --install /mnt/target/boot
3_ The (extlinux) installation commands are relevant for BIOS systems 
only, not for UEFI.
> sudo dd if=/usr/local/share/syslinux/gptmbr.bin of=/dev/${DISK_DEVICE_NAME_CURRENT_OS}
4_ I would had done the dd of gptmbr.bin before formatting the 
partition and with some additional parameters, but in this context I'm 
not so sure it would impact your current experience.
> When I boot, it says:
> Booting from Hard Disk. Missing OS. No bootable device.
5_ You are probably missing the "active" flag set on for the relevant 
partition, although some UEFI implementations might actually dislike 
having such flag on, thus refusing to boot the device in UEFI mode and 
automatically falling back to CSM mode.
> Any suggestions please as to how I can get this disk to boot?
Reading about how (generic) UEFI systems boot by using the EFI System 
Partition ("ESP") would probably be my first suggestion.
> thanks
> _______________________________________________
> Syslinux mailing list
> Submissions to Syslinux at zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux

More information about the Syslinux mailing list