iMAC 5.1 (2006) LM 18.1 Boot Issue

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Gnkarn
Level 1
Level 1
Posts: 4
Joined: Mon Dec 04, 2017 12:37 am

iMAC 5.1 (2006) LM 18.1 Boot Issue

Postby Gnkarn » Mon Dec 04, 2017 12:49 am

I have an old iMac 5.1 late 2006 , and needs to instal lm.
The dvd is not working and I have tried all the suggested ways to make a bootable usb memory with no success .

As I have other newer mac I’m thinking on building a new internal hard drive for that mac , making use of my newer mac as I can easily boot from a lm live dvd on that machine .

My question is if anybody could point me to a guide an how to make a bootable lm hard drive , for that iMac ( not intrested on being to boot OS X after that ) , so I could use the whole disk as an internal Linux hard drive .

Appreciate any help .

Thank you

Moderator: split from another thread.

fabien85
Level 6
Level 6
Posts: 1096
Joined: Tue Mar 11, 2014 4:30 pm

Re: iMAC 5.1 (2006) LM 18.1 Boot Issue

Postby fabien85 » Mon Dec 04, 2017 5:50 am

Hi,
for reference, your machine is either of this ones :
https://everymac.com/systems/apple/imac/specs/imac-core-2-duo-2.0-17-inch-specs.html
https://everymac.com/systems/apple/imac/specs/imac-core-2-duo-2.16-17-inch-specs.html
https://everymac.com/systems/apple/imac/specs/imac-core-2-duo-2.16-20-inch-specs.html
https://everymac.com/systems/apple/imac/specs/imac-core-2-duo-2.33-20-inch-specs.html
depending on the speed of your processor and the size of your screen.
The specs are quite similar, but the important point is that it is an old machine with a 32-bit EFI. So bootloading is problematic.
On the other hand the CPU is 64-bit, so it's recommended to install a 64-bit Linux system, because it will be faster and because 32-bit support is getting down nowadays.

Another important aspect is that these old machines usually do not boot in Legacy mode via USB.

That explains why you couldnt boot through USB, because either:
- you chose a 64-bit ISO, but it couldnt be booted in EFI mode because it's 64-bit, and it couldnt be booted in Legacy mode because the machine cannot
- you chose a 32-bit ISO which is Legacy only (Mint doesnt provide official 32-bit EFI support) but the machine cannot boot Legacy over USB

