2
  • Host = HP Pavilion i7 q 820
  • Target = Macbook Pro 6,2

Basically I have the drive partitioned for swap and boot, with the ISO already copied to the drive, how can I install grub for that target from the livecd? Also if anyone could tell me how to bless the boot partition, that would be great.

2 Answers2

1

You haven't said why you want to install an OS for one computer by using another one. Without that information, I can't evaluate whether your reasons are good. Odds are they aren't, though. EFI (which all Intel-based Macs use) is different enough from BIOS that BIOS tricks people have picked up over the years don't apply, and trying to use those tricks can in fact imperil your ability to boot. The key problem is that EFI-mode booting involves both disk-based information and information stored in the computer's NVRAM. Although installing Ubuntu using your Mac's disk installed in your HP can create perfectly acceptable disk information, it won't touch your Mac's NVRAM, leaving you with an incomplete boot loader installation. Furthermore, if your HP is also (U)EFI-based and you remove its hard disk, its firmware may notice that its own boot entries are missing and delete them. Thus, you risk not only a failed Ubuntu installation on your Mac, but your ability to boot the HP, as well! There are ways around these limitations, but without knowing why you want to do what you suggest, I'm reluctant to write a lengthy response telling you how to do it, particularly when following my instructions might just make matters worse for you.

My hunch is that you're trying to work around a problem booting the Ubuntu installer or a post-boot problem that's causing your installation to fail. If so, please post a new question describing the problem you're having. Chances are there's a much better solution than what you're trying to do.

Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • So basically the mac has had no OSX for almost a year now, and proudly so. Also the problem was there was no bootloader installed, essentially a clean hard drive. The dvd drive is only ballast for the glorious apple machine now, and the thing refuses to boot from non osx usb drives. I did not install anything to the HP, I only installed grub to the hard drive so that the Mac would boot from the iso, generated directly from the live dvd. The only problem that persists on either computer is that the Mac still begs for a blessed boot device. – Trey Gordon May 31 '15 at 22:28
  • 1
    In that case, ensure that you use the MBR partitioning system on the hard disk and install BIOS-mode GRUB; do not install in EFI mode. When the Mac sees the MBR disk, it should try to boot it in BIOS mode and everything should work. – Rod Smith Jun 01 '15 at 01:23
0

With a fat32 partition marked bootable(/dev/sda1):

$ sudo -i
# mount /dev/sda1 /mnt/chrootdir/
# for dir in proc dev sys etc bin sbin var usr lib lib64 tmp; do     mkdir /mnt/chrootdir/$dir && mount --bind /$dir /mnt/chrootdir/$dir; done
# apt-get install grub-efi-amd64-bin
# modprobe efivars
# chroot /mnt/chrootdir
# grub-install --target=x86_64-efi /dev/sda1 --bootloader-id=arch_grub --efi-directory=/EFI

Then copy the ubuntu.iso to the boot partition:

# dd if=/dev/cdrom of=/Ubuntu-14.04.2-LTS.iso
  • Your dd copy will overwrite the FAT32 partition? And if using grub to loopmount boot an ISO you need a grub.cfg to mount the ISO. MACs work much better with UEFI but do not know details. http://askubuntu.com/questions/580202/refit-refind-grub2-what-is-the-right-way-for-ubuntu-14-10-on-a-mac If UEFI only, then can just extract ISO with 7-zip to FAT32 formatted drive. Will not boot in BIOS mode – oldfred May 30 '15 at 20:31
  • meh, the grub command line and I are not strangers. – Trey Gordon May 31 '15 at 22:30