2

Got a MacBook Pro, 13 inch, 500gb Hard Drive, 4gb memory. Made a massive screw up on dual install, luckily had already transferred files to Ubuntu one. Ok, trying to install from USB, boots from that perfectly. Currently using the "Try Ubuntu without installation". Looking at GParted:

/dev/sda1: fat32.   No mount point.          Size: 487Mb,    Used: 4.27Mb.   Flags: boot
/dev/sda2: ext2.    No mount point.          Size: 244Mb,    Used: 51.69Mb.  No Flags
/dev/sda3: lvm2 pv. Mount point: ubuntu-vg   Size: 465.05Gb, Used: 465.01Gb. Flags: lvm
Unallocated: Size: 1.02Mb

NB: This was after an attempted install using LVM(?) NB 2: I have no idea what any of these things mean :P I do physics (undergraduate), not computer science!

I keep seeing the install programme through. I have tried doing the install from the trial desktop, doing the install from boot, and doing the install with OEM.

Each time, whenever I restart (as required by installation), it just asks me whether I want to install (black screen with list of boot options). Never gives me the option to boot from currently installed Ubuntu.

I have even tried to take out USB before the restart and it comes up with a flashing file symbol with a magnifying glass in the middle!

Braiam
  • 67,791
  • 32
  • 179
  • 269
Alex
  • 31
  • 1
  • 1
  • 4

3 Answers3

8

There is a better way of single installation of Ubuntu on Macs without rEFInd using Mac's bootloader.

Create a live USB containing Ubuntu. Do not use the +mac version since it does not support EFI boot.

Boot from the Live USB. The trick to booting from USB on Macs is to hold down the option key as soon as you power on the device. Select EFI Boot from this menu.

Ubuntu should now boot up from the USB. Install Ubuntu using the Erase and use Entire Disk option.

Firstly, when you reboot/power on your Mac, you will see the grey screen of the Mac bootloader for about 30s, and then a gently flashing folder with a ? inside. If you insert the installer USB now, it should boot. If not, try holding the power button to force the power off, and then follow the USB booting instructions to bring it up.

If you’re using the desktop installer, hold the shift key to bring up the GRUB bootloader menu.

Don’t select any of the entries. Instead, press C to bring up the GRUB console.

At the grub console, type ls

grub> ls

(memdisk) (hd0) (hd0,msdos) (hd1) (hd2) (hd2,gpt3) (hd2,gpt2) (hd2,gpt1)

You may not get exactly the same results as this, but you’ll have some similar options.

Now, find the partition which contains your user's home directory.

grub> ls (hd2,gpt2)/home

rohith/

Keep trying until you find it.

The result from the last step has two parts: (hdX,gptY). You need to keep the hdX part, but go through all the gptY options looking for a /boot/grub directory.

grub> ls (hd2,gpt2)/boot/grub

unicode.pf2 [...] grub.cfg

Now you want to set this as your root for further commands.

grub> set root=(hd2,gpt2)

The only way to boot properly was to use the UUID of the drive. To get it -

grub> ls -l (hd2,gpt2)

Note down the UUID. You'll have to type it manually in the next step.

grub> linux /boot/vmlinuz〈...tab here!...〉.efi.signed root=UUID=〈the UUID from above〉

The GRUB console can do tab completion, so if you just type out the vmlinuz part and hit tab, then hit . and tab again, you won't have to type the whole file name. make sure that the efi.signed part is present.

Now, set the initial RAM disk

grub> initrd /boot/initrd〈...tab here!...〉

You should be able to boot with the command

grub> boot

The system was initially unbootable because the Mac bootloader expects the EFI partition to be formatted as HFS+, the typical Mac filesystem, while the Ubuntu installer actually formats it as VFAT.

Now, open a terminal and type

sudo add-apt-repository ppa:detly/mactel-utils

sudo apt-get update

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

Run mount to get a list of mounted filesystems, and look for anything mounted at /boot/efi. Unmount it.

sudo umount /dev/sda1

We now use gdisk to delete the VFAT partition and create an HFS+ one,

sudo gdisk /dev/sda

Press p

Confirm that the first partition has type EF00. Now we delete that EF00 partition.

Press d

Create a new HFS+ one in its place.

Press n

Press enter key for the first and last sector options.

Enter AF00 for the filesystem code.

Use the p command to double-check your changes, and then w to write.

Now we have an unformatted HFS+ partition. We can format it with -

sudo mkfs.hfsplus /dev/sda1 -v ubuntu

Edit /etc/fstab

sudoedit /etc/fstab

Delete the lines that refer to /boot/efi using Ctrl+K.

Now, type the following commands -

sudo bash -c 'echo $(blkid -o export -s UUID /dev/sda1) /boot/efi auto defaults 0 0 >> /etc/fstab'

sudo bash -c 'echo "This file is required for booting" > /boot/efi/mach_kernel'

Install GRUB and 'bless' the filesystem.

sudo grub-install --target x86_64-efi --boot-directory=/boot --efi-directory=/boot/efi

sudo hfs-bless "/boot/efi/System/Library/CoreServices/boot.efi"

To set the default efi boot entry, run

sudo efibootmgr

Get rid of the extra entries -

sudo efibootmgr -b xxxx -B

where xxxx is the boot number obtained from sudo efibootmgr

Now, set the default entry -

sudo efibootmgr -o xxxx

Lastly, install the linux-signed-generic meta package -

sudo apt-get install linux-signed-generic

This will make sure that any kernel updates also include the cryptographically signed kernel image required by EFI. Without this, your machine may freeze during boot. If that happens, refer to the instructions above for manually booting via grub.

The system should now be bootable!

(Adapted with modifications from Jason Heeris' post)

  • Wondering if you could help out. I have followed your steps but getting stuck at this command sudo grub-install --target x86_64-efi --boot-directory=/boot --efi-directory=/boot/efi I get an error message grub-install: error: /boot/efi doesn't look like an EFI partition. – tyelford Apr 04 '16 at 10:40
0

I would recommend not using LVM unless you really need it and you know what you are doing - I don't think it is the default option from memory. If you try installing from boot and choose to format and use the entire drive (don't use LVM), then remove the USB for the reboot, do you still get the same error icon (which is the Mac telling you it can't find a system folder to boot from)?

Jet86
  • 317
  • 1
  • 6
  • Hey, Initially I tried without LVM. and same problems occured. I have decided to order the CD to see if that works any better. Hoping it will. From the information I read beforehand trying to install from USB is problematic so hopefully this will work! :) Thanks very much :) – Alex Dec 18 '13 at 21:52
0

Try holding down the 'option' key while booting, it might allow you to select which partition to boot. Ubuntu might show up as 'Windows'.

If that doesn't work, you can try installing rEFInd, a boot manager that will allow you to boot Ubuntu. There's a full guide for installing Ubuntu 14.04 as a single OS with rEFInd on a Macbook Pro here: https://help.ubuntu.com/community/MacPro But in order to install rEFInd from your live Ubuntu system, download rEFInd from http://www.rodsbooks.com/refind/getting.html (pick the binary zip file) and extract it. Then open up a terminal (ctrl+alt+t) and navigate to the folder you extracted it to, with the cd command. If extracted to the default location, this should becd Downloads/refind-bin-0.8.1 Then run sudo ./install.sh --esp

That should initiate the installation of rEFInd. If the installation succeeds, it will display a message in the terminal telling you so.

Tobias
  • 1,608