An Hybrid UEFI GPT + BIOS GPT/MBR boot USB disk is a disk that works on both UEFI and BIOS PCs.
== Requisites: ==
 *A working Linux installation with the following packages: ''grub2, grub2-efi, gdisk'' (on Debian Jessie: ''grub-pc-bin, grub-efi, grub-efi-amd64, gdisk'')
 *An USB drive
 *Some Linux ISO. 

=== Step 1: get the right /dev ===
From now on we will use a '''root shell''' because almost all commands we will use require it.

`root@debianvm:~#` '''fdisk -l'''<<BR>>

`...............`

`Disk /dev/sdc: 14.9 GiB, 16005464064 bytes, 31260672 sectors`<<BR>>
`Units: sectors of 1 * 512 = 512 bytes`<<BR>>
`Sector size (logical/physical): 512 bytes / 512 bytes`<<BR>>
`I/O size (minimum/optimal): 512 bytes / 512 bytes`<<BR>>
`Disklabel type: dos`<<BR>>
`Disk identifier: 0x00000000`<<BR>>

`Device     Boot Start      End  Sectors  Size Id Type`<<BR>>
`/dev/sdc1           2 31260671 31260670 14.9G af HFS / HFS+`<<BR>>


Find the right dev (ie: mine was '''/dev/sdc''' and ''I WILL USE IT IN THE GUIDE'', you have to use your dev).

=== Step 2: make GUID partition table and partitions ===
`root@debianvm:~#` '''gdisk /dev/sdc''' <<BR>>  
And then we are in gdisk prompt; from now on just give the commands in '''bold''' and the press enter.

`GPT fdisk (gdisk) version 0.8.10`<<BR>>

`Partition table scan:`<<BR>>
  `MBR: MBR only`<<BR>>
  `BSD: not present`<<BR>>
  `APM: not present`<<BR>>
  `GPT: not present`<<BR>>


`***************************************************************`<<BR>>
`Found invalid GPT and valid MBR; converting MBR to GPT format`<<BR>>
`in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by`<<BR>>
`typing 'q' if you don't want to convert your MBR partitions`<<BR>>
`to GPT format!`<<BR>>
`***************************************************************`<<BR>>

`Warning! Main partition table overlaps the first partition by 32 blocks!`<<BR>>
`You will need to delete this partition or resize it in another utility.`<<BR>>

`Warning! Secondary partition table overlaps the last partition by`<<BR>>
`33 blocks!`<<BR>>
`You will need to delete this partition or resize it in another utility.`<<BR>>

`Command (? for help): `'''o'''<<BR>>
`This option deletes all partitions and creates a new protective MBR.`<<BR>>
`Proceed? (Y/N):`''' y'''<<BR>>

`Command (? for help):` '''n'''
`Partition number (1-128, default 1): `<<BR>>
`First sector (34-31260638, default = 2048) or {+-}size{KMGTP}:`<<BR>> 
`Last sector (2048-31260638, default = 31260638) or {+-}size{KMGTP}:` '''+1M'''<<BR>>
`Current type is 'Linux filesystem'`
`Hex code or GUID (L to show codes, Enter = 8300):` '''EF02''' <<BR>>
`Changed type of partition to 'BIOS boot partition'`

`Command (? for help):`''' n'''<<BR>>
`Partition number (2-128, default 2):`<<BR>> 
`First sector (34-31260638, default = 4096) or {+-}size{KMGTP}:`<<BR>> 
`Last sector (4096-31260638, default = 31260638) or {+-}size{KMGTP}:` '''+50M''' <<BR>>
`Current type is 'Linux filesystem'`<<BR>>
`Hex code or GUID (L to show codes, Enter = 8300):` '''EF00'''<<BR>>
`Changed type of partition to 'EFI System'`<<BR>>

`Command (? for help):` '''n''' <<BR>>
`Partition number (3-128, default 3):`<<BR>> 
`First sector (34-31260638, default = 106496) or {+-}size{KMGTP}:`<<BR>> 
`Last sector (106496-31260638, default = 31260638) or {+-}size{KMGTP}: `<<BR>>
`Current type is 'Linux filesystem'`<<BR>>
`Hex code or GUID (L to show codes, Enter = 8300):` '''0700'''<<BR>>
`Changed type of partition to 'Microsoft basic data'`<<BR>>

`Command (? for help):` '''w''' <<BR>>

`Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING`<<BR>>
`PARTITIONS!!`<<BR>>

`Do you want to proceed? (Y/N):` '''y'''<<BR>>
`OK; writing new GUID partition table (GPT) to /dev/sdc.`<<BR>>
`The operation has completed successfully.`<<BR>>
Now gdisk will quit, it's ok.

