How to boot Ubuntu on a mac from external USB storage?












17















I wish to run Ubuntu on my iMac from external USB storage, either an external disk or a flash drive.



I can easily create a bootable USB stick and use that to install Ubuntu 14.04 onto a properly partitioned USB device. However, contrary to some assertions here and elsewhere, after restarting the result is not detected by the Mac as bootable.



I have Googled extensively and I'm sure it's possible to get the Mac to boot it, but the instructions I've found have been either too vague (Installing Ubuntu on and External Hard Drive and boot in a Mac) or in one case, too complex (http://www.rodsbooks.com/ubuntu-efi/) to make much sense. However, the common thread appears to be using rEFInd to rejig the boot options.



So, I've managed to get rEFInd installed on a partition on the external drive but it does not detect the Ubuntu installation. I have an ext2 /boot partition on the same disk, and copied ext2_x64.efi into the /EFI directory, but no go.



I'm a bit stuck at this point, and the next steps will have to be a detailed study of bootloaders and EFI. However, I think I must be close to cracking this and hope somebody can point to a step-by-step guide somewhere.



To recap:




  • USB disk has ext2 /boot partition (with vmlinuz image on it), and ext4 / partition with the rest of Ubuntu 14.04 installed

  • Isn't bootable after install

  • Put rEFInd on a another, FAT32 partition which contains /EFI directory

  • Copied ext2_x64 to /EFI/boot and /EFI/refind

  • Can boot, rEFInd loads, there is an option to boot ext2_x64.EFI(?) but no Ubuntu/vmlinuz.


If I can get this solved I will place a clear guide on the web somewhere!










