I have been trying to manually create a usb flash drive that can boot several live Linux iso's using the UEFI booting method (I do not want to use any of the apps like MultiBoot that supposedly can do this). There is a simple explanation for getting one iso to boot on the following web-page:
http://askubuntu.com/questions/39587...sb-live-media/
Try as I might, I could not get more than one iso to boot, but finally I was able to figure out how to boot two, Fedora 20 and Parted Magic. If you care to follow these instructions, heed the following warning: Whenever you use tools like gparted, parted or gdisk, you run the risk of destroying data on any connected drive, including your system hard drive – so be very careful, and be forewarned.
Here is how I got my Linux iso's to boot on a HP Pavilion i3 core laptop:
First delete all data on you drive, using gparted, etc. Then create a GUID partition table (gpt) on your cleaned drive:
# gdisk /dev/sdx (“x” refers to your usb flash drive – sdb, sdc, etc).
Then type “?” and press the “enter” key to get a print-out of all the gdisk commands and their uses. Next type the letter “o” and press “enter” to create a gpt partitition table. Now type "n" to add (create) a partition after which you will hit the "enter" key three times (choosing the defaults) to make the first (and only) partition which will use the entire drive. Next type “t” and press “enter”, after which you will type “0700” (all numbers) and then press the enter-key. This will give you a microsoft-like partition. Finally you will type “w” and press “enter” which will write all of the above-mentioned changes.
Exit gdisk by typing “q” and pressing the enter-key. Now you will need to label your drive, especially if you want to boot Fedora, or another OS based on RedHat. To do this use gparted, navigate to your usb drive and click on the partition. Then right-click and select “Label” and enter whatever name you please. Then save the changes (actually only one change) by clicking on the check mark above. Disregard the warning about destroying any data (provided you are working on the correct drive!).
Now you will need to turn the partition into a FAT32 file system partition. To do this enter the following command in terminal:
# mkfs.vfat /dev/sdx1
After this make the drive bootable by using the following command (this might not be necessary):
# parted /dev/sdx set 1 boot on
The number 1 in the command listed above refers to the first partition. If you want to make a different partition bootable, then change the number to correspond to the proper partition.
Next you may have to mount your usb drive – if your Linux box doesn't recognize it. Use the following command:
# mount /dev/sdx1 /mnt (if /mnt doesn't exist, then create it like so: mkdir /mnt
Now copy the contents of Parted Magic (only certain distributions currently boot under EFI: Fedora and other Red Hat based OS's, Ubuntu, Parted Magic, and perhaps Debian and other Debian-based distributions are able to boot under UEFI, and only if they are 64 bit systems; in the near future many more Linux isos will be able so). To do this run the following command:
$ 7z x /path/to/PartedMagic.iso -o/path/to/drive
You can also choose to use Archive Manager or mount the iso as follows:
# mount -o loop pmagic.iso /mnt
Then copy the contents of the iso using this alternate (loop) method as follows:
$ cp -r /mnt /path/to/drive
Now you have a bootable drive that will boot Parted Magic using EFI. To get Fedora to boot, you copy all the contents of the Fedora iso except the EFI directory onto the root of the usb drive (using loop mount or Archive Manager). Next you create a directory called Fedora20 inside of the EFI directory that was created when you placed all of the contents of the Parted Magic iso on the root of the drive. You then copy the “boot” directory which is inside of the EFI directory of the Fedora iso into the Fedora20 directory which you just created. The only thing left to do is to change the Fedora grub.cfg file so that instead of pointing to the original iso file, everything is pointing to the name of your usb drive. Here is a copy of my amended grub.cfg file:
Code:
set default="1"
function load_video {
insmod efi_gop
insmod efi_uga
insmod video_bochs
insmod video_cirrus
insmod all_video
}
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set timeout=10
### END /etc/grub.d/00_header ###
search --no-floppy --set=root -l 'EFI_DRIVE'
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Start Fedora Live' --class fedora --class gnu-linux --class gnu --class os {
linuxefi /isolinux/vmlinuz0 root=live:LABEL=EFI_DRIVE ro rd.live.image quiet rhgb
initrdefi /isolinux/initrd0.img
}
menuentry 'Test this media & start Fedora Live' --class fedora --class gnu-linux --class gnu --class os {
linuxefi /isolinux/vmlinuz0 root=live:LABEL=EFI_DRIVE ro rd.live.image quiet rhgb rd.live.check
initrdefi /isolinux/initrd0.img
}
submenu 'Troubleshooting -->' {
menuentry 'Start Fedora Live in basic graphics mode' --class fedora --class gnu-linux --class gnu --class os {
linuxefi /isolinux/vmlinuz0 root=live:LABEL=EFI_DRIVE ro rd.live.image quiet rhgb nomodeset
initrdefi /isolinux/initrd0.img
}
}
Note that the only thing I changed was the name of the Fedora iso to “EFI_DRIVE”, the label of my usb drive. I had to make changes in several (actually 4) places, however.
At first I tried to place the “boot” directory (the subdirectory of EFI) of Parted Magic in the EFI directory just as I did with the Fedora “boot” directory, but that did not work. If you chose to use Ubuntu instead of Parted Magic, doing it this way would probably work (i.e., EFI/ubuntu/boot and EFI/Fedora20/boot)
The following are the contents of my EFI directory on the usb drive:
EFI/boot/ (which boots pmagic) The “boot” directory contains: bootx64.efi grub.cfg grub.cfg~ pmagic.png unicode.pf2
EFI/Fedora20/BOOT/ (which boots Fedora) The “BOOT” directory contains: BOOTX64.efi fonts grub.cfg grubx64.efi
In theory you could add Ubuntu, Mint, and other EFI bootable isos the same way I added Fedora. You can probably create directories on the root of the drive and fill each one with the contents of an iso, so that the root of the drive is less cluttered (i.e., /Fedora, /Ubuntu, /MintLinux, /Arch).
When I boot up my usb drive on my HP laptop I press esc, then F9 and choose “Boot From EFI File”. Then I navigate to the EFI directory, then choose either Fedora20 or “boot” (for Parted Magic) and then select “BOOT” or “boot” and then select BOOTX64.efi/bootx64.efi to start Fedora or Parted Magic.
Let me know how this works for you and whether you are able to boot other isos on the same usb drive.
If anyone knows or can figure out how to set up a usb drive to boot from an mbr AND an EFI system, please let me know.
In any case, I can now use Linux tools contained in a bootable usb drive to repair a UEFI system.