=== Step 3: make hybrid GUID/MBR ===
`root@debianvm:~#` '''gdisk /dev/sdc'''<<BR>>
`GPT fdisk (gdisk) version 0.8.10`<<BR>>
``<<BR>>
`Partition table scan:`<<BR>>
`  MBR: protective`<<BR>>
`  BSD: not present`<<BR>>
`  APM: not present`<<BR>>
`  GPT: present`<<BR>>
``<<BR>>
`Found valid GPT with protective MBR; using GPT.`<<BR>>
``<<BR>>
`Command (? for help):` '''r'''<<BR>>
``<<BR>>
`Recovery/transformation command (? for help):`''' h'''<<BR>>
``<<BR>>
`WARNING! Hybrid MBRs are flaky and dangerous! If you decide not to use one,`<<BR>>
`just hit the Enter key at the below prompt and your MBR partition table will`<<BR>>
`be untouched.`<<BR>>
``<<BR>>
`Type from one to three GPT partition numbers, separated by spaces, to be`<<BR>>
`added to the hybrid MBR, in sequence:` '''1 2 3'''<<BR>>
`Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N):` '''n'''<<BR>>
``<<BR>>
`Creating entry for GPT partition #1 (MBR partition #1)`<<BR>>
`Enter an MBR hex code (default EF):` '''EF02'''<<BR>>
`Set the bootable flag? (Y/N):` '''n'''<<BR>>
``<<BR>>
`Creating entry for GPT partition #2 (MBR partition #2)`<<BR>>
`Enter an MBR hex code (default EF):` '''EF00'''<<BR>>
`Set the bootable flag? (Y/N):` '''n'''<<BR>>
``<<BR>>
`Creating entry for GPT partition #3 (MBR partition #3)`<<BR>>
`Enter an MBR hex code (default 07):` '''0700'''<<BR>>
`Set the bootable flag? (Y/N):` '''y'''<<BR>>
``<<BR>>
`Recovery/transformation command (? for help):` '''w'''<<BR>>
``<<BR>>
`Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING`<<BR>>
`PARTITIONS!!`<<BR>>
``<<BR>>
`Do you want to proceed? (Y/N):` '''y'''<<BR>>
`OK; writing new GUID partition table (GPT) to /dev/sdc.`<<BR>>
`The operation has completed successfully.`<<BR>>
gdisk will quit (again) and it's ok.

=== Step 4: format the partitons ===
We have to format in FAT32 two of the three partitions, '''''/dev/sdc2''''' and '''''/dev/sdc3'''''.
Umount the partitions if mounted and then:

`root@debianvm:~#` '''mkfs.fat -F32 -n GRUB2EFI /dev/sdc2'''<<BR>>
`mkfs.fat 3.0.27 (2014-11-12)`<<BR>>

`root@debianvm:~#` '''mkfs.fat -F32 -n DATA /dev/sdc3'''<<BR>>
`mkfs.fat 3.0.27 (2014-11-12)`<<BR>> 

Now the partitons are ready, we will mount '''''/devsdc2''''' to '''''/mnt/efi''''' and '''''/dev/sdc3''''' to '''''/mnt/data'''''.

`root@debianvm:~#` '''mkdir /mnt/efi'''<<BR>>
`root@debianvm:~#` '''mkdir /mnt/data'''<<BR>>
`root@debianvm:~#` '''mount /dev/sdc2 /mnt/efi/'''<<BR>>
`root@debianvm:~#` '''mount /dev/sdc3 /mnt/data/'''<<BR>>

=== Step 5: install grub ===
In this step we will install grub in EFI partition (mounted in /mnt/efi) and in MBR.

`root@debianvm:~#` '''grub-install --target=x86_64-efi --efi-directory=/mnt/efi --boot-directory=/mnt/data/boot --removable --recheck'''<<BR>>
`Installing for x86_64-efi platform.`<<BR>>
`Installation finished. No error reported.`<<BR>>

`root@debianvm:~#` '''grub-install --target=i386-pc --boot-directory=/mnt/data/boot --recheck /dev/sdc'''<<BR>>
`Installing for i386-pc platform.`<<BR>>
`Installation finished. No error reported.`<<BR>>

=== Step 6: create folders for ISOs ===
In '''''/mnt/data''''' we should now have only one directory, '''boot'''; let's create a directory for the ISOs.

`root@debianvm:~#` '''mkdir /mnt/data/iso'''<<BR>>
In '''''/mnt/data''''' we should now have <<BR>>
'''''/mnt/data/'''''<<BR>>
'''''- - - - - - - /boot/'''''<<BR>>
'''''- - - - - - - - - - - /grub/'''''<<BR>>
'''''- - - - - - - /iso/'''''<<BR>>
Now we add 2 folders in '''''/iso''''', one for the other ISOs and one for Debian (this is a workaround for a [[https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701772|known bug]]).<<BR>>
`root@debianvm:~#` '''mkdir /mnt/data/iso/debian'''<<BR>>
`root@debianvm:~#` '''mkdir /mnt/data/iso/others'''<<BR>>

