Bootable USB

I have neverf done a bootable USB drive before. Never really had a reason. Now I have done my first with Haiku. But I ahve to use a CD to make it boot :frowning: If i put in the CD and hold sift, I can then select the USB and boot it. I am not sure what I am doing wrong. I created the USB using the installer in Haiku. It went just fineā€¦???
David

1-does your USB-drive have a partition table ?
if not, it way be not recognized by the BIOS as a bootable drive
2-did you create the MBR with haiku ?
the master boot record should contain a little program, whose role is to load the boot sector of the partition.

How do I confirm if my USB has a partition table? If I use the CD (hold the shift) and manually choose the usb drive as the boot device it works.

The installer complted and gave a message that it has created a MBR on the USB drive.

Open DriveSetup
you will see something like

/dev/disk/USB/0/0/raw

=> itā€™s your USB device.

if you have a partition table, you will see (just below your device
) something like

/dev/disk/USB/0/0/0

=> itā€™s your partition

Installer doesnā€™t touch (or create) the MBR. However, it writes the haiku_loaderā€™s address in the partitionā€™s boot sector (also called ā€œsuperblockā€)

yes I have a partition

/dev/disk/USB/0/0/0

is there. I used gparted and made sure that the partition flag was ā€œbootableā€ however I still donā€™t have a bootable usb drive. :frowning:

It seems your MBR havenā€™t a working boot code.

here is a method to install a boot code on your USB drive.

Start DriveSetup to find the actual device_path for your CD (we are going to use the boot code from the Haiku CD becauseā€¦ it works)
it could be something like : /dev/disk/atapi/0/slave/raw
(find the line with the CD icon)

Open Terminal and type the following command to install the MBR boot code from the CD to the USB drive (adapt the command, to your actual device_paths):

dd if=/dev/disk/atapi/0/slave/raw of=/dev/disk/USB/0/0/raw bs=440 count=1

if is your source device (the Haiku CD)
of is your target USB drive
bs is the size of the block to copy - in bytes (itā€™s also 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

Now, you should be able to boot from the drive.

Have a lot of fun with Haiku!

edit:
This operation is done once for all, even if you install a new version.

I got it! Well sorta. It will boot on one PC, the one that is not really supported driver wise. But, doesnā€™t boot on the one that does have supported hardware. Either way, if I use the CD I can always choose to actually boot from the USB Drive. Thanks for all the help. Looking forward to seeing what happens next.