# Creating bootable usb stick with will work on most of the computers (i386/amd64)



## nerozero (Jun 19, 2021)

Hi,

I'm experiencing this bug on some old computers (BTX halted), while downloaded usb memstick image works just fine.

here is how I'm prepareing a bootable usb device:

```
# disk:
cfg_disk=/dev/da0

gpart destroy -F $cfg_disk

gpart create -s gpt $cfg_disk

# p1
gpart add -a 4K -t efi -s 100M -l efi $cfg_disk

# p2
gpart add -a 4K -t freebsd-boot -s 512k -l boot $cfg_disk

# p3
gpart add -a 4K -t freebsd-swap -s 4G $cfg_disk

# p4
gpart add -a 4K -t freebsd-zfs -l system $cfg_disk

# write boot - efi:
mkdir -p /mnt/efi
newfs_msdos -F 32 -c 1 ${cfg_disk}p1
mount -t msdosfs ${cfg_disk}p1 /mnt/efi
mkdir -p /mnt/efi/EFI/BOOT
cp /boot/loader.efi  /mnt/efi/EFI/BOOT/BOOTX64.efi
umount /mnt/efi
rm -rf /mnt/efi

# bootcode
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 2 $cfg_disk
```

In my case da0 is usb ssd drive
Is it possible that this can be issue of GPT?

Thanks


----------

