Hi, Duncan Elliot wrote:> As far as I can see, this essentially trims off the first 3 bytes of the > custom isohybrid MBR image before applying it to the ISO.You probably mean this line: memcpy(mbr, &isohdpfx[hd0 + 3 * partok], MBRSIZE); The indize do not apply to bytes but to byte arrays of size MBRSIZE. extern unsigned char isohdpfx[][MBRSIZE]; (hd0 + 3 * partok) selects a particular MBR template from an array of six MBRs. See also http://www.syslinux.org/wiki/index.php?title=Isohybrid#MBR_selection It tells which isohd*.bin file is selected by which combination of options.> does anyone have suggestions for what modification I'd need to look at > to support this on a logical parttion?Sorry, not me. One will probably have to analyze the code of MBR and/or isolinux.bin to find out why it is not working with your situation. (Did you already tell which partitions exist and in which one do you want to put your ISO ?) Have a nice day :) Thomas
Thanks for the clarification Thomas. Thomas Schmitt wrote:> (Did you already tell which partitions exist and in which one do you want > to put your ISO ?)I've tried a number of different structures, but the results are consistent (boots fine from primary partitions, not from logical partitions). For example for a disk partitioned like below: Disk /dev/sdc: 3.8 GiB, 4007657472 bytes, 7827456 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xfc25117c Device Boot Start End Sectors Size Id Type /dev/sdc1 2048 616447 614400 300M 83 Linux /dev/sdc2 616448 1230847 614400 300M 83 Linux /dev/sdc3 1230848 1845247 614400 300M 83 Linux /dev/sdc4 1845248 7827455 5982208 2.9G 5 Extended /dev/sdc5 1847296 2461695 614400 300M 83 Linux /dev/sdc6 2463744 3078143 614400 300M 83 Linux I 'dd' the ISO to partitions 2, 3, 5 and 6. The ISO will boot successfully (when chainloaded from grub) on 2 and 3, but not on 5 and 6. Thanks, Duncan On 29 December 2016 at 19:35, Thomas Schmitt <scdbackup at gmx.net> wrote:> Hi, > > Duncan Elliot wrote: >> As far as I can see, this essentially trims off the first 3 bytes of the >> custom isohybrid MBR image before applying it to the ISO. > > You probably mean this line: > > memcpy(mbr, &isohdpfx[hd0 + 3 * partok], MBRSIZE); > > The indize do not apply to bytes but to byte arrays of size MBRSIZE. > > extern unsigned char isohdpfx[][MBRSIZE]; > > (hd0 + 3 * partok) selects a particular MBR template from an array of > six MBRs. See also > http://www.syslinux.org/wiki/index.php?title=Isohybrid#MBR_selection > > It tells which isohd*.bin file is selected by which combination of options. > > >> does anyone have suggestions for what modification I'd need to look at >> to support this on a logical parttion? > > Sorry, not me. One will probably have to analyze the code of MBR and/or > isolinux.bin to find out why it is not working with your situation. > > (Did you already tell which partitions exist and in which one do you want > to put your ISO ?) > > > Have a nice day :) > > Thomas>
Hi,> The ISO will boot successfully (when chainloaded from grub) on 2 and > 3, but not on 5 and 6.Did you try with a boot loader other than GRUB ? Afaik, the MBRs of newly bought USB sticks often contain code which hops on the MBR code of the partition that is marked by the boot flag. At least one could exclude that your problem is in a GRUB peculiarity. Have a nice day :) Thomas
> For example for a disk partitioned like below: > > Disk /dev/sdc: 3.8 GiB, 4007657472 bytes, 7827456 sectors > Units: sectors of 1 * 512 = 512 bytes > Sector size (logical/physical): 512 bytes / 512 bytes > I/O size (minimum/optimal): 512 bytes / 512 bytes > Disklabel type: dos > Disk identifier: 0xfc25117c > > Device Boot Start End Sectors Size Id Type > /dev/sdc1 2048 616447 614400 300M 83 Linux > /dev/sdc2 616448 1230847 614400 300M 83 Linux > /dev/sdc3 1230848 1845247 614400 300M 83 Linux > /dev/sdc4 1845248 7827455 5982208 2.9G 5 Extended > /dev/sdc5 1847296 2461695 614400 300M 83 Linux > /dev/sdc6 2463744 3078143 614400 300M 83 Linux > > > I 'dd' the ISO to partitions 2, 3, 5 and 6. > The ISO will boot successfully (when chainloaded from grub) on 2 and > 3, but not on 5 and 6. > > Thanks, > Duncan >Since I am not a developer, I do not really know at this time whether the problem is really in the "MBR" being used in the isohybrid tool. As mentioned at: en.wikipedia.org/w/index.php?title=Master_boot_record&action=edit§io n=3 (and in the tables following that section) The typical (modern) "MBR" supports 4 primary bootable partitions. The meaning of "bootable" in that context refers to the possibility of setting the "boot" flag on (one of) them. The classic MBR knows nothing about having a boot flag on a logical partition. You can set the boot flag to the Extended partition in the MBR's partition table, but Logical partitions are relevant in EBRs, not in the MBR. In addition to the examples shown in that Wikipedia page / section, IIRC also Ranish Partition Manager version 2.44 beta includes a workaround for the limitation of 4 primary partitions within 512 bytes. I think GAG has some workaround for the 4 partitions limitation too. For completeness, I should add SmartBootManager and XOSL as boot managers that somehow are able to boot more than 4 primary partitions, although I think that they use more than 512 bytes to achieve the goal. Summing up: if the problem is indeed in the MBR being used in the isohybrid tool, then the workaround might be in using a "customized" one (such as those special ones described in the tables in the Wikipedia article), supporting more than 4 partitions within 512 bytes. Regards, Ady.
Apparently Analagous Threads
- "isolinux.bin missing or corrupt" when booting USB flash drive in old PC
- isohybrid boot from logical partition
- "isolinux.bin missing or corrupt" when booting USB flash drive in old PC
- isohybrid boot from logical partition
- "isolinux.bin missing or corrupt" when booting USB flash drive in old PC