1

There seem to be quite few tutorials for that but they are either for having both live and installed, or supporting old 32 bit systems and so on and have some complicated steps. I simply want to install it on a USB drive like I would install it on a HDD and have it boot on both UEFI (my macbook pro) and BIOS systems (desktop PCs).

I just tried that by booting from live install pendrive and installing to the other, but since the laptop had HDD with its own install, the installation process was offering to install on just that. When I choosed to do something else from the install, and selected the usb drive, it installed it but didn't work. I have no idea how to create the necessary partitions on my own, so that might be the reason. So, is there an easy way to do this since i'm really unexperienced?

user240891
  • 739
  • 4
  • 10
  • 26
  • Connect the USB you want Ubuntu to be installed on. Boot into a live CD/USB that has Ubuntu. Choose 'install Ubuntu' and then select 'something else'. In the next windows, select your device that you wish to install Ubuntu on (remember to put bootloader in this device!), format it to ext4 and install. Is this what you want? – Ron May 21 '15 at 10:45
  • @Ron, thanks buddy but that is exactly what I did. I just choose the USB to be formatted to ext4, and on the dropdown below that choose it to be the bootable one. It proceeded with the install and finished it, but it doesn't boot from it. – user240891 May 21 '15 at 14:27
  • This is similar to answer below: https://help.ubuntu.com/community/Installation/UEFI-and-BIOS But user found it only worked for a while & Rod Smith's suggestion that the grub versions interfere is true. I would follow this procedure to install, then install rEFInd as suggested. – oldfred May 21 '15 at 14:49

1 Answers1

1

I am assuming you are booting a PC in BIOS mode.

When running the Live CD/USB, choose "Try ubuntu"

Then run gparted and:

  • create a GPT partition table (Device > Create partition table) on your pendrive

  • create an ESP, fat32, 512MB, with esp flag.

  • create also a BIOS boot partition, unformatted, 32Mb, with bios_grub flag

Then click on install Ubuntu to install ubuntu on your pendrive, choosing "Something else" to select the correct drive.

Check that the bios boot partition is selected as Reserved BIOS boot area in the partitionning tool.

Be carefull to install grub on your pendrive by choosing the pendrive for bootloader isntallation.

Once the installation is completed, reboot into your new Ubuntu install, and open a terminal, and type:

sudo -i
mkdir /boot/efi
mount /dev/sdx1 /boot/efi     # where sdx1 is your efi partition

If your mac use 32 bit EFI then

apt-get install grub-efi-ia32
grub-install --target=i386-pc /dev/sdx

else

apt-get install grub-efi-amd64
grub-install --target=x86_64-efi /dev/sdx

then

cd /boot/efi/EFI/
mkdir boot

If your mac use 32 bit EFI then

cp ubuntu/grubia32.efi boot/bootia32.efi
cp boot/bootia32.efi boot/boot.efi

else

cp ubuntu/grubx64.efi boot/bootx64.efi
cp boot/bootx64.efi boot/boot.efi

umount /boot/efi

And try to boot on your mac. this might not work (I have not tested it). If not you will need to follow the instruction from there: http://glandium.org/blog/?p=2830 to change your ESP.

solsTiCe
  • 9,231
  • 1
    This might work, but it's conceivable that the BIOS and EFI versions of GRUB will interfere with each other. I therefore recommend installing some other EFI boot loader for Linux instead of GRUB. My own rEFInd is likely to be easy to install and configure. To do this, you would not do the apt-get install grub-efi-{arch} step, but would install the boot program of your choice manually, to EFI/boot/boot{arch}.efi on the ESP. – Rod Smith May 21 '15 at 13:06
  • So the whole complication is coming from the mac being UEFI, right? I couldn't dump it, but aren't most new PCs and laptops UEFI as well? – user240891 May 21 '15 at 14:29
  • the complicatoin is to use 2 differents boot system: EFI and BIOS at the same time. This is what you asked for. The easy way is to use 2 keys. one for EFI one for BIOS – solsTiCe May 21 '15 at 15:08