Does anyone know how to install the gptmbr.bin onto a USB drive with Windows? I noticed that it would be really easy to modify the source of the installer to install gptmbr.bin instead of mbr.bin with the -m flag, but I'd like a solution that doesn't require me to maintain my own custom syslinux. I'm open to writing and submitting a patch to add a new flag (say -g) to install gptmbr.bin but I'd really like a solution that's more like running `cat gptmbr.bin > /dev/sdb` but on Windows. - Erik Sandberg
On 04.08.2016 00:58, Erik Sandberg via Syslinux wrote:> Does anyone know how to install the gptmbr.bin onto a USB drive with > Windows? I noticed that it would be really easy to modify the source of the > installer to install gptmbr.bin instead of mbr.bin with the -m flag, but > I'd like a solution that doesn't require me to maintain my own custom > syslinux. I'm open to writing and submitting a patch to add a new flag (say > -g) to install gptmbr.bin but I'd really like a solution that's more like > running `cat gptmbr.bin > /dev/sdb` but on Windows. > > - Erik Sandberg >When you offer to patch, why not cover both - PE32 and ELF, MBR and GPT $ wine64 /usr/share/syslinux/syslinux64.exe /? Usage: Z:\usr\share\syslinux\syslinux64.exe [options] <drive>: [bootsecfile] --directory -d Directory for installation target --install -i Install over the current bootsector --update -U Update a previous installation --zip -z Force zipdrive geometry (-H 64 -S 32) --sectors=# -S Force the number of sectors per track --heads=# -H Force number of heads --stupid -s Slow, safe and stupid mode --raid -r Fall back to the next device on boot failure --once=... -o Execute a command once upon boot --clear-once -O Clear the boot-once command --reset-adv Reset auxiliary data --menu-save= -M Set the label to select as default on the next boot --mbr -m Install an MBR --active -a Mark partition as active --force -f Ignore precautions $ /usr/bin/syslinux --help Usage: /usr/bin/syslinux [options] device --offset -t Offset of the file system on the device --directory -d Directory for installation target --install -i Install over the current bootsector --update -U Update a previous installation --zip -z Force zipdrive geometry (-H 64 -S 32) --sectors=# -S Force the number of sectors per track --heads=# -H Force number of heads --stupid -s Slow, safe and stupid mode --raid -r Fall back to the next device on boot failure --once=... Execute a command once upon boot --clear-once -O Clear the boot-once command --reset-adv Reset auxiliary data --menu-save= -M Set the label to select as default on the next boot --force -f Ignore precautions
On 8/3/2016 18:58, Erik Sandberg via Syslinux wrote:> Does anyone know how to install the gptmbr.bin onto a USB drive with > Windows? I noticed that it would be really easy to modify the source of the > installer to install gptmbr.bin instead of mbr.bin with the -m flag, but > I'd like a solution that doesn't require me to maintain my own custom > syslinux. I'm open to writing and submitting a patch to add a new flag (say > -g) to install gptmbr.bin but I'd really like a solution that's more like > running `cat gptmbr.bin > /dev/sdb` but on Windows.I sometimes use "rawwrite dd for windows version 0.3" by John Newbigin as well as "mirkes.de Tiny Hexer 1.8.1.6 small edition" by Markus Stephany. Using "dd --list" is educational in the former. Using "File > Disk > Open drive..." is educational in the latter. - Shao
> On 8/3/2016 18:58, Erik Sandberg via Syslinux wrote: > > Does anyone know how to install the gptmbr.bin onto a USB drive with > > Windows? I noticed that it would be really easy to modify the source of the > > installer to install gptmbr.bin instead of mbr.bin with the -m flag, but > > I'd like a solution that doesn't require me to maintain my own custom > > syslinux. I'm open to writing and submitting a patch to add a new flag (say > > -g) to install gptmbr.bin but I'd really like a solution that's more like > > running `cat gptmbr.bin > /dev/sdb` but on Windows.Using the "cat" command to write the MBR to a device is simple, but not always the recommended choice. Generally speaking, use "dd", _with appropriate parameters_. See: http://www.syslinux.org/wiki/index.php/Mbr At any rate, there are several ports to Windows of the "cat" command. The official Syslinux distribution archives downloaded from kernel.org also include a DOS-based command line utility named "copybs.com", which copies the boot sector "from a drive to a file". This tool performs the copy in the opposite direction of what is being requested in this email thread. Some Windows versions might not be able to correctly execute it, and I admit I don't recall whether it writes the first 440 bytes or more than that. Perhaps "copybs.asm" might be a starting point so to have this "opposite" task included / developed? Or perhaps FreeDOS' "sys.com" / "sys.exe"?> > I sometimes use "rawwrite dd for windows version 0.3" by John Newbigin > as well as "mirkes.de Tiny Hexer 1.8.1.6 small edition" by Markus > Stephany. Using "dd --list" is educational in the former. Using "File > > Disk > Open drive..." is educational in the latter. - ShaoWith regards to "dd for Windows" or similar, there are also several tools available for Windows, too many to mention. I wonder what would be the reason for Shao to suggest version 0.3 of "dd for windows by John Newbigin", instead of the latest version available at this time (0.6beta3). As usual hex-editing is also possible. Tiny Hexer, mentioned by Shao, is only one of many alternatives (e.g. HxD). Some of them are especially useful when it comes to (master) boot sectors and filesystem structures, but if writing gptmbr.bin is all that is needed, then the simpler the tool, the better ("dd for Windows" for this use case, IMHO). In case of choosing "dd for Windows", please note the special option(s) available only in the Windows version, so to be able to perform tasks on the "parent" device (not on a "drive" letter, which is a partition / volume) as required in this case. Regards, Ady.
Oh somehow I never noticed that "bootsecfile" option. That's probably what I need to use. I was looking at the source to see how the --mbr flag works and thought that there should be a way to do the same thing with the other mbr files. On Thu, Aug 4, 2016 at 2:41 AM poma <pomidorabelisima at gmail.com> wrote:> On 04.08.2016 00:58, Erik Sandberg via Syslinux wrote: > > Does anyone know how to install the gptmbr.bin onto a USB drive with > > Windows? I noticed that it would be really easy to modify the source of > the > > installer to install gptmbr.bin instead of mbr.bin with the -m flag, but > > I'd like a solution that doesn't require me to maintain my own custom > > syslinux. I'm open to writing and submitting a patch to add a new flag > (say > > -g) to install gptmbr.bin but I'd really like a solution that's more like > > running `cat gptmbr.bin > /dev/sdb` but on Windows. > > > > - Erik Sandberg > > > > > When you offer to patch, why not cover both - PE32 and ELF, MBR and GPT > > $ wine64 /usr/share/syslinux/syslinux64.exe /? > Usage: Z:\usr\share\syslinux\syslinux64.exe [options] <drive>: > [bootsecfile] > --directory -d Directory for installation target > --install -i Install over the current bootsector > --update -U Update a previous installation > --zip -z Force zipdrive geometry (-H 64 -S 32) > --sectors=# -S Force the number of sectors per track > --heads=# -H Force number of heads > --stupid -s Slow, safe and stupid mode > --raid -r Fall back to the next device on boot failure > --once=... -o Execute a command once upon boot > --clear-once -O Clear the boot-once command > --reset-adv Reset auxiliary data > --menu-save= -M Set the label to select as default on the next boot > --mbr -m Install an MBR > --active -a Mark partition as active > --force -f Ignore precautions > > $ /usr/bin/syslinux --help > Usage: /usr/bin/syslinux [options] device > --offset -t Offset of the file system on the device > --directory -d Directory for installation target > --install -i Install over the current bootsector > --update -U Update a previous installation > --zip -z Force zipdrive geometry (-H 64 -S 32) > --sectors=# -S Force the number of sectors per track > --heads=# -H Force number of heads > --stupid -s Slow, safe and stupid mode > --raid -r Fall back to the next device on boot failure > --once=... Execute a command once upon boot > --clear-once -O Clear the boot-once command > --reset-adv Reset auxiliary data > --menu-save= -M Set the label to select as default on the next boot > --force -f Ignore precautions > >