You are not logged in.

#26 2012-03-27 14:37:33

Registered: 2010-09-16
Posts: 31

Re: [SOLVED] macbook air 3.2 and grub problem

I am trying once again, and I feel like I have gotten farther, and I hope that some specific advice will get me over the top.
I used as inspiration, though I have a macbook air 3,2. I shrunk my current mac partition and created two more partitions  /dev/sda3 and /dev/sda4

I then followed the instructions, but when I got to the bootloader part I didn't get the error that was spoken of in the post. I tried to reboot hoping I got lucky, but with the option key depressed, there was no efi boot option - just the mac hard disk "untitled" option.

I rebooted the system again with the archboot install disc and mounted /dev/sda3, the one that I intended to be the boot, and I created a directory /boot/efi/EFI/BOOT and copied into it the bootx64.efi file. I also made sure that I clopied grub.cfg file that was somewhere in the hierarchy on this partition here as well (although this cfg file is beyond me to parse as it is using UUIDs among other things).

Doing this when I start the mac I now get an efi boot option that I can click on and that launches me to a screen displaying Arch and Arch Fallback options, but they don't properly direct the system to the kernel images it needs, but I do believe that this cfg info is the file on /dev/sda3 because I can open the command in the editor and see that it is the same as what is stored on /dev/sda3

As I installed all the archboot installation on /dev/sda4 as / with no swap or other paritions, I think (hope?) that someone can help me figure out the minimal grub2 cfg I can write on /dev/sda3 and in what folder of /boot/efi/EFI/BOOT so that grub2 can find the linux installation I have on /dev/sda4

Any advice or directions would be appreciated. Cheers.


#27 2012-05-15 14:23:39

Registered: 2010-09-16
Posts: 31

Re: [SOLVED] macbook air 3.2 and grub problem

When I say that this problem is "solved" you should consider that a rather nuanced assessment. I do have Arch installed on my Macbook Air (mba), but it is a kind of goofy and convoluted process that got me here. I don't know if it can be repeated. I am not even sure I can repeat it, but I am trying to light a signal fire to help those like me who really don't know what they are doing, but still want to try.

In my own efforts to get this going I found that there were two basic threads: linux on mba and Arch linux on mba. If you don't really need "ARCH" linux, but found your way here from a google search let me suggest you consider Ubuntu or Debian. Both work reasonably well to get a linux distribution on the mba with basic following of the prompts on the installation CD. The Debian is a bit more arch-ish in that you will have more control and choice over what you install, but the actual  details will differ. If all you need is a linux program for some reason, and it exists in the Ubuntu respositories, use the Ubuntu route.

But if you are set on Arch, as I am, here is the first step. Completely mangle your mba installation to the point you have to reinstall macosX from the back-up media. This is probably optional from a technical standpoint, but it is morally strengthening. 

Then, just to convince yourself it can be done, install Debian, and think seriously about how strong is your affection for ARCH. This step was useful to me. First, because it made me realize how much of the arch structure I have internalized (/etc/rc.d/something restart versus /etc/init.d/something restart; pacman v dpkg). But it may also have been practically useful, because it helped me discover that you can write to the first partition (on my system /dev/sda1) the EFI partition without really messing up anything too badly.

I next tried to install Arch on top of Debian. That did not go well. The wiki page for installing arch from another distribution is dated. It describes packages as ending in .gz; they now end in .xz. You have to figure out a way to expand those from the base distribution or else expand them and recompress them yourself. You will need several additional libraries besides those mentioned, and in my case you will just end up with a broken original installation. 

Now, try Freebsd. Why, well why not? Live a little. Freebsd and Arch have a lot in common in terms of their philosophies and structure, but in my case you end up with a lot of new partitions, and still unable to boot into Freebsd.

Now, back to the drawing board. Get a system rescue disk, boot it, run gparted, and delete all those weird partitions, but leave alone the sda1 (EFI) and sda2 (hfs+), the hfs+ is your mac partition.  This will leave you a lot of free space.

