You are not logged in.

#1 2013-07-22 10:17:51

alesssia
Member
Registered: 2013-01-16
Posts: 12

Arch does not boot (MacBook Pro, rEFIt)

Several months ago I installed Arch on my MacBookPro (5.1, late 2008) in dual boot with Mac OS X 10.7 (Lion).
Everything was fine until last Friday when, after a forced shutdown, ArchLinux refused to boot and showed me a black screen instead (I use rEFIt).

I followed several forum suggestions, mainly consisting in the reflagging of the boot partition (using both fdisk in Mac OS X and parted in Linux) and in the reinstallation of GRUB. After some work, nothing changed: Mac OS X works fine, whilst Linux still offers me a black screen. After few seconds of black screen, the laptop reboots, and rEFIt shows me the same options.

Does anyone have any suggestion?
Thank in advance for any help I can get smile

Alessia


This is the output of the rEFIt Partition Inspector tool:

*** Report for internal hard disk ***

Current GPT partition table:
 #      Start LBA      End LBA  Type
 1             40       409639  EFI System (FAT)
 2         409640    200228415  Mac OS X HFS+
 3      200228416    201497951  Mac OS X Boot
 4      207269888    207464447  GRUB2 BIOS Boot
 5      207464448    247463935  Basic Data
 6      247463936    271464447  Basic Data
 7      271464448    488396799  Basic Data

Current MBR partition table:
 # A    Start LBA      End LBA  Type
 1              1    488397167  ee  EFI Protective

MBR contents:
 Boot Code: GRUB

Partition at LBA 40:
 Boot Code: None (Non-system disk message)
 File System: FAT32
 Listed in GPT as partition 1, type EFI System (FAT)

Partition at LBA 409640:
 Boot Code: None
 File System: HFS Extended (HFS+)
 Listed in GPT as partition 2, type Mac OS X HFS+

Partition at LBA 200228416:
 Boot Code: None
 File System: HFS Extended (HFS+)
 Listed in GPT as partition 3, type Mac OS X Boot

Partition at LBA 207269888:
 Boot Code: None
 File System: ext2
 Listed in GPT as partition 4, type GRUB2 BIOS Boot

Partition at LBA 207464448:
 Boot Code: None
 File System: ext4
 Listed in GPT as partition 5, type Basic Data

Partition at LBA 247463936:
 Boot Code: None
 File System: ext4
 Listed in GPT as partition 6, type Basic Data

Partition at LBA 271464448:
 Boot Code: None
 File System: ext4
 Listed in GPT as partition 7, type Basic Data

Offline

#2 2013-07-22 14:26:45

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: Arch does not boot (MacBook Pro, rEFIt)

I can't be positive, but my hunch is that you had a BIOS-mode installation of Arch that relied on the Mac's BIOS emulation (aka CSM or legacy boot support). The Mac requires a hybrid MBR for this to work, though, and you no longer have that. Certain partitioning tools, including those based on libparted, will wipe the hybrid MBR, so you might easily have destroyed it if you did any partition manipulation recently.

If I'm right, one way to fix the problem is to create a fresh hybrid MBR with gdisk or some other tool. Hybrid MBRs, though, are dangerous and flaky. Therefore, I instead recommend that you switch from rEFIt (which is a dead project) to my fork of it, rEFInd. Among other improvements, rEFInd can directly launch a Linux kernel with an EFI stub loader (a feature added to the 3.3.0 kernel). Thus, if you install rEFInd and the EFI filesystem driver for whatever filesystem holds your Linux kernel, you should be able to launch Linux directly in EFI mode, without using a hybrid MBR. You might need to edit your kernel boot options the first time you launch and then either create a custom refind_linux.conf file in the directory that holds your kernel or create a custom boot stanza in refind.conf, whichever you prefer. (See the Methods of Booting Linux and Configuring the Boot Manager pages of the rEFInd documentation for details of how to do this. There's also some Arch-specific documentation in the Arch wiki.)

Offline

#3 2013-07-22 21:14:56

alesssia
Member
Registered: 2013-01-16
Posts: 12

Re: Arch does not boot (MacBook Pro, rEFIt)

Hey Rod!
I followed your suggestion, forgot about hybrid MBR, and installed rEFInd by running install.sh from Mac OS X.

I decided that create a custom boot stanza would be easiest, hence I added the following lines to my refind.conf file:

menuentry "Arch Linux" {
    icon /EFI/refind/icons/os_arch.icns
    volume 4:
    loader /boot/vmlinuz-linux
    initrd /boot/initramfs-linux.img
    options "root=UUID=e6db22f2-e5bb-4933-bba7-20be86db00if ro quiet"
    ostype Linux
    graphics off
}

menuentry "Arch Linux Fallback" {
    icon /EFI/refind/icons/os_arch.icns
    volume 4:
    loader /boot/vmlinuz-linux
    initrd /boot/initramfs-linux-fallback.img
    options "root=UUID=e6db22f2-e5bb-4933-bba7-20be86db00if ro quiet"
    ostype Linux
    graphics off
}

