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

Andrew Stuart andrew.stuart at supercoders.com.au
Mon Nov 7 03:03:52 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:

DISK_DEVICE_NAME_CURRENT_OS=hda
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
sudo mkdir -p /mnt/target
sudo mount /dev/${DISK_DEVICE_NAME_CURRENT_OS}1 /mnt/target
sudo mkdir -p  /mnt/target/boot
sudo /usr/local/sbin/extlinux --install /mnt/target/boot
sudo dd if=/usr/local/share/syslinux/gptmbr.bin of=/dev/${DISK_DEVICE_NAME_CURRENT_OS}

When I boot, it says:

Booting from Hard Disk. Missing OS. No bootable device.

Any suggestions please as to how I can get this disk to boot?

thanks


More information about the Syslinux mailing list