via DVD it does not work either, I have no clear understanding why (I dont have a machine to experiment), but the following page is supposed to explain it, and it gives tweaked ISOs that will work when burned to DVD :
https://mattgadient.com/2016/07/11/linux-dvd-images-and-how-to-for-32-bit-efi-macs-late-2006-models/
You can either :
- trust the website and download and burn one of the ISOs.
but first dont trust anything on the web, and second it doesnt yet provide an ISO for Mint 18.3
- download the C program given in section "How-to: Making a standard Linux distro ISO compatible with 32-bit EFI Macs", inspect it and convince yourself there is nothing bad involved here (the program is quite short so it's doable).
Then compile the program and use it to convert the ISO you want. Before burning the converted ISO to DVD.

Another solution is to add a 32-bit EFI bootloader to one of the ISOs and burn the tweaked ISO to either USB or DVD.
You will want to follow that thread : viewtopic.php?f=46&t=204961
Advantage is that you can use a USB here ; also having Linux installed in EFI mode makes it simpler to dual-boot with macOS (but you dont seem to care, so I add this only in case the previous solution doesnt work).

Gnkarn
Level 1
Level 1
Posts: 4
Joined: Mon Dec 04, 2017 12:37 am

Re: iMAC 5.1 (2006) LM 18.1 Boot Issue

Postby Gnkarn » Mon Dec 04, 2017 8:35 am

Thank you for your reply ,
My mac as you mention is 32 bit efi , and 64 bits core 2 duo, is a 21” iMac 5.1 late 2006.

I have already tried a32bits image on usb , and it ain’t work, tried the c program you mentioned but with no success either , tested installing refind ,
It always ended with a blank screen either with or without the Linux logo ,
And on one of the latest attempts this is the message receiver

Starting legacy loader
Using load options usb
Error not found received from legacy loader

Not found from loactedevicepath
Load error while opening our installation volume .

——

This is why I was looking for just installing directly on the hard drive , from other mac , and then installing that hard drive again as internal disk on the old mac .

And I’m looking for a guide to do that .

kiiroaka2
Level 1
Level 1
Posts: 1
Joined: Mon Dec 04, 2017 12:08 pm

Re: iMAC 5.1 (2006) LM 18.1 Boot Issue

Postby kiiroaka2 » Mon Dec 04, 2017 12:36 pm

I doubt that you can create LM on another Mac then switch the HDD into the iMac. You would still need to use suction cups to remove the glass front panel of the iMac to be able to replace the disk drive and the defective DVD drive.

What you may need, though, is another PC running Linux so that you can strip the hybrid ISO to make it bootable in the iMac.

Copy/paste the following into a text file and name it make_single_eltorito.txt

Code: Select all


#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

static char *iso_name = {"insert-your-linux.iso name here"};

int main(int argc, char **argv)
{
  int fd, ret;
  unsigned char buf[2048 - 64];
  off_t lba;
  size_t buf_size = 2048 - 64;

  fd = open(iso_name, O_RDWR);
  if (fd == -1)
    goto err_ex;
  if (lseek(fd, (off_t) 32768 + 2048 + 71, SEEK_SET) == -1)
    goto err_ex;
  ret = read(fd, buf, 4);
  if (ret == -1)
    goto err_ex;
  if (ret < 4) {
    fprintf(stderr, "Cannot read 4 bytes from %s\n", iso_name);
    exit(1);
  }
  lba = buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
  if (lseek(fd, lba * 2048 + 64, SEEK_SET) == -1)
    goto err_ex;
  memset(buf, 0, buf_size);
  ret = write(fd, buf, buf_size);
  if (ret == -1)
    goto err_ex;
  if (ret < buf_size) {
    fprintf(stderr, "Cannot write %d bytes to %s\n", (int) buf_size, iso_name);
    exit(1);
  }
  close(fd);
  printf("done\n");
  exit(0);
err_ex:;
  perror(iso_name);
  exit(1);
}


Download LM18.3, right-click -> Properties, hightlight/copy the file name.

open make_single_eltorito.txt and highlight/right-click/paste it over insert-your-linux.iso name here, making sure to keep the quotation marks, then save-as make_single_eltorito.c

Open a terminal and issue sudo cc -g -Wall -o make_single_eltorito make_single_eltorito.c and hit the carriage return key.

Then issue the command ./make_single_eltorito

Right-click the LM 18.3 iso file -> properties, copy name.

Insert a 2G, or bigger, USB stick and issue the command dd bs=4M if=right-click-paste of iso name of=/dev/sdb && sync

After it has finished copying the distro, exit the terminal window, reboot the system. You may have to hold down the alt/option key to be able to see and select the USB stick. If it boots fine then you will need to run gparted to completely erase the HDD before installing LM.

The particulars:
https://mattgadient.com/2016/07/11/linu ... 06-models/
https://bugs.launchpad.net/ubuntu-cdima ... omments/16
http://askubuntu.com/questions/37999/wh ... ge#answers

Gnkarn
Level 1
Level 1
Posts: 4
Joined: Mon Dec 04, 2017 12:37 am

Re: iMAC 5.1 (2006) LM 18.1 Boot Issue

Postby Gnkarn » Mon Dec 04, 2017 12:45 pm

Thank you , will try the procedure,
As for opening the mac is no problem , I already have it opened , it is a white acrílic model .

fabien85
Level 6
Level 6
Posts: 1096
Joined: Tue Mar 11, 2014 4:30 pm

Re: iMAC 5.1 (2006) LM 18.1 Boot Issue

Postby fabien85 » Mon Dec 04, 2017 1:00 pm

Yes the 32-bit raw image will not work, you have to add EFI/BOOT/bootia32.efi to the ISO (or to the USB after burning). I did this to a 2004 macbook with a 32-bit EFI and it works.

To install from another machine (either a PC or a mac, it doesnt matter) is relatively easy :
- boot the USB or DVD in Legacy mode
check the boot mode with

Code: Select all

 [ -d /sys/firmware/efi ] && echo 'EFI mode' || echo 'Legacy mode'

- plug the external hard drive, open gparted, format the disk as mbr, create the linux partitions as you want
- launch the installer, select the option 'Something else', point to the linux partitions and to the external drive in "device for bootloader installation"
- proceed as a normal install. Put the drive as internal in the new machine.
- first time you boot, the grub menu should have spurious entries corresponding to the other OSes that were on the machine you used for install. Dont worry, boot the installed linux, then open a terminal and

Code: Select all

sudo update-grub

that will clean up the grub menu

Gnkarn
Level 1
Level 1
Posts: 4
Joined: Mon Dec 04, 2017 12:37 am

Re: iMAC 5.1 (2006) LM 18.1 Boot Issue

Postby Gnkarn » Mon Dec 04, 2017 8:53 pm

Building the usb doesn’t work, the error is the same , and I it won’t boot on legacy mode , so I think my last opportunity is to try with the hard drive , will see ..

It is being very frustrating , some so basic that could take so much effort and trials .

Thank you


Return to “Installation & Boot”