Andrew Stuart
2016-Nov-07 11:03 UTC
[syslinux] How do I create a syslinux bootable GPT UEFI Linux disk?
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
Ady Ady
2016-Nov-07 20:18 UTC
[syslinux] How do I create a syslinux bootable GPT UEFI Linux disk?
> > 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}11_ 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/boot2_ "/boot/" is not the default generic path for the default (U)EFI application/bootloader.> sudo /usr/local/sbin/extlinux --install /mnt/target/boot3_ 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.> thanksRegards, Ady.> _______________________________________________ > Syslinux mailing list > Submissions to Syslinux at zytor.com > Unsubscribe or set options at: > http://www.zytor.com/mailman/listinfo/syslinux