You are not logged in.

#1 2012-08-11 02:33:03

zhehao
Member
Registered: 2010-12-19
Posts: 21

[SOLVED] Installing Arch on Macbook Air

The title says it all. I've been using Arch for a while and have installed it on plenty of PCs, but I recently acquired a Macbook Air and would like to dual boot Arch on it. The wiki page for installing on a Macbook seems to be outdated (references the old AIF way of doing things instead of the new way) and is not very clear about how to set up the bootloader. How exactly do I set up Arch to boot in bios-compatibility mode from the OSX bootloader using rEFIt?

Last edited by zhehao (2012-08-12 13:23:50)

Offline

#2 2012-08-11 02:36:58

zhehao
Member
Registered: 2010-12-19
Posts: 21

Re: [SOLVED] Installing Arch on Macbook Air

The part of the installation guide that I'm referencing is https://wiki.archlinux.org/index.php/Ma … tibility_2. I'm specifically wondering how I'm supposed to use rEFIt to update the partition table, since when I try to do that it just says something about unknown partitions and then exits.

Offline

#3 2012-08-11 04:27:54

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Installing Arch on Macbook Air

Truth be told, I would not recommend using the included gptsync that comes with rEFIt.  I usually check the GPT and MBR manually.  This can be done with gdisk (gptfdisk).  If they are not the same, use gdisk to create a new hybrid MBR in the "recovery and trasnformation" menu.  I believe that menu will also give you an option to view the MBR partition table (as the main print function will only show the GPT).

Keep in mind that you may sync the entire table, so long as you only have 3 primary partitions (the EFI system partition takes up one of the 4).  If you separate you filesystem out, you need your /boot partition in the MBR.  If you have no /boot partition then your root is needed.

