I can boot my USB pen using the method of writing the anyboot img to the pen (win32diskimager).
But I can’t boot the pen if using the other method, i.e booting Haiku from another drive and using the Installer to the pen drive.
I really wish to use up the available space on the pen (the 650mB on the anuboot img is not really enough).
Is there any way I can copy what I need from the boot sector of the anyboot img to the bootsector of the other method ?
Is there any app that can resize the partition of the anyboot img ?
When you install haiku on a pen drive via installer, it doesn’t write the MBR boot code, so the boot sequence stops before it finds the partition ( event if you made it bootable with installer or makebootable applications).
see http://dev.haiku-os.org/ticket/5595 http://dev.haiku-os.org/ticket/5980
but it is the right method if you don’t want to loose some space on your pen drive.
so we’ll try to copy the boot code from the “anyboot.img” generated pen drive to the target
Start DriveSetup to find the actual device_path for your pen drives (source and target)
Open Terminal and type the following command to install the MBR boot code from the source pen-drive to the target drive (adapt the command, to your actual device_paths):
if is your source USB pen drive device you booted from (you can replace it with the anyboot image file) of is your target USB pen drive (the one you want to make bootable) bs is the size of the block to copy - in bytes (here, the size of the boot code area). If you don’t want overwrite the partitions table, don’t exceed 440 bytes ! count is the number of block to copy
I recently had some difficulty getting ‘Anyboot’ to install to a USB. I eventually managed to ‘install’ to a USB by running the install from within the iso. That is I booted the ‘anyboot’ cd and installed once the iso was running bypassing the initial invitation to install.
This method makes all the space available on the USB…did for me anyhow!
I need to point out that not all of my USB thumb drives work with Haiku.
I found the ‘testdisk’ program from the MBR wiki page;
You need to ‘Analyse’ it with type ‘*’ (bootable partition) and then just save the result.
(‘testdisk’ also has it’s own MBR boot code, if all else fails, you don’t really need it, but it also boots.)
As you can see, the main difference is that the original IMG uses 'FF’s for the partition CHS address, the ‘DriveSetup’ or ‘Installer’ uses ‘00s’ and the ‘testdisk’ program uses actual values (01,02,00).
Be aware that, when you write “bs=450”, you write :
the boot code area
the disk ID
a part of the first partition entry
handle with caution ...
Using 3 ‘FF’ implies, you have a GPT (GUID-partition table) present on your disk (an EFI-System-partitioned" disk) …which seems not to be the case.
‘EF FF FF’ would be better for an Intel partitioned disk (a classic MBR).
But since your partition begins below the 1024th cylinder you shouldn’t use neither ‘EF FF FF’ nor ‘FF FF FF’.
It seems your partition begins at the address ‘40 00 00 00’ (LBA-little indian), that is to say, the 0x00000040th sector.
If you compute the CHS address you get ‘01 01 00’ (the correct value)
Tks, I couldn’t find much info on those 3 bytes, I guess that different bios’ would interpret them differently.
(btw, since CHS sectors start from 1,
‘40’ is the hex of lba sector 64 which is the 65th sector.
With 63 sectors/track, this would be the 2nd head (head 01) and 2nd sector (02)
on cyliner 0 (00), making bits “01 02 00”.)