but Arch does not boot yet, and I receive:

Starting vm-linuz-linux
Using load options root=UUID=e6db22f2-e5bb-4933-bba7-20be86db00if ro quiet initrd=\boot\initramfs-linux.img
Error: Not Found while loading vmlinuz-linux

I'm again lost, and waiting for any hint...
Thanks smile

This is the diskutil output:

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *250.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            102.3 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
   4: 21686148-6449-6E6F-744E-656564454649               99.6 MB    disk0s4
   5:       Microsoft Basic Data                         20.5 GB    disk0s5
   6:       Microsoft Basic Data                         12.3 GB    disk0s6
   7:       Microsoft Basic Data                         111.1 GB   disk0s7

The linux boot partition is the number 4 (ext2). It contains (among others) vm-linuz-linux, initramfs-linux.img, and initramfs-linux-fallback.img

Offline

#4 2013-07-22 21:49:15

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: Arch does not boot (MacBook Pro, rEFIt)

Try setting a volume name on your Linux partition and using that instead of a number in your "volume" specification. The numbers aren't really entirely reliable. Also, double-check that the EFI filesystem driver for whatever filesystem you're using on your Linux root (/) filesystem is installed.

Offline

#5 2013-07-22 22:23:55

alesssia
Member
Registered: 2013-01-16
Posts: 12

Re: Arch does not boot (MacBook Pro, rEFIt)

Maybe that drivers are the problem: Mac OS X uses 64-bit EFI implementation, while the Arch's root filesystem is ext2 IA32.
rEFInd installed (in /EFI/refind/drivers_x64/) the ext2_x64.efi file. I used ./install.sh --alldrivers. How can I get the correct driver?

Offline

#6 2013-07-23 15:04:52

alesssia
Member
Registered: 2013-01-16
Posts: 12

Re: Arch does not boot (MacBook Pro, rEFIt)

I stepped further, but I'm not sure of what I did, and the situation did not improve sad

In the rEFInd source code zip I found the ia32 drivers, that I copied in /EFI/refind/drivers, without changing the "scan_driver_dirs" option in refid.conf.
As suggested, I set a volume name (boot) and changed my Linux's stanza as:

menuentry "Arch Linux" {
    icon /EFI/refind/icons/os_arch.icns
    volume boot
    loader /boot/vmlinuz-linux
    initrd /boot/initramfs-linux.img
    options "root=UUID=e6db22f2-e5bb-4933-bba7-20be86db00if rootfstype=ext4 ro quiet"
    ostype Linux
    graphics off
}

(the '/' partition is ext4, while 'boot' is ext2).
After these modifies, Arch does not boot and I receive the following message:

Starting vm-linuz-linux
Using load options root=UUID=e6db22f2-e5bb-4933-bba7-20be86db00if ro quiet initrd=\boot\initramfs-linux.img
Error: Not Found while loading vmlinuz-linux

Besides, the laptop gets stuck in the gray boot page until I press any key, when the rEFInd menu shows up.

Does anyone have any further hint? I'm stuck too sad

Offline

#7 2013-07-23 15:51:33

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: Arch does not boot (MacBook Pro, rEFIt)

alesssia wrote:

Maybe that drivers are the problem: Mac OS X uses 64-bit EFI implementation, while the Arch's root filesystem is ext2 IA32.
rEFInd installed (in /EFI/refind/drivers_x64/) the ext2_x64.efi file. I used ./install.sh --alldrivers. How can I get the correct driver?

The filesystem drivers included with rEFInd are EFI drivers, and they must match the EFI's bit-depth. Thus, if your Mac uses a 64-bit EFI, you must use the 64-bit EFI drivers. In fact, installing drivers of the wrong architecture can produce unpredictable results. At best, they won't be launched and won't cause any real harm. At worse, they can hang the computer. Thus, you should remove any drivers for an architecture that you're not running.

Ext2fs (like every common filesystem) is the same no matter what the bit depth of the OS -- that is, if you create an ext2fs partition with a 64-bit (AMD64) Linux, that partition will be readable if you boot into a 32-bit (x86) Linux, or even some other CPU architecture entirely, like PowerPC.

If you're using a 32-bit version of Linux on a 64-bit EFI, then rEFInd won't boot your kernel directly. This is because EFI is locked to its architecture and bit depth -- a 64-bit EFI will launch only 64-bit EFI applications, and a 32-bit Linux kernel looks like a 32-bit application. That said, an attempt to launch a wrong-architecture kernel or EFI binary will not produce a "not found" error; it will produce an "unsupported" error. Thus, such a mismatch is not the cause of your problem.

Your error message clearly indicates that rEFInd is not able to find the kernel you've specified at the location you've specified. You may want to launch an EFI shell (install one, if necessary), launch it, and explore your filesystems that way. It's conceivable that your Linux partition is not showing up in the way you expect; or it might not be showing up at all because you might have the wrong driver installed, or the driver might be installed to the wrong directory.