I used the archboot iso that was current in March 2012 and I booted from the superdrive (come on, if you can afford the mba buy the superdrive, don't be penny wise and pound foolish, be penny foolish and pound foolish). You can do this by holding the alt/option key while booting the mba.  I chose the 64 bit option from the splash screen, and you may have to be patient. This start up process can take awhile, and for me it often seemed to hang in places for a minute or two, but eventually I landed at the blue installation screen.

Before beginning the installation, switch to another console (or you can cancel out of the installation process). On my mba to switch consoles I needed to simultaneously depress the fn/control/alt-option and  f2  that is four buttons! Run cgdisk and create a 100mb partition (to be used for /boot) and whatever else you want. I just made the rest one big parition, because I didn't really have any faith this would work, and so why bother with a sophisticated partition structure.

Now switch over to the installation process (or if you killed it, just type arch/setup from the prompt) (same three buttons and f1 probably), and go through the installation process. When you get to preparing the disk, use the manual option to set your /dev/sda3 100mb parition to be /boot with ext2 and the /dev/sda4 as root (/). I used a reiserfs and skipped the swap, because I had no confidence that anything more was worth the effort yet (but now I am too scared to change - so maybe you should set up something a bit more involved?)

When you get to install bootloader the process gets confusing. Most of the threads talk about installing grub2, but there is no grub2 option is there? There are a bunch of them. Which one do you choose? Well try the grub2bios and it may even finish like it worked, but you won't be able to boot. I recommend the 64bit efi option, but when you are done with that you won't be able to boot either, but you should soon.

Reboot into the installation media. Skip the installation stuff and get to a prompt, either by cancelling the install or switching to a new console.  Now you are going to create two mnt points: mkdir /mnt/a1 and /mnt/a3 then you will mount two partitions there.

mount /dev/sda1 /mnt/a1
mount /dev/sda1 /mnt/a3

What we are doing is mounting the efi partition and also our /boot partition. Now you should explore each. Just cd into one, and go up and down a few levels and "ls" the files.  Refit will see our /dev/sda1 partition, but it doesn't see our /dev/sda3 well (you can use the partition tool in Refit -- and I assume everyone has already gone down the refit route before finding their way to this thread -- and it will show all four partitions but it will have an error message and say the types are unknown for the new ones we made).

Our goal is to have the following directory structure /mnt/a1/EFI/boot . If you have repeated all my errors "incorrectly", you may alread have this structure. If not, use "mkdir" to create it.  Then dig down into your /mnt/a3/.../ until you come across the file grub.efi  You are going to copy this.

cp -a grub.efi /mnt/a1/EFI/boot/

Now all the information telling our boot process where stuff is, will be available. Now you can "reboot" from the prompt. Arch will nicely unmount everything for you, and when you come back to refit you will see if luck smiles and both a windows icon (three little blocks in a pyramid), and the linux icon (left over from debian and which drops you to a grub boot), as well as the mac icon.  Click on the windows icon (which is your arch install), wait patiently biting your nails, and eventually you will be at the prompt. Did it work? Unplug the superdrive to convince yourself that you did not somehow boot the installation media. It still works! Do a giddy and embarassing dance, and call it day. If you do anything to mess it up now it will be just too depressing.

You can edit the refit.conf file on the Mac side to make it default to the W option and that will launch arch as the default. I know the useless tux icon bothers your ocd, but ignore it and live with it, at least for awhile. 

I have done a pacman -Syyu and seen the kernel and grub64efi packages update (tell it no if it asks to update pacman), and still things boot, and I see the new kernel, so I think this will work.  Maybe one of the brainiacs could fix the archboot iso to detect that you are installing to a mac and make this happen automatically, but for now this is it.

I know that I am only one of many frustrated mac users who have more desire than knowledge to run Linux on their pretty machines. I sincerely hope that my struggles help save someone a few tears.  Good luck.


Board footer

Powered by FluxBB