Grub2 can use the GPT while booting in BIOS mode also.  To do this you no longer need a hybrid MBR and can use just the GPT, but you need to add a 1-2MB partition labeled ef02 (I think) in gdisk.  It is labeled as the BIOS boot partition.  Add that, use gdisk to create a protective MBR (UEFI standard indicates the need for a single partition in the MBR spanning the entire drive so that MBR only utilities don't think they can overwrite whatever they want). 

One more thing you should be aware of is that there is also a fork of rEFIt made by the creator of gdisk, called rEFInd.  I ahve not personally used this, but have been told it is better.  Good luck!

Edit:  see here for more info:
http://www.rodsbooks.com/gdisk/hybrid.html
http://www.rodsbooks.com/gdisk/walkthrough.html
http://www.rodsbooks.com/refind/

Last edited by WonderWoofy (2012-08-11 04:30:11)

Offline

#4 2012-08-11 08:24:11

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: [SOLVED] Installing Arch on Macbook Air

Yes rEFInd is more capable, and if you have an Intel graphics Air you can boot in EFI-mode without Grub so that is definitely recommended (EFI-boot will allow you to use AHCI and TRIM for instance).


ᶘ ᵒᴥᵒᶅ

Offline

#5 2012-08-11 10:11:46

picmantonic
Member
Registered: 2012-07-11
Posts: 14

Re: [SOLVED] Installing Arch on Macbook Air

I've been using refind for a while on my iMac (mid-2010). It is a good boot manager for EFI-capable kernels (kernel 3.4 onwards).
I am triple booting OSX (10.8 - Mountain Lion), ubuntu 12.10 and arch, each installed on a separate partition.
I run refind on Mac to pick up the linux kernels for pure EFI boot (no grub).
In order for refind to supply kernel boot parameters (like which disk to run on) the kernels are located on the first 200MB partition of my disk (the msdos EFI partition).
To get the kernel there I have to mount the EFI partition from linux and copy over the kernel file and the initrd file. I need to do this whenever the kernel changes.
That's all though, refind picks up anything that looks like a kernel and presents it for booting. None of the complexities of grub setting up.
I haven't used refind on a non-mac system but I think somebody should give it a try just for the simplicity.

The main problem I've had is with the ATI graphics on my mac. If I let the kernel do the mode setting it chooses the wrong video connector and I get a black screen (the video is going to an unconnected port, that I can only see if I connect up another monitor). This is a bug that's been around for a long time (in the xserver-xorg-video-ati radeon driver; I think the AMD fglrx driver works though) so I work around it by using the 'nomodeset' boot parameter and by specifying ' Device "fbdev" ' in my xorg.conf file.
Graphics performance is still OK for me BUT my system will not sleep and resume. On resume KMS takes over and blacks the screen again. This is a major bug in my view and it is in the system at launchpad Bug #1024507.

Offline

#6 2012-08-11 13:49:05

zhehao
Member
Registered: 2010-12-19
Posts: 21

Re: [SOLVED] Installing Arch on Macbook Air

Thanks for the help guys, this information is very useful. I've decided to go with rEFInd. Has anyone found a way to do this without having to copy the kernel image onto the EFI partition. From http://docs.redhat.com/docs/en-US/Red_H … -uefi.html it seems like I can just copy the grub EFI image to the EFI partition. What do I do after that to make it work with rEFInd?

Offline

#7 2012-08-11 20:02:22

zhehao
Member
Registered: 2010-12-19
Posts: 21

Re: [SOLVED] Installing Arch on Macbook Air

OK, so I've gotten the bootloader set up, but when it's trying to load the kernel, it is unable to mount the root directory. I've checked the entries in the grub.cfg and they all seem correct. Does anyone know why this would be? It seems to be because efibootmgr is failing because it can't find efivars. I've tried modprobe efivars but that doesn't seem to work.

Last edited by zhehao (2012-08-11 20:06:16)

Offline

#8 2012-08-11 21:05:58

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Installing Arch on Macbook Air

If it is loading the bootloader and your grub.cfg looks okay, it may be either your fstab is not okay.  Otherwise it may be that the necessary knernel modules are not loaded into your initramd.  For instance (and this is jsut an example that is not necessarily your specific problem), if you are booting off an external hdd or flash drive, the usb hook is necessary in mkinitcpio.conf so that it will load the appropriate usb modules into your initramd.  Otherwise it does not have the drivers to read the root.

I think that on macs, even though they are SATA connected, they do not implement AHCI mode.  Although, with the macbook air, it is a SSD, where TRIM support requires AHCI mode, so I am unsure if this applies to Airs.  Apple does some strange things with hardware, so it could be they have their own implenetation of software driven TRIM and still use the SCSI mode.  In any case, did you keep SCSI PATA and SATA in your mkinicpio hooks?



Edit: @picmantonic - that is interesting about the ATI issue.  On my Macbook when I started using Arch I had a black screen problem as well, but my computer has an Intel gpu.  I don't know if it was trying to use the display output or not, but baking i915 into the initramd solved my problem.  I guess that means that KMS was not doing what it was supposed to do.

Last edited by WonderWoofy (2012-08-11 21:08:52)

Offline

#9 2012-08-11 22:16:00

acvar
Member
Registered: 2009-05-31
Posts: 29

Re: [SOLVED] Installing Arch on Macbook Air

picmantonic wrote:

In order for refind to supply kernel boot parameters (like which disk to run on) the kernels are located on the first 200MB partition of my disk (the msdos EFI partition).
To get the kernel there I have to mount the EFI partition from linux and copy over the kernel file and the initrd file. I need to do this whenever the kernel changes.
That's all though

If you just mount your efi partion as /boot you don't even have to do that.  Refind can load the kernel from anywhere on the efi partion.

Offline

#10 2012-08-11 23:17:59

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Installing Arch on Macbook Air

acvar wrote:
picmantonic wrote:

In order for refind to supply kernel boot parameters (like which disk to run on) the kernels are located on the first 200MB partition of my disk (the msdos EFI partition).
To get the kernel there I have to mount the EFI partition from linux and copy over the kernel file and the initrd file. I need to do this whenever the kernel changes.
That's all though

If you just mount your efi partion as /boot you don't even have to do that.  Refind can load the kernel from anywhere on the efi partion.

Wow, that is GENIUS!!! I never thought of that.  I have been using legacy bios on my thinkpad to avoid having to set up something to copy that over every update.  Thanks acvar!

Offline

#11 2012-08-12 01:08:57

zhehao
Member
Registered: 2010-12-19
Posts: 21

Re: [SOLVED] Installing Arch on Macbook Air

OK, so here's more news. I found that booting the fallback kernel image from grub worked correctly, but the regular kernel image didn't, so I booted from the fallback image and then ran mkinitcpio again and now it works. Thanks for your help everyone.

Last edited by zhehao (2012-08-12 01:13:59)

Offline

#12 2012-08-12 08:22:45

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: [SOLVED] Installing Arch on Macbook Air

zhehao wrote:

OK, so here's more news. I found that booting the fallback kernel image from grub worked correctly, but the regular kernel image didn't, so I booted from the fallback image and then ran mkinitcpio again and now it works. Thanks for your help everyone.

Good to hear zhehao, don't forget to mark your thread solved. smile


ᶘ ᵒᴥᵒᶅ

Offline

Board footer

Powered by FluxBB