Generally speaking, using rEFInd's auto-detection is more reliable than using manual boot stanzas; there's much greater chance of human error (typos, etc.) when creating manual boot stanzas. You haven't said if the kernel is showing up in the automatic scans, though. If not, that suggests either strange kernel placement or a driver problem.

Offline

#8 2013-07-24 09:39:04

alesssia
Member
Registered: 2013-01-16
Posts: 12

Re: Arch does not boot (MacBook Pro, rEFIt)

The rEFInd's auto-detection shows a generic Linux OS bootable from a generic HD. When selected, Tux is shown, followed by a grub line (that is "GRUB loading"), then by a black screen. Finally, the rEFInd menu shows up again. This is the same behaviour showed by rEFIt and the reason because I used stanzas.

After playing with the EFI shell I was able of fixing the Arch stanza, finally finding an error that should be expected:

Starting vm-linuz-linux
Using load options root=UUID=e6db22f2-e5bb-4933-bba7-20be86db00if ro quiet initrd=initramfs-linux.img
Error: Unsupported while loading vmlinuz-linux

In fact, I'm using a 32-bit version of Arch on a 64-bit EFI.

I’m currently trying to fix my hybrid MBR, but despite all my efforts with the gdisk and the gptsync (in rEFInd) tools I always end up with the behaviour described in the first lines of this post: “Grub loading...”, black screen, then rEFInd menu again sad

I have no idea about how to proceed. Perhaps (re)installing the 64-bit version of Arch is the only possible solution, but I’m scared by all the painful configuration steps that will follow a fresh installation...

I’m  honestly rather desperate.

Offline

#9 2013-07-24 14:03:41

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: Arch does not boot (MacBook Pro, rEFIt)

alesssia wrote:

The rEFInd's auto-detection shows a generic Linux OS bootable from a generic HD. When selected, Tux is shown, followed by a grub line (that is "GRUB loading"), then by a black screen. Finally, the rEFInd menu shows up again. This is the same behaviour showed by rEFIt and the reason because I used stanzas.

That description indicates that you were launching a BIOS-mode version of GRUB, and that it failed for some reason that's almost certainly GRUB-specific (bad configuration file, missing modules, etc.).

After playing with the EFI shell I was able of fixing the Arch stanza, finally finding an error that should be expected:

Starting vm-linuz-linux
Using load options root=UUID=e6db22f2-e5bb-4933-bba7-20be86db00if ro quiet initrd=initramfs-linux.img
Error: Unsupported while loading vmlinuz-linux

In fact, I'm using a 32-bit version of Arch on a 64-bit EFI.

That's the problem, then. On a 64-bit EFI, rEFInd can launch 64-bit kernels but not 32-bit kernels.

I’m currently trying to fix my hybrid MBR, but despite all my efforts with the gdisk and the gptsync (in rEFInd) tools I always end up with the behaviour described in the first lines of this post: “Grub loading...”, black screen, then rEFInd menu again sad

I'm not sure what's wrong with that, but I can say with some certainty that it's a GRUB issue. (That's not to say that the solution is in the GRUB configuration; adjusting the hybrid MBR might fix it, but I'm not sure precisely what to suggest.)

I have no idea about how to proceed. Perhaps (re)installing the 64-bit version of Arch is the only possible solution, but I’m scared by all the painful configuration steps that will follow a fresh installation...

As you suspect, installing a 64-bit version of Arch should fix the problem. For that matter, a 64-bit kernel with 32-bit userland should work OK, although that might be tricky to maintain -- I imagine that pacman would try to "upgrade" you to new 32-bit kernels every now and then. Still, it might be worth giving it a try. If you do, I recommend installing a kernel, initrd file, and kernel modules (in /lib/modules) outside of pacman. Install a kernel that's slightly behind whatever is current in pacman. That way, even if pacman upgrades your kernel, your 64-bit kernel will be untouched. You can then upgrade your kernel manually whenever it's convenient or desirable to do so.

Another option is to install a 64-bit version of EFI-mode GRUB, ELILO, or SYSLINUX, and have it launch a 32-bit kernel. I know this is possible because I've done it in some test installations, but I don't recall offhand which boot loader I used, so I can't promise that all three of the ones I mentioned would work. If you go this route, you'll end up with rEFInd to select OS X or GRUB/ELILO/SYSLINUX, which you can then use to select your Linux kernel (or set a very short timeout to launch the kernel more-or-less immediately). See my Web page on EFI boot loaders for Linux for my thoughts on each of these boot loaders.

Offline

#10 2013-07-25 22:49:41

alesssia
Member
Registered: 2013-01-16
Posts: 12

Re: Arch does not boot (MacBook Pro, rEFIt)

After spending >24h to install a 64-bit version of GRUB and SYSLINUX to launch my 32-bit Arch kernel without any success, I decided that to install a fresh 64-bit version of Arch would be my last chance.
As supposed, now rEFInd is able of booting Arch directly, but unfortunately the boot freezes sad
But is another story -and a new post in the forum wink

Thanks Rod for your supports, it was precious!
Should I flag this post as solved?

Offline

Board footer

Powered by FluxBB