share|improve this question





























    17















    I wish to run Ubuntu on my iMac from external USB storage, either an external disk or a flash drive.



    I can easily create a bootable USB stick and use that to install Ubuntu 14.04 onto a properly partitioned USB device. However, contrary to some assertions here and elsewhere, after restarting the result is not detected by the Mac as bootable.



    I have Googled extensively and I'm sure it's possible to get the Mac to boot it, but the instructions I've found have been either too vague (Installing Ubuntu on and External Hard Drive and boot in a Mac) or in one case, too complex (http://www.rodsbooks.com/ubuntu-efi/) to make much sense. However, the common thread appears to be using rEFInd to rejig the boot options.



    So, I've managed to get rEFInd installed on a partition on the external drive but it does not detect the Ubuntu installation. I have an ext2 /boot partition on the same disk, and copied ext2_x64.efi into the /EFI directory, but no go.



    I'm a bit stuck at this point, and the next steps will have to be a detailed study of bootloaders and EFI. However, I think I must be close to cracking this and hope somebody can point to a step-by-step guide somewhere.



    To recap:




    • USB disk has ext2 /boot partition (with vmlinuz image on it), and ext4 / partition with the rest of Ubuntu 14.04 installed

    • Isn't bootable after install

    • Put rEFInd on a another, FAT32 partition which contains /EFI directory

    • Copied ext2_x64 to /EFI/boot and /EFI/refind

    • Can boot, rEFInd loads, there is an option to boot ext2_x64.EFI(?) but no Ubuntu/vmlinuz.


    If I can get this solved I will place a clear guide on the web somewhere!










    share|improve this question



























      17












      17








      17


      12






      I wish to run Ubuntu on my iMac from external USB storage, either an external disk or a flash drive.



      I can easily create a bootable USB stick and use that to install Ubuntu 14.04 onto a properly partitioned USB device. However, contrary to some assertions here and elsewhere, after restarting the result is not detected by the Mac as bootable.



      I have Googled extensively and I'm sure it's possible to get the Mac to boot it, but the instructions I've found have been either too vague (Installing Ubuntu on and External Hard Drive and boot in a Mac) or in one case, too complex (http://www.rodsbooks.com/ubuntu-efi/) to make much sense. However, the common thread appears to be using rEFInd to rejig the boot options.



      So, I've managed to get rEFInd installed on a partition on the external drive but it does not detect the Ubuntu installation. I have an ext2 /boot partition on the same disk, and copied ext2_x64.efi into the /EFI directory, but no go.



      I'm a bit stuck at this point, and the next steps will have to be a detailed study of bootloaders and EFI. However, I think I must be close to cracking this and hope somebody can point to a step-by-step guide somewhere.



      To recap:




      • USB disk has ext2 /boot partition (with vmlinuz image on it), and ext4 / partition with the rest of Ubuntu 14.04 installed

      • Isn't bootable after install

      • Put rEFInd on a another, FAT32 partition which contains /EFI directory

      • Copied ext2_x64 to /EFI/boot and /EFI/refind

      • Can boot, rEFInd loads, there is an option to boot ext2_x64.EFI(?) but no Ubuntu/vmlinuz.


      If I can get this solved I will place a clear guide on the web somewhere!










      share|improve this question
















      I wish to run Ubuntu on my iMac from external USB storage, either an external disk or a flash drive.



      I can easily create a bootable USB stick and use that to install Ubuntu 14.04 onto a properly partitioned USB device. However, contrary to some assertions here and elsewhere, after restarting the result is not detected by the Mac as bootable.



      I have Googled extensively and I'm sure it's possible to get the Mac to boot it, but the instructions I've found have been either too vague (Installing Ubuntu on and External Hard Drive and boot in a Mac) or in one case, too complex (http://www.rodsbooks.com/ubuntu-efi/) to make much sense. However, the common thread appears to be using rEFInd to rejig the boot options.



      So, I've managed to get rEFInd installed on a partition on the external drive but it does not detect the Ubuntu installation. I have an ext2 /boot partition on the same disk, and copied ext2_x64.efi into the /EFI directory, but no go.



      I'm a bit stuck at this point, and the next steps will have to be a detailed study of bootloaders and EFI. However, I think I must be close to cracking this and hope somebody can point to a step-by-step guide somewhere.



      To recap:




      • USB disk has ext2 /boot partition (with vmlinuz image on it), and ext4 / partition with the rest of Ubuntu 14.04 installed

      • Isn't bootable after install

      • Put rEFInd on a another, FAT32 partition which contains /EFI directory

      • Copied ext2_x64 to /EFI/boot and /EFI/refind

      • Can boot, rEFInd loads, there is an option to boot ext2_x64.EFI(?) but no Ubuntu/vmlinuz.


      If I can get this solved I will place a clear guide on the web somewhere!







      boot usb uefi mac






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 13 '17 at 12:24









      Community

      1




      1










      asked Sep 19 '14 at 2:47









      ColjacColjac

      4311310




      4311310






















          7 Answers
          7






          active

          oldest

          votes


















          23














          Well, I spent a second whole day on it and now I've cracked it.



          I sincerely hope some other poor soul gets some value out of this.



          Here's a recipe that works (at least, on my iMac with Ubuntu 14.04):




          • Boot with bootable USB, install Ubuntu

          • Partition your USB as follows:


            • 200MB EFI boot partition

            • 200MB ext2, mount to /boot

            • Swap space if you want it

            • One or more other partitions to hold Ubuntu proper (e. g. ext4 on /)



          • Complete the install, reboot to OS X

          • Get gdisk (pkg installer for OS X) and rEFInd binaries

          • execute "diskutil list" from the console and note the device name, and the EFI partition (e. g. /dev/disk3, /dev/disk3s1)

          • Follow the gdisk recipe at http://www.rodsbooks.com/ubuntu-efi/ under "Fixing the installation" point 6


          • Install rEFInd on your USB's EFI partition. From the refind directory:



            ./refind-install -–usedefault /dev/disk3s1


            (you can drag the file into command prompt to get full path)




          Then when you reboot, you can "EFI Boot" to rEFInd, and there should be an option to boot GRUB/linux.



          I have documented this in more detail here: http://coljac.net/2014/stuff/installing-ubuntu-onto-a-bootable-usb-stick-or-other-device-on-a-mac/






          share|improve this answer





















          • 3





            4 days gone! & now I'm here, thank you :)

            – Ahmed Ghoneim
            Aug 11 '15 at 15:57











          • there's no longer an install.sh file in refind.

            – johndpope
            Sep 9 '17 at 19:31



















          7














          If you prefer not to change your Mac's default boot loader and have your USB key bootable from any Mac here is the solution I found:




          • start the Ubuntu live version by selecting "Try Ubuntu without installing"

          • prevent any bootloader installation by starting the installer via the ubiquity --no-bootloader command via Terminal

          • erase and install Ubuntu on your destination USB drive

          • restart your Mac and start the grub command line using the Ubuntu live USB and pressing 'c' when the GRUB bootloader shows up

          • perform a manual boot of the installed Ubuntu system


          • fix the EFI partition:





            • install required packages:



              $ sudo apt-get update
              $ sudo apt-get install mactel-boot hfsprogs gdisk grub-efi-amd64


            • use gdisk and mkfs.hfsplus to replace the existing partition with an Apple HFS/HFS+ one


            • replace the existing entry UUID=... /boot/efi vfat defaults 0 1 in your /etc/fstab file with UUID=<your usb EFI partition uuid> /boot/efi auto defaults 0 0

            • run sudo mount /boot/efi


            • create the required directories and files:



              $ sudo mkdir -p "/boot/efi/EFI/$(lsb_release -ds)/"
              $ sudo bash -c 'echo "This file is required for booting" > "/boot/efi/EFI/$(lsb_release -ds)/mach_kernel"'
              $ sudo bash -c 'echo "This file is required for booting" > /boot/efi/mach_kernel'



            • install GRUB:



              $ sudo grub-install --target x86_64-efi --boot-directory=/boot --efi-directory=/boot/efi --bootloader-id="$(lsb_release -ds)"



            • bless the bootloader code:



              $ sudo hfs-bless "/boot/efi/EFI/$(lsb_release -ds)/System/Library/CoreServices/boot.efi"



            • create the GRUB configuration:



              $ sudo sed -i 's/GRUB_HIDDEN/#GRUB_HIDDEN/g' /etc/default/grub
              $ sudo sed -i 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=0.1/' /etc/default/grub
              $ sudo grub-mkconfig -o /boot/grub/grub.cfg





          The system is now bootable from any Mac by simply pressing and holding the "Option" key at startup.



          Image of the Mac boot menu with Ubuntu entry



          I detailed the instructions here: Ubuntu installation on USB stick with pure EFI boot (Mac compatible)






          share|improve this answer

































            3














            I skipped the whole gdisk thing as mentioned in the solution.
            This alone worked for me



            ./refind-install -–usedefault /dev/<EFI-disk-of-external-storage-where-ubuntu-is-installed>





            share|improve this answer


























            • the install.sh is no longer part of refind (refind-bin-0.11.0). or maybe I'm missing something.

              – johndpope
              Sep 9 '17 at 19:30



















            2














            My story (can be useful to someone with the same problem - so it's my turn to help the community):
            I’ve installed Ubuntu on external USB 3.0 hard drive on an iMac late 2013. I created the following partition scheme on that external drive:



            EFI (200MB FAT), BOOT (200MB EXT2) and / (20GB EXT4)


            I choose to add a bootloader to the External drive (not the iMac drive)
            After the successful installation, I was shocked when I couldn’t boot my OS X. It's strange because I didn't install any bootloader on main drive.
            If I removed the external drive, I get a black screen with the grub prompt command!



            In panic, I researched online and I decided to give a try to rEFInd. After the installation from the .deb source ( http://www.rodsbooks.com/refind/installing.html - it's recommended to install from the .deb file to fix the problem with the Ubuntu 16.x versions - # dpkg -i refind_0.10.3-1_amd64.deb ) I could boot my OS X.



            To restore the original boot menu (and ditch Linux), you can use the startup disk utility on your OS X or you can mount the EFI partition and with the "sudo rm ..." command, remove the “refind” and “Ubuntu” folders on that partition.



            Reboot and everything will work like before.






            share|improve this answer































              1














              Install a fresh copy of OSX on the external drive and then install Ubuntu on the same external drive as you would a dual boot system. Once the installation is complete, Ubuntu will boot up from the USB drive if it's plugged in. If the USB drive is removed, you will get a Grub command line. Just type "exit" to boot the internal OSX installation. Plug in the USB drive to load up Ubuntu.



              This leaves the original OSX installation untouched.



              I was able to install Ubuntu and then Kubuntu on a 64GB USB flash drive and it runs quite well. I just installed Kodi and it runs surprisingly well from a flash drive. I only have USB 2.0 so it's a little slow. I ended up installing Kubuntu because the Plasma 5.0 desktop environment is a little more refined in think than the one Ubuntu uses.



              I hope this helps simplify things a little. It's not the most elegant or technical way to do it so it's not perfect but it works.






              share|improve this answer































                0














                I've never had luck with a straight external USB connection, but not long ago I picked up a Seagate GoFlex thunderbolt adapter and was able to easily boot a 27" iMac to ubuntu on an external SATA connected to it. I used rEFInd but not sure it was necessary. Seagate tries to create the impression that you will need to use one of their drives connected to it, but a standard laptop sized SATA drive worked fine. I did need to shim the drive slightly to fit the enclosure correctly. Not really the answer you're looking for here, and the it isn't a cheap workaround (around $80 if I remember correctly) but it might be worth it depending on your situation.






                share|improve this answer































                  0














                  Once you have installed Ubuntu on the external hard drive, boot up Ubuntu from Mac by holding option+control keys and pressing the left arrow key (might need to press left arrow key multiple times)






                  share|improve this answer

























                    Your Answer








                    StackExchange.ready(function() {
                    var channelOptions = {
                    tags: "".split(" "),
                    id: "89"
                    };
                    initTagRenderer("".split(" "), "".split(" "), channelOptions);

                    StackExchange.using("externalEditor", function() {
                    // Have to fire editor after snippets, if snippets enabled
                    if (StackExchange.settings.snippets.snippetsEnabled) {
                    StackExchange.using("snippets", function() {
                    createEditor();
                    });
                    }
                    else {
                    createEditor();
                    }
                    });

                    function createEditor() {
                    StackExchange.prepareEditor({
                    heartbeatType: 'answer',
                    autoActivateHeartbeat: false,
                    convertImagesToLinks: true,
                    noModals: true,
                    showLowRepImageUploadWarning: true,
                    reputationToPostImages: 10,
                    bindNavPrevention: true,
                    postfix: "",
                    imageUploader: {
                    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                    allowUrls: true
                    },
                    onDemand: true,
                    discardSelector: ".discard-answer"
                    ,immediatelyShowMarkdownHelp:true
                    });


                    }
                    });














                    draft saved

                    draft discarded


















                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f525845%2fhow-to-boot-ubuntu-on-a-mac-from-external-usb-storage%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown

























                    7 Answers
                    7






                    active

                    oldest

                    votes








                    7 Answers
                    7






                    active

                    oldest

                    votes









                    active

                    oldest

                    votes






                    active

                    oldest

                    votes









                    23














                    Well, I spent a second whole day on it and now I've cracked it.



                    I sincerely hope some other poor soul gets some value out of this.



                    Here's a recipe that works (at least, on my iMac with Ubuntu 14.04):




                    • Boot with bootable USB, install Ubuntu

                    • Partition your USB as follows:


                      • 200MB EFI boot partition

                      • 200MB ext2, mount to /boot

                      • Swap space if you want it

                      • One or more other partitions to hold Ubuntu proper (e. g. ext4 on /)



                    • Complete the install, reboot to OS X

                    • Get gdisk (pkg installer for OS X) and rEFInd binaries

                    • execute "diskutil list" from the console and note the device name, and the EFI partition (e. g. /dev/disk3, /dev/disk3s1)

                    • Follow the gdisk recipe at http://www.rodsbooks.com/ubuntu-efi/ under "Fixing the installation" point 6


                    • Install rEFInd on your USB's EFI partition. From the refind directory:



                      ./refind-install -–usedefault /dev/disk3s1


                      (you can drag the file into command prompt to get full path)




                    Then when you reboot, you can "EFI Boot" to rEFInd, and there should be an option to boot GRUB/linux.



                    I have documented this in more detail here: http://coljac.net/2014/stuff/installing-ubuntu-onto-a-bootable-usb-stick-or-other-device-on-a-mac/






                    share|improve this answer





















                    • 3





                      4 days gone! & now I'm here, thank you :)

                      – Ahmed Ghoneim
                      Aug 11 '15 at 15:57











                    • there's no longer an install.sh file in refind.

                      – johndpope
                      Sep 9 '17 at 19:31
















                    23














                    Well, I spent a second whole day on it and now I've cracked it.



                    I sincerely hope some other poor soul gets some value out of this.



                    Here's a recipe that works (at least, on my iMac with Ubuntu 14.04):




                    • Boot with bootable USB, install Ubuntu

                    • Partition your USB as follows:


                      • 200MB EFI boot partition

                      • 200MB ext2, mount to /boot

                      • Swap space if you want it

                      • One or more other partitions to hold Ubuntu proper (e. g. ext4 on /)



                    • Complete the install, reboot to OS X

                    • Get gdisk (pkg installer for OS X) and rEFInd binaries

                    • execute "diskutil list" from the console and note the device name, and the EFI partition (e. g. /dev/disk3, /dev/disk3s1)

                    • Follow the gdisk recipe at http://www.rodsbooks.com/ubuntu-efi/ under "Fixing the installation" point 6


                    • Install rEFInd on your USB's EFI partition. From the refind directory:



                      ./refind-install -–usedefault /dev/disk3s1


                      (you can drag the file into command prompt to get full path)




                    Then when you reboot, you can "EFI Boot" to rEFInd, and there should be an option to boot GRUB/linux.



                    I have documented this in more detail here: http://coljac.net/2014/stuff/installing-ubuntu-onto-a-bootable-usb-stick-or-other-device-on-a-mac/






                    share|improve this answer





















                    • 3





                      4 days gone! & now I'm here, thank you :)

                      – Ahmed Ghoneim
                      Aug 11 '15 at 15:57











                    • there's no longer an install.sh file in refind.

                      – johndpope
                      Sep 9 '17 at 19:31














                    23












                    23








                    23







                    Well, I spent a second whole day on it and now I've cracked it.



                    I sincerely hope some other poor soul gets some value out of this.



                    Here's a recipe that works (at least, on my iMac with Ubuntu 14.04):




                    • Boot with bootable USB, install Ubuntu

                    • Partition your USB as follows:


                      • 200MB EFI boot partition

                      • 200MB ext2, mount to /boot

                      • Swap space if you want it

                      • One or more other partitions to hold Ubuntu proper (e. g. ext4 on /)



                    • Complete the install, reboot to OS X

                    • Get gdisk (pkg installer for OS X) and rEFInd binaries

                    • execute "diskutil list" from the console and note the device name, and the EFI partition (e. g. /dev/disk3, /dev/disk3s1)

                    • Follow the gdisk recipe at http://www.rodsbooks.com/ubuntu-efi/ under "Fixing the installation" point 6


                    • Install rEFInd on your USB's EFI partition. From the refind directory:



                      ./refind-install -–usedefault /dev/disk3s1


                      (you can drag the file into command prompt to get full path)




                    Then when you reboot, you can "EFI Boot" to rEFInd, and there should be an option to boot GRUB/linux.



                    I have documented this in more detail here: http://coljac.net/2014/stuff/installing-ubuntu-onto-a-bootable-usb-stick-or-other-device-on-a-mac/






                    share|improve this answer















                    Well, I spent a second whole day on it and now I've cracked it.



                    I sincerely hope some other poor soul gets some value out of this.



                    Here's a recipe that works (at least, on my iMac with Ubuntu 14.04):




                    • Boot with bootable USB, install Ubuntu

                    • Partition your USB as follows:


                      • 200MB EFI boot partition

                      • 200MB ext2, mount to /boot

                      • Swap space if you want it

                      • One or more other partitions to hold Ubuntu proper (e. g. ext4 on /)



                    • Complete the install, reboot to OS X

                    • Get gdisk (pkg installer for OS X) and rEFInd binaries

                    • execute "diskutil list" from the console and note the device name, and the EFI partition (e. g. /dev/disk3, /dev/disk3s1)

                    • Follow the gdisk recipe at http://www.rodsbooks.com/ubuntu-efi/ under "Fixing the installation" point 6


                    • Install rEFInd on your USB's EFI partition. From the refind directory:



                      ./refind-install -–usedefault /dev/disk3s1


                      (you can drag the file into command prompt to get full path)




                    Then when you reboot, you can "EFI Boot" to rEFInd, and there should be an option to boot GRUB/linux.



                    I have documented this in more detail here: http://coljac.net/2014/stuff/installing-ubuntu-onto-a-bootable-usb-stick-or-other-device-on-a-mac/







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Sep 9 '17 at 21:05









                    David Foerster

                    28.5k1366112




                    28.5k1366112










                    answered Sep 19 '14 at 7:46









                    ColjacColjac

                    4311310




                    4311310








                    • 3





                      4 days gone! & now I'm here, thank you :)

                      – Ahmed Ghoneim
                      Aug 11 '15 at 15:57











                    • there's no longer an install.sh file in refind.

                      – johndpope
                      Sep 9 '17 at 19:31














                    • 3





                      4 days gone! & now I'm here, thank you :)

                      – Ahmed Ghoneim
                      Aug 11 '15 at 15:57











                    • there's no longer an install.sh file in refind.

                      – johndpope
                      Sep 9 '17 at 19:31








                    3




                    3





                    4 days gone! & now I'm here, thank you :)

                    – Ahmed Ghoneim
                    Aug 11 '15 at 15:57





                    4 days gone! & now I'm here, thank you :)

                    – Ahmed Ghoneim
                    Aug 11 '15 at 15:57













                    there's no longer an install.sh file in refind.

                    – johndpope
                    Sep 9 '17 at 19:31





                    there's no longer an install.sh file in refind.

                    – johndpope
                    Sep 9 '17 at 19:31













                    7














                    If you prefer not to change your Mac's default boot loader and have your USB key bootable from any Mac here is the solution I found:




                    • start the Ubuntu live version by selecting "Try Ubuntu without installing"

                    • prevent any bootloader installation by starting the installer via the ubiquity --no-bootloader command via Terminal

                    • erase and install Ubuntu on your destination USB drive

                    • restart your Mac and start the grub command line using the Ubuntu live USB and pressing 'c' when the GRUB bootloader shows up

                    • perform a manual boot of the installed Ubuntu system


                    • fix the EFI partition:





                      • install required packages:



                        $ sudo apt-get update
                        $ sudo apt-get install mactel-boot hfsprogs gdisk grub-efi-amd64


                      • use gdisk and mkfs.hfsplus to replace the existing partition with an Apple HFS/HFS+ one


                      • replace the existing entry UUID=... /boot/efi vfat defaults 0 1 in your /etc/fstab file with UUID=<your usb EFI partition uuid> /boot/efi auto defaults 0 0

                      • run sudo mount /boot/efi


                      • create the required directories and files:



                        $ sudo mkdir -p "/boot/efi/EFI/$(lsb_release -ds)/"
                        $ sudo bash -c 'echo "This file is required for booting" > "/boot/efi/EFI/$(lsb_release -ds)/mach_kernel"'
                        $ sudo bash -c 'echo "This file is required for booting" > /boot/efi/mach_kernel'



                      • install GRUB:



                        $ sudo grub-install --target x86_64-efi --boot-directory=/boot --efi-directory=/boot/efi --bootloader-id="$(lsb_release -ds)"



                      • bless the bootloader code:



                        $ sudo hfs-bless "/boot/efi/EFI/$(lsb_release -ds)/System/Library/CoreServices/boot.efi"



                      • create the GRUB configuration:



                        $ sudo sed -i 's/GRUB_HIDDEN/#GRUB_HIDDEN/g' /etc/default/grub
                        $ sudo sed -i 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=0.1/' /etc/default/grub
                        $ sudo grub-mkconfig -o /boot/grub/grub.cfg





                    The system is now bootable from any Mac by simply pressing and holding the "Option" key at startup.



                    Image of the Mac boot menu with Ubuntu entry



                    I detailed the instructions here: Ubuntu installation on USB stick with pure EFI boot (Mac compatible)






                    share|improve this answer






























                      7














                      If you prefer not to change your Mac's default boot loader and have your USB key bootable from any Mac here is the solution I found:




                      • start the Ubuntu live version by selecting "Try Ubuntu without installing"

                      • prevent any bootloader installation by starting the installer via the ubiquity --no-bootloader command via Terminal

                      • erase and install Ubuntu on your destination USB drive

                      • restart your Mac and start the grub command line using the Ubuntu live USB and pressing 'c' when the GRUB bootloader shows up

                      • perform a manual boot of the installed Ubuntu system


                      • fix the EFI partition:





                        • install required packages:



                          $ sudo apt-get update
                          $ sudo apt-get install mactel-boot hfsprogs gdisk grub-efi-amd64


                        • use gdisk and mkfs.hfsplus to replace the existing partition with an Apple HFS/HFS+ one


                        • replace the existing entry UUID=... /boot/efi vfat defaults 0 1 in your /etc/fstab file with UUID=<your usb EFI partition uuid> /boot/efi auto defaults 0 0

                        • run sudo mount /boot/efi


                        • create the required directories and files:



                          $ sudo mkdir -p "/boot/efi/EFI/$(lsb_release -ds)/"
                          $ sudo bash -c 'echo "This file is required for booting" > "/boot/efi/EFI/$(lsb_release -ds)/mach_kernel"'
                          $ sudo bash -c 'echo "This file is required for booting" > /boot/efi/mach_kernel'



                        • install GRUB:



                          $ sudo grub-install --target x86_64-efi --boot-directory=/boot --efi-directory=/boot/efi --bootloader-id="$(lsb_release -ds)"



                        • bless the bootloader code:



                          $ sudo hfs-bless "/boot/efi/EFI/$(lsb_release -ds)/System/Library/CoreServices/boot.efi"



                        • create the GRUB configuration:



                          $ sudo sed -i 's/GRUB_HIDDEN/#GRUB_HIDDEN/g' /etc/default/grub
                          $ sudo sed -i 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=0.1/' /etc/default/grub
                          $ sudo grub-mkconfig -o /boot/grub/grub.cfg





                      The system is now bootable from any Mac by simply pressing and holding the "Option" key at startup.



                      Image of the Mac boot menu with Ubuntu entry



                      I detailed the instructions here: Ubuntu installation on USB stick with pure EFI boot (Mac compatible)






                      share|improve this answer




























                        7












                        7








                        7







                        If you prefer not to change your Mac's default boot loader and have your USB key bootable from any Mac here is the solution I found:




                        • start the Ubuntu live version by selecting "Try Ubuntu without installing"

                        • prevent any bootloader installation by starting the installer via the ubiquity --no-bootloader command via Terminal

                        • erase and install Ubuntu on your destination USB drive

                        • restart your Mac and start the grub command line using the Ubuntu live USB and pressing 'c' when the GRUB bootloader shows up

                        • perform a manual boot of the installed Ubuntu system


                        • fix the EFI partition:





                          • install required packages:



                            $ sudo apt-get update
                            $ sudo apt-get install mactel-boot hfsprogs gdisk grub-efi-amd64


                          • use gdisk and mkfs.hfsplus to replace the existing partition with an Apple HFS/HFS+ one


                          • replace the existing entry UUID=... /boot/efi vfat defaults 0 1 in your /etc/fstab file with UUID=<your usb EFI partition uuid> /boot/efi auto defaults 0 0

                          • run sudo mount /boot/efi


                          • create the required directories and files:



                            $ sudo mkdir -p "/boot/efi/EFI/$(lsb_release -ds)/"
                            $ sudo bash -c 'echo "This file is required for booting" > "/boot/efi/EFI/$(lsb_release -ds)/mach_kernel"'
                            $ sudo bash -c 'echo "This file is required for booting" > /boot/efi/mach_kernel'



                          • install GRUB:



                            $ sudo grub-install --target x86_64-efi --boot-directory=/boot --efi-directory=/boot/efi --bootloader-id="$(lsb_release -ds)"



                          • bless the bootloader code:



                            $ sudo hfs-bless "/boot/efi/EFI/$(lsb_release -ds)/System/Library/CoreServices/boot.efi"



                          • create the GRUB configuration:



                            $ sudo sed -i 's/GRUB_HIDDEN/#GRUB_HIDDEN/g' /etc/default/grub
                            $ sudo sed -i 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=0.1/' /etc/default/grub
                            $ sudo grub-mkconfig -o /boot/grub/grub.cfg





                        The system is now bootable from any Mac by simply pressing and holding the "Option" key at startup.



                        Image of the Mac boot menu with Ubuntu entry



                        I detailed the instructions here: Ubuntu installation on USB stick with pure EFI boot (Mac compatible)






                        share|improve this answer















                        If you prefer not to change your Mac's default boot loader and have your USB key bootable from any Mac here is the solution I found:




                        • start the Ubuntu live version by selecting "Try Ubuntu without installing"

                        • prevent any bootloader installation by starting the installer via the ubiquity --no-bootloader command via Terminal

                        • erase and install Ubuntu on your destination USB drive

                        • restart your Mac and start the grub command line using the Ubuntu live USB and pressing 'c' when the GRUB bootloader shows up

                        • perform a manual boot of the installed Ubuntu system


                        • fix the EFI partition:





                          • install required packages:



                            $ sudo apt-get update
                            $ sudo apt-get install mactel-boot hfsprogs gdisk grub-efi-amd64


                          • use gdisk and mkfs.hfsplus to replace the existing partition with an Apple HFS/HFS+ one


                          • replace the existing entry UUID=... /boot/efi vfat defaults 0 1 in your /etc/fstab file with UUID=<your usb EFI partition uuid> /boot/efi auto defaults 0 0

                          • run sudo mount /boot/efi


                          • create the required directories and files:



                            $ sudo mkdir -p "/boot/efi/EFI/$(lsb_release -ds)/"
                            $ sudo bash -c 'echo "This file is required for booting" > "/boot/efi/EFI/$(lsb_release -ds)/mach_kernel"'
                            $ sudo bash -c 'echo "This file is required for booting" > /boot/efi/mach_kernel'



                          • install GRUB:



                            $ sudo grub-install --target x86_64-efi --boot-directory=/boot --efi-directory=/boot/efi --bootloader-id="$(lsb_release -ds)"



                          • bless the bootloader code:



                            $ sudo hfs-bless "/boot/efi/EFI/$(lsb_release -ds)/System/Library/CoreServices/boot.efi"



                          • create the GRUB configuration:



                            $ sudo sed -i 's/GRUB_HIDDEN/#GRUB_HIDDEN/g' /etc/default/grub
                            $ sudo sed -i 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=0.1/' /etc/default/grub
                            $ sudo grub-mkconfig -o /boot/grub/grub.cfg





                        The system is now bootable from any Mac by simply pressing and holding the "Option" key at startup.



                        Image of the Mac boot menu with Ubuntu entry



                        I detailed the instructions here: Ubuntu installation on USB stick with pure EFI boot (Mac compatible)







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Aug 4 '16 at 12:24

























                        answered Aug 4 '16 at 10:47









                        mmigliermmiglier

                        7113




                        7113























                            3














                            I skipped the whole gdisk thing as mentioned in the solution.
                            This alone worked for me



                            ./refind-install -–usedefault /dev/<EFI-disk-of-external-storage-where-ubuntu-is-installed>





                            share|improve this answer


























                            • the install.sh is no longer part of refind (refind-bin-0.11.0). or maybe I'm missing something.

                              – johndpope
                              Sep 9 '17 at 19:30
















                            3














                            I skipped the whole gdisk thing as mentioned in the solution.
                            This alone worked for me



                            ./refind-install -–usedefault /dev/<EFI-disk-of-external-storage-where-ubuntu-is-installed>





                            share|improve this answer


























                            • the install.sh is no longer part of refind (refind-bin-0.11.0). or maybe I'm missing something.

                              – johndpope
                              Sep 9 '17 at 19:30














                            3












                            3








                            3







                            I skipped the whole gdisk thing as mentioned in the solution.
                            This alone worked for me



                            ./refind-install -–usedefault /dev/<EFI-disk-of-external-storage-where-ubuntu-is-installed>





                            share|improve this answer















                            I skipped the whole gdisk thing as mentioned in the solution.
                            This alone worked for me



                            ./refind-install -–usedefault /dev/<EFI-disk-of-external-storage-where-ubuntu-is-installed>






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Sep 9 '17 at 21:18









                            johndpope

                            1054




                            1054










                            answered Jun 30 '15 at 9:20









                            sachinsachin

                            311




                            311













                            • the install.sh is no longer part of refind (refind-bin-0.11.0). or maybe I'm missing something.

                              – johndpope
                              Sep 9 '17 at 19:30



















                            • the install.sh is no longer part of refind (refind-bin-0.11.0). or maybe I'm missing something.

                              – johndpope
                              Sep 9 '17 at 19:30

















                            the install.sh is no longer part of refind (refind-bin-0.11.0). or maybe I'm missing something.

                            – johndpope
                            Sep 9 '17 at 19:30





                            the install.sh is no longer part of refind (refind-bin-0.11.0). or maybe I'm missing something.

                            – johndpope
                            Sep 9 '17 at 19:30











                            2














                            My story (can be useful to someone with the same problem - so it's my turn to help the community):
                            I’ve installed Ubuntu on external USB 3.0 hard drive on an iMac late 2013. I created the following partition scheme on that external drive:



                            EFI (200MB FAT), BOOT (200MB EXT2) and / (20GB EXT4)


                            I choose to add a bootloader to the External drive (not the iMac drive)
                            After the successful installation, I was shocked when I couldn’t boot my OS X. It's strange because I didn't install any bootloader on main drive.
                            If I removed the external drive, I get a black screen with the grub prompt command!



                            In panic, I researched online and I decided to give a try to rEFInd. After the installation from the .deb source ( http://www.rodsbooks.com/refind/installing.html - it's recommended to install from the .deb file to fix the problem with the Ubuntu 16.x versions - # dpkg -i refind_0.10.3-1_amd64.deb ) I could boot my OS X.



                            To restore the original boot menu (and ditch Linux), you can use the startup disk utility on your OS X or you can mount the EFI partition and with the "sudo rm ..." command, remove the “refind” and “Ubuntu” folders on that partition.



                            Reboot and everything will work like before.






                            share|improve this answer




























                              2














                              My story (can be useful to someone with the same problem - so it's my turn to help the community):
                              I’ve installed Ubuntu on external USB 3.0 hard drive on an iMac late 2013. I created the following partition scheme on that external drive:



                              EFI (200MB FAT), BOOT (200MB EXT2) and / (20GB EXT4)


                              I choose to add a bootloader to the External drive (not the iMac drive)
                              After the successful installation, I was shocked when I couldn’t boot my OS X. It's strange because I didn't install any bootloader on main drive.
                              If I removed the external drive, I get a black screen with the grub prompt command!



                              In panic, I researched online and I decided to give a try to rEFInd. After the installation from the .deb source ( http://www.rodsbooks.com/refind/installing.html - it's recommended to install from the .deb file to fix the problem with the Ubuntu 16.x versions - # dpkg -i refind_0.10.3-1_amd64.deb ) I could boot my OS X.



                              To restore the original boot menu (and ditch Linux), you can use the startup disk utility on your OS X or you can mount the EFI partition and with the "sudo rm ..." command, remove the “refind” and “Ubuntu” folders on that partition.



                              Reboot and everything will work like before.






                              share|improve this answer


























                                2












                                2








                                2







                                My story (can be useful to someone with the same problem - so it's my turn to help the community):
                                I’ve installed Ubuntu on external USB 3.0 hard drive on an iMac late 2013. I created the following partition scheme on that external drive:



                                EFI (200MB FAT), BOOT (200MB EXT2) and / (20GB EXT4)


                                I choose to add a bootloader to the External drive (not the iMac drive)
                                After the successful installation, I was shocked when I couldn’t boot my OS X. It's strange because I didn't install any bootloader on main drive.
                                If I removed the external drive, I get a black screen with the grub prompt command!



                                In panic, I researched online and I decided to give a try to rEFInd. After the installation from the .deb source ( http://www.rodsbooks.com/refind/installing.html - it's recommended to install from the .deb file to fix the problem with the Ubuntu 16.x versions - # dpkg -i refind_0.10.3-1_amd64.deb ) I could boot my OS X.



                                To restore the original boot menu (and ditch Linux), you can use the startup disk utility on your OS X or you can mount the EFI partition and with the "sudo rm ..." command, remove the “refind” and “Ubuntu” folders on that partition.



                                Reboot and everything will work like before.






                                share|improve this answer













                                My story (can be useful to someone with the same problem - so it's my turn to help the community):
                                I’ve installed Ubuntu on external USB 3.0 hard drive on an iMac late 2013. I created the following partition scheme on that external drive:



                                EFI (200MB FAT), BOOT (200MB EXT2) and / (20GB EXT4)


                                I choose to add a bootloader to the External drive (not the iMac drive)
                                After the successful installation, I was shocked when I couldn’t boot my OS X. It's strange because I didn't install any bootloader on main drive.
                                If I removed the external drive, I get a black screen with the grub prompt command!



                                In panic, I researched online and I decided to give a try to rEFInd. After the installation from the .deb source ( http://www.rodsbooks.com/refind/installing.html - it's recommended to install from the .deb file to fix the problem with the Ubuntu 16.x versions - # dpkg -i refind_0.10.3-1_amd64.deb ) I could boot my OS X.



                                To restore the original boot menu (and ditch Linux), you can use the startup disk utility on your OS X or you can mount the EFI partition and with the "sudo rm ..." command, remove the “refind” and “Ubuntu” folders on that partition.



                                Reboot and everything will work like before.







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered May 20 '16 at 11:15









                                SamCSamC

                                211




                                211























                                    1














                                    Install a fresh copy of OSX on the external drive and then install Ubuntu on the same external drive as you would a dual boot system. Once the installation is complete, Ubuntu will boot up from the USB drive if it's plugged in. If the USB drive is removed, you will get a Grub command line. Just type "exit" to boot the internal OSX installation. Plug in the USB drive to load up Ubuntu.



                                    This leaves the original OSX installation untouched.



                                    I was able to install Ubuntu and then Kubuntu on a 64GB USB flash drive and it runs quite well. I just installed Kodi and it runs surprisingly well from a flash drive. I only have USB 2.0 so it's a little slow. I ended up installing Kubuntu because the Plasma 5.0 desktop environment is a little more refined in think than the one Ubuntu uses.



                                    I hope this helps simplify things a little. It's not the most elegant or technical way to do it so it's not perfect but it works.






                                    share|improve this answer




























                                      1














                                      Install a fresh copy of OSX on the external drive and then install Ubuntu on the same external drive as you would a dual boot system. Once the installation is complete, Ubuntu will boot up from the USB drive if it's plugged in. If the USB drive is removed, you will get a Grub command line. Just type "exit" to boot the internal OSX installation. Plug in the USB drive to load up Ubuntu.



                                      This leaves the original OSX installation untouched.



                                      I was able to install Ubuntu and then Kubuntu on a 64GB USB flash drive and it runs quite well. I just installed Kodi and it runs surprisingly well from a flash drive. I only have USB 2.0 so it's a little slow. I ended up installing Kubuntu because the Plasma 5.0 desktop environment is a little more refined in think than the one Ubuntu uses.



                                      I hope this helps simplify things a little. It's not the most elegant or technical way to do it so it's not perfect but it works.






                                      share|improve this answer


























                                        1












                                        1








                                        1







                                        Install a fresh copy of OSX on the external drive and then install Ubuntu on the same external drive as you would a dual boot system. Once the installation is complete, Ubuntu will boot up from the USB drive if it's plugged in. If the USB drive is removed, you will get a Grub command line. Just type "exit" to boot the internal OSX installation. Plug in the USB drive to load up Ubuntu.



                                        This leaves the original OSX installation untouched.



                                        I was able to install Ubuntu and then Kubuntu on a 64GB USB flash drive and it runs quite well. I just installed Kodi and it runs surprisingly well from a flash drive. I only have USB 2.0 so it's a little slow. I ended up installing Kubuntu because the Plasma 5.0 desktop environment is a little more refined in think than the one Ubuntu uses.



                                        I hope this helps simplify things a little. It's not the most elegant or technical way to do it so it's not perfect but it works.






                                        share|improve this answer













                                        Install a fresh copy of OSX on the external drive and then install Ubuntu on the same external drive as you would a dual boot system. Once the installation is complete, Ubuntu will boot up from the USB drive if it's plugged in. If the USB drive is removed, you will get a Grub command line. Just type "exit" to boot the internal OSX installation. Plug in the USB drive to load up Ubuntu.



                                        This leaves the original OSX installation untouched.



                                        I was able to install Ubuntu and then Kubuntu on a 64GB USB flash drive and it runs quite well. I just installed Kodi and it runs surprisingly well from a flash drive. I only have USB 2.0 so it's a little slow. I ended up installing Kubuntu because the Plasma 5.0 desktop environment is a little more refined in think than the one Ubuntu uses.



                                        I hope this helps simplify things a little. It's not the most elegant or technical way to do it so it's not perfect but it works.







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Nov 12 '16 at 8:32









                                        MonaLisaOverdriveMonaLisaOverdrive

                                        111




                                        111























                                            0














                                            I've never had luck with a straight external USB connection, but not long ago I picked up a Seagate GoFlex thunderbolt adapter and was able to easily boot a 27" iMac to ubuntu on an external SATA connected to it. I used rEFInd but not sure it was necessary. Seagate tries to create the impression that you will need to use one of their drives connected to it, but a standard laptop sized SATA drive worked fine. I did need to shim the drive slightly to fit the enclosure correctly. Not really the answer you're looking for here, and the it isn't a cheap workaround (around $80 if I remember correctly) but it might be worth it depending on your situation.






                                            share|improve this answer




























                                              0














                                              I've never had luck with a straight external USB connection, but not long ago I picked up a Seagate GoFlex thunderbolt adapter and was able to easily boot a 27" iMac to ubuntu on an external SATA connected to it. I used rEFInd but not sure it was necessary. Seagate tries to create the impression that you will need to use one of their drives connected to it, but a standard laptop sized SATA drive worked fine. I did need to shim the drive slightly to fit the enclosure correctly. Not really the answer you're looking for here, and the it isn't a cheap workaround (around $80 if I remember correctly) but it might be worth it depending on your situation.






                                              share|improve this answer


























                                                0












                                                0








                                                0







                                                I've never had luck with a straight external USB connection, but not long ago I picked up a Seagate GoFlex thunderbolt adapter and was able to easily boot a 27" iMac to ubuntu on an external SATA connected to it. I used rEFInd but not sure it was necessary. Seagate tries to create the impression that you will need to use one of their drives connected to it, but a standard laptop sized SATA drive worked fine. I did need to shim the drive slightly to fit the enclosure correctly. Not really the answer you're looking for here, and the it isn't a cheap workaround (around $80 if I remember correctly) but it might be worth it depending on your situation.






                                                share|improve this answer













                                                I've never had luck with a straight external USB connection, but not long ago I picked up a Seagate GoFlex thunderbolt adapter and was able to easily boot a 27" iMac to ubuntu on an external SATA connected to it. I used rEFInd but not sure it was necessary. Seagate tries to create the impression that you will need to use one of their drives connected to it, but a standard laptop sized SATA drive worked fine. I did need to shim the drive slightly to fit the enclosure correctly. Not really the answer you're looking for here, and the it isn't a cheap workaround (around $80 if I remember correctly) but it might be worth it depending on your situation.







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Sep 19 '14 at 3:21









                                                vorpal7vorpal7

                                                1




                                                1























                                                    0














                                                    Once you have installed Ubuntu on the external hard drive, boot up Ubuntu from Mac by holding option+control keys and pressing the left arrow key (might need to press left arrow key multiple times)






                                                    share|improve this answer






























                                                      0














                                                      Once you have installed Ubuntu on the external hard drive, boot up Ubuntu from Mac by holding option+control keys and pressing the left arrow key (might need to press left arrow key multiple times)






                                                      share|improve this answer




























                                                        0












                                                        0








                                                        0







                                                        Once you have installed Ubuntu on the external hard drive, boot up Ubuntu from Mac by holding option+control keys and pressing the left arrow key (might need to press left arrow key multiple times)






                                                        share|improve this answer















                                                        Once you have installed Ubuntu on the external hard drive, boot up Ubuntu from Mac by holding option+control keys and pressing the left arrow key (might need to press left arrow key multiple times)







                                                        share|improve this answer














                                                        share|improve this answer



                                                        share|improve this answer








                                                        edited Feb 17 at 22:00

























                                                        answered Feb 17 at 1:07









                                                        Hue NgoHue Ngo

                                                        12




                                                        12






























                                                            draft saved

                                                            draft discarded




















































                                                            Thanks for contributing an answer to Ask Ubuntu!


                                                            • Please be sure to answer the question. Provide details and share your research!

                                                            But avoid



                                                            • Asking for help, clarification, or responding to other answers.

                                                            • Making statements based on opinion; back them up with references or personal experience.


                                                            To learn more, see our tips on writing great answers.




                                                            draft saved


                                                            draft discarded














                                                            StackExchange.ready(
                                                            function () {
                                                            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f525845%2fhow-to-boot-ubuntu-on-a-mac-from-external-usb-storage%23new-answer', 'question_page');
                                                            }
                                                            );

                                                            Post as a guest















                                                            Required, but never shown





















































                                                            Required, but never shown














                                                            Required, but never shown












                                                            Required, but never shown







                                                            Required, but never shown

































                                                            Required, but never shown














                                                            Required, but never shown












                                                            Required, but never shown







                                                            Required, but never shown







                                                            Popular posts from this blog

                                                            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                                                            Mangá

                                                             ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