Installing bootloader on a Mac

5

1

Due to a somewhat odd requirement for a particular Linux installation, with a particular software suite, I found it best to use ddrescue to populate the harddrive with the partitions and their data, taken from a similar setup made a while back. This, of course, after setting up the partition table accordingly. After double-checking everything, the hard drive now has the correct data (including the OS) on the correct partitions.

However, how do I go about setting up a bootloader? I've tried the usual trick of booting from an external USB and running grub-install /dev/sda, but the issue now is that when I boot the machine without the USB grub starts to complain: "error: no such device: 47f89855-8710-4fca-a395-913f70f7d94c".

I'm presuming that the device GRUB is missing is the USB stick I used to boot from when installing. I tried to work around it by doing a chroot to the machine's filesystem first, but the result seems to be the same.

System info:

  • MacBook Air 13"
  • One 128GB drive

    • partition 1: 512MB of spare space, in case I need it (See note regarding EFI boot)
    • partition 2: 2.5GB root filesystem of the OS I want to boot (Scientific Linux 6.6). This partition also holds a /boot directory.
    • partition 3: 2G Swap space
    • partition 4: rest of the disk, to be mounted by the OS
  • External boot device: A USB stick running Arch Linux (to be removed once everything works, of course)

It is worth noting that I am not a Mac person at all, so I've had to rely on my PC based experience, hoping that I was able to overcome any hardware related differences. Based on various googling, I see a lot of references to EFI boots, and I am new to that as well. So my question then is: Do I need to set up an EFI boot? (That's the only way I'm able to boot from the USB stick, at least).

Any help on how to somehow get the OS on the drive booted would be much appreciated. Leave a comment if more info is needed.

Note: When booted from my USB stick, the drive I want to boot from shows up as /dev/sdc, and the USB stick as /dev/sdb. As I've been unable to boot without the stick, I can only presume that the drive of interest will remain /dev/sdc. When connecting a second USB storage device, it comes up as /dev/sdd

Jarmund

Posted 2015-07-31T15:47:32.130

Reputation: 5 155

Answers

2

Boot with usb-stick and check your grub.conf. Find the line with root=uuid= and se if it's set to root=UUID=47f89855-8710-4fca-a395-913f70f7d94c.

If so, you need to change it to the your primary boot partitions uuid. ls -l /dev/disk/by-uuid/ to find the right partition and copy the uuid.

if it's root=/dev/sda or something. Change it to root=UUID=therightUUIDhere

also check your /etc/fstab and replace /dev/sd{a,b,c,d} to UUID=blabla-blabla-blabla-blabla / ext4(if ext4) 0 1 or if it's referring to your USB's UUID, change it to your boot partitions UUID

/dev/sda,sdb,sdc,sdd can change order depending what media is connected to the computer, or not connected. But if you use UUID's instead. You are refering to right partiton/filesystem all the time.

zaonline

Posted 2015-07-31T15:47:32.130

Reputation: 358

Great, this gets me one step closer. Sub-question: What data is the UUID based on? Hardware signature of some sort? – Jarmund – 2015-08-07T14:34:54.013

1@Jarmund UUID's are generated for filesystems. When you format a partiton, say /, with a filesystem. Then the filesystem gets a UUID.

Actually, using blkid is a better way to list filesystems and uuid's then ls -l /dev/disk/by-uuid – zaonline – 2015-08-07T15:00:04.227

@Jarmund Also, take a look at this. link

– zaonline – 2015-08-07T15:23:26.327

1@Jarmund In fact, you can actually generate new UUID's with GParted (useful if for some reason you have two partitions with the same UUID, happened to me once!) – BenjiWiebe – 2015-08-08T13:22:10.273

1

I would recommend you install rEFInd. It shows up every bootup screen and lets you choose your os. So basically it will ask you every bootup whether you want to go for mac or scientific linux. If you don't need this you can just hold down option as you boot up though I don't think that will let you boot up from linux.

If you do choose to install rEFInd it will be very straight forward. You just go here: http://www.rodsbooks.com/refind/ and scroll down. This is the creator's webpage and here is where you can find relevant documentation and downloads.

I am not sure about how you plan on installing Scientific Linux but if you can live boot it and if there is an installation feature from there I would recommend you use the installation feature to install it onto the second partition and use rEFInd to boot into it.

Hope this helps!

Aliquam

Posted 2015-07-31T15:47:32.130

Reputation: 19

0

Hold down Alt and power on. You should see a list of all bootable disks on the system.

This does assume that the disks contain a UEFI bootable OS however, which for some Linux installs is not straightforward, especially if you have had to DD the partitions onto the disk.

If you can boot using the Alt option, installing an EFI boot loader such as rEFIt (http://refit.sourceforge.net/) will give you a menu on each boot.

rEFIt should be able to boot regular MBR partitions. I've used it to boot Linux recovery disks via a USB cradle in the past, but I'm uncertain whether this will work properly with an internal SATA disk.

Alex

Posted 2015-07-31T15:47:32.130

Reputation: 250