Let's download some ISOs, here i will explain ho to configure grub to boot Debian XFCE  amd64 Installer and Tails i386; [[https://wiki.archlinux.org/index.php/Multiboot_USB_drive#Boot_entries|here]] there are instructions for other distros.

==== Debian ====
Download:
 * iso from [[http://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-8.5.0-amd64-xfce-CD-1.iso|http]] or [[http://cdimage.debian.org/debian-cd/current/amd64/bt-cd/debian-8.5.0-amd64-xfce-CD-1.iso.torrent|torrent]]
 * [[https://mirrors.kernel.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/vmlinuz|vmlinuz]]
 * [[https://mirrors.kernel.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/initrd.gz|initrd]]
And put these files into '''''/mnt/data/debian/'''''

==== Tails ====
Download the iso [[https://tails.boum.org/torrents/files/tails-i386-2.5.torrent|torrent]].
Then create a folder for tails and copy there the iso.

`root@debianvm:~#` '''mkdir /mnt/data/others/tails'''<<BR>>

In '''''/mnt/data''''' we should now have <<BR>>
'''''/mnt/data/'''''<<BR>>
'''''- - - - - - - /boot/'''''<<BR>>
'''''- - - - - - - - - - - /grub/'''''<<BR>>
'''''- - - - - - - /iso/'''''<<BR>>
'''''- - - - - - - - - - - /debian/'''''<<BR>>
'''''- - - - - - - - - - - - - - - - debian-8.5.0-amd64-xfce-CD-1.iso'''''<<BR>>
'''''- - - - - - - - - - - - - - - - vmlinuz'''''<<BR>>
'''''- - - - - - - - - - - - - - - - initrd.gz'''''<<BR>>
'''''- - - - - - - - - - - /others/'''''<<BR>>
'''''- - - - - - - - - - - - - - - - /tails/'''''<<BR>>
'''''- - - - - - - - - - - - - - - - - - - - tails-i386-2.5.iso'''''<<BR>>

=== Step 7: configure grub ===
Now we need to configure grub; grub at boot reads its config from a config file (grub.cfg). Create a '''grub.cfg''' file with the following content and copy it into '''''/mnt/data/boot/grub/''''':

{{{
# path to the partition holding ISO images (using UUID)
probe -u $root --set=rootuuid
set imgdevpath="/dev/disk/by-uuid/$rootuuid"

insmod exfat

# Setup video
if [ "$grub_platform" = "efi" ]
then
    insmod efi_gop
    insmod efi_uga
fi

if [ "$grub_platform" = "pc" ]
then
    insmod vbe
fi

# Setup font
insmod font

if loadfont ${prefix}/fonts/unicode.pf2
then
    insmod gfxterm
    set gfxmode=auto
    set gfxpayload=keep
    terminal_output gfxterm
fi

# Setup GRUB Screen
insmod jpeg
if background_image /boot/grub/grub_bg.jpg ; then
    set color_normal=white/black
    set color_highlight=white/green
else
    set menu_color_normal=white/black
    set menu_color_highlight=black/light-gray
fi

menuentry "Tails 2.5 i386" {
    set isofile='/iso/others/tails/tails-i386-2.5.iso'
    loopback loop $isofile
    linux (loop)/live/vmlinuz2 boot=live config findiso=${isofile} live-media=removable apparmor=1 security=apparmor nopersistent noprompt timezone=Etc/UTC block.events_dfl_poll_msecs=1000 noautologin module=Tails i2p
    initrd (loop)/live/initrd2.img
}

menuentry 'Debian 8.5.0 amd64 CD 1 XFCE' {
	set isofile='/iso/debian/debian-8.5.0-amd64-xfce-CD-1.iso'
	set initrdfile='/iso/debian/initrd.gz'
	loopback loop $isofile
	linux (loop)/install.amd/vmlinuz iso-scan/ask_second_pass=true
	initrd $initrdfile
}
menuentry "Reboot" {
	echo "System rebooting..."
	reboot
}

menuentry "Shutdown" {
	echo "System shutting down..."
	halt
}
}}}
It's done!
If you want to customize grub's background copy a .jpg into '''''/mnt/boot/grub/''''' and rename it '''grub_bg.jpg'''.
Now unmount the USB drive and test it.<<BR>>
`root@debianvm:~#` '''umount /mnt/efi'''<<BR>>
`root@debianvm:~#` '''umount /mnt/data'''<<BR>>

Sources: [[https://wiki.archlinux.org/index.php/Multiboot_USB_drive|arch linux wiki]] and many other sites.