Jump to content

Want to improve Booting : Lion, EFI, Grub2, Ubuntu


  • Please log in to reply
13 replies to this topic

#1
MiMe

MiMe

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
Hi,

I successfully installed Dualboot Ubuntu 11.10 64 Bit and OS X Lion on
single partition of my netbook.

HD is partitoned as GPT with Efi System Partition (ESP). (grub-efi-amd64
and grub-efi-amd64-bin version 1.99-12ububtu12) Grub2 is installed on ESP
and is invoked by UEFI boot process. Grub2 starts flawlessly Ubuntu 11.10
64 Bit.

I can boot OSX from external USB Stick (called MINI) but this is a
cumbersome, almost painful procedure : interrupting boot process,
selecting USB Stick to start Chameleon v2.1svn r1640. Chameleon detects
'hd(1,3) LION' partition but fails sometime to start. It can't find
/machkernel. After inserting 'rd=disk0s3' on cmd line, chameleon succeeds
usually at the second try.

Actually I want to boot OSX with help of Grub2 not needing USB Stick any
longer.

Grub can boot EFI-Shell where I start rEFIt (Version 0.14 -rws). rEFIt shows me
the options 'Boot Legacy OS from MINI' and 'Boot Legacy OS from Partition 3',
but cant boot it. Error is 'Starting legacy loader // Error: Not Found while
loading legacy loader // Please make sure that you have the latest firmware
update installed.'

My desktop computer boot snow leopard by grub1 installed on first MBR HD.
menu.lst contains the lines

'
####################
title OS X Leopard
kernel (hd0,0)/boot/osx_boot biosdev=81
'

Option kernel is not used any longer at grub2. Trying to load osx_boot (Chameleon)
by using option linux or multiboot fails.

I tried also to use elilo. I can start elilo but elilo seems to boot only linux
and no other os.

Chameleon is installed on Lion (hd1,3) but how can I jump to it by grub2.

How can I flawlessly integrate OSX Lion into my boot process?

Please help.
Thanks.
MiMe

#2
hellslinger

hellslinger

    InsanelyMac Protégé

  • Members
  • Pip
  • 18 posts
On my laptop, I've not had any luck getting Chameleon to discover my linux partition.

On the other hand, I've had some luck getting grub2 to "chainload" chameleon.

1) Install grub-efi on your ubuntu install. Either boot into it from your USB boot or chroot into it.
2) Run 'grub-install /dev/<your hard drive device>'

if you get any errors or warnings about not having a bios partition, or something of the sort, use gparted to make an ext2 partition of at least 128kB and make sure to set the bios_grub flag on it. Try grub install again on that drive.

3) Replace the "Mac OS X" sections in /boot/grub/grub.cfg with this as the xnu_kernel commands don't seem to work:

menuentry "Mac OS X" {
insmod hfsplus
set root=(hd0,<partition number>) #replace brackets with root filesystem in mac os
multiboot /boot
}

Now here's where I get stuck, but this has to be easy to fix. Perhaps someone else can fill me in here.

Mac OS 10.7.2 starts to boot, but it gets stuck with:

rooting via boot-uuid fromk /chosen: <UUID # here>
Waiting on <dict ID="0"><key>IOProviderClass</key><string id="1">IOResources</string><key>IOResourceMatch</key><string id="2">boot-uuid-media</string></dict>
Still waiting for root device

I've tried specifying 'rd=disk0sX' after getting into chameleon to no avail.

#3
MiMe

MiMe

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
Hi Hellslinger,

multiboot does not help. grub loads /boot file but screen turns black and nothing appears.

Which boot-file do you use? I use that from Chameleon v2.1svn r1640

The reason four error "Still waiting for root device" is probadly missing HD kext (AHCI ..)
that should be preloaded. Chameleon find mach_kernel but not driver that are ususally
located at preboot.dmg or Extra-Folder outside root-partition.

How can chameleon preload kext?

Regards,
MiMe

#4
MiMe

MiMe

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts

menuentry "Mac OS X" {
insmod hfsplus
set root=(hd0,<partition number>) #replace brackets with root filesystem in mac os
multiboot /boot
}


I replaced Chameleon v2.1svn r1640 with recent r1730 and put boot and Extra-Folder
into root-dir of ESP. Grub finds boot and load it (option multiboot) but screen getting
dark and dots are appearing (like loading something). No screen appears. I have to
reset my thinkpad.

Any idea? Any options are needed?

Thanks for help.
MiMe

#5
hellslinger

hellslinger

    InsanelyMac Protégé

  • Members
  • Pip
  • 18 posts
I'm using chameleon 2.1 svn1730.

I'm going to look into this AHCI/HD kext preload that you mentioned. Any specific advice would be welcome.

I'll keep you posted if I find out anything more.

#6
MiMe

MiMe

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts

I'm using chameleon 2.1 svn1730.

I'm going to look into this AHCI/HD kext preload that you mentioned. Any specific advice would be welcome.

I'll keep you posted if I find out anything more.


Think that org.chameleon.Boot.plist has to be configured in your case.


Concerning my black screen. It seems to be an video issue. How can I configure boot itself.
I found only the option "biosdev=<XX>". How can I disable Chameleon GUI?

Could you please post me your grub.cfg. Thanks

MiMe

#7
hellslinger

hellslinger

    InsanelyMac Protégé

  • Members
  • Pip
  • 18 posts
http://paste.ubuntu.com/782749/

This is basically the same grub.cfg that ubuntu installs, but the Mac OS sections that get inserted by /etc/grub.d/30_os-prober are removed and the "Mac OS 10.7.2" was put in by me.

Are you able to hit tab and bypass the Chameleon GUI? Or is the gui causing a crash that prevents this?

#8
hellslinger

hellslinger

    InsanelyMac Protégé

  • Members
  • Pip
  • 18 posts
I found a solution for my problem. Mime, I'm not sure if this will help you, but you might want to give it a shot:

1) Make sure to flag your Mac OS boot partition as -NOT- boot using (g)parted.
2) Run gptsync in linux. This will put the necessary partition data in your MBR from the GPT table (This is my understanding).

Without this, Chameleon does not seem to have enough information to properly boot the HFS+ partition, even though it is able to begin to boot.

MiMe, were you able to boot before grub2 was installed?

I believe that removing /Extra/Themes will disable the "GUI" in chameleon.

Best of luck to you, and happy holidays.

#9
MiMe

MiMe

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts
Thanks for yor post.

It seems to me that you're using another boot procedure probadly 32Bit.
Your grub2 is probadly installed into MBR. I dont use MBR at all but
UEFI boot.

Boot procedure of my laptop.

1.) UEFI -> 64 Bit grub.efi in ESP -> Ubuntu 11.10 (works fine)
2.) UEFI -> 64 Bit grub.efi in ESP -> Chameleon (2.0 or 2.1) (black screen)
3.) UEFI -> 64 Bit grub.efi in ESP -> EFI Shell (64 Bit) (works fine)
4.) UEFI -> 64 Bit grub.efi in ESP -> EFI Shell (64 Bit) -> refit (0.14 -rws via startup.nsh (refit shws up, detects OSX and Ubuntu but fails to load)

5.) F11 -> select USB-Stick -> Chameleon 2.1 (works at second press enter; error at first pressing enter : cannot find /mach_kernel; at second pressing need option "rd=disk0s3"

6.) UEFI -> 32 Bit grub.efi (fails to load)

I corrected MBR via gptsyn


root@mime-ThinkPad-X121e:~# gptsync /dev/sda

Current GPT partition table:
# Start LBA End LBA Type
1 40 409639 EFI System (FAT)
2 526336 21497855 Basic Data
3 21497856 126093311 Mac OS X HFS+
4 126355456 134744063 Linux Swap
5 134744064 344459263 Basic Data
6 344459264 442115511 Mac OS X HFS+
7 442377656 624880263 Mac OS X HFS+

Current MBR partition table:
# A Start LBA End LBA Type
1 1 409639 ee EFI Protective
2 526336 21497855 0c FAT32 (LBA)
3 * 21497856 126093311 af Mac OS X HFS+
4 126355456 134744063 82 Linux swap / Solaris

Status: MBR table must be updated.

Proposed new MBR partition table:
# A Start LBA End LBA Type
1 1 409639 ee EFI Protective
2 526336 21497855 83 Linux
3 * 21497856 126093311 af Mac OS X HFS+
4 126355456 134744063 82 Linux swap / Solaris

May I update the MBR as printed above? [y/N] y
...


Have you succeded to preload AHCI/HD kext.

Happy holiday to you too.
MiMe

#10
hellslinger

hellslinger

    InsanelyMac Protégé

  • Members
  • Pip
  • 18 posts
I think that Chameleon uses MBR information (it does appear to on my laptop with BIOS) to correctly detect partitions.

My system is booting correctly now, I did not have to preload any kexts, however.

I will be dual booting ubuntu and lion on a UEFI system in about a week. I will keep you posted with my results.

#11
MiMe

MiMe

    InsanelyMac Protégé

  • Members
  • Pip
  • 19 posts

I think that Chameleon uses MBR information (it does appear to on my laptop with BIOS) to correctly detect partitions.

My system is booting correctly now, I did not have to preload any kexts, however.

I will be dual booting ubuntu and lion on a UEFI system in about a week. I will keep you posted with my results.


Thanks for your reply.

I was struggling with my laptop last days ... and did not succeed to multiboot Chameleon from 64 bit efi grub2.
However I succeeded to multiboot Chameleon from 32 bit mbr grub2. You can image ... this drove me crazy.
The setup was the same : mkfs.hfsplus sdaX, Chameleon boot and Extra into / of sdaX, dd if=boot1h of=/dev/sdaX,
grub.cfg menuentry Chameleon { multiboot (hd0,X)/boot }

Either there is a bug in efi 64 bit grub2 or my grub2 installation is not correct (modul missing ??) I dont know.
Maybe I check it later via Virtualbox.

Now I used patched Lion install penstick to install onto mbr partition. This worked as it should.

It took me also some time to load all important and working kexts.

Please keep me up to date. Think that my laptop wiants to get a ssd hd next christmas ;-)

Thanks!
MiMe

#12
bignumbas

bignumbas

    InsanelyMac Protégé

  • Members
  • Pip
  • 1 posts
Hi,

Hellslingers menu correction worked perfectly for me after I updated the MBR with gptsync

I have an ASUS P8H61-M LX EFI Board with two 500gb gpt partitioned drives, OS X Lion 7.2 on one and Kubuntu 11.10 64bit on the other. If I make Lion the boot disk, Ubuntu appears in the Chamelon menu choices as well.

The Linux drive was originally setup from OS X and had Lion on the first half and Linux on the second, but later I deleted OS X and resized the linux to take up all the space.
I updated to grub-efi as well on the journey.

root@Kubuntu64:~# blkid
/dev/sda1: LABEL="EFI" UUID="70D6-1701" TYPE="vfat"
/dev/sda4: LABEL="Kubuntu64_11.10" UUID="681cf96a-fe3e-4f2d-9536-935025e12e14" TYPE="ext4"
/dev/sda5: UUID="1409dc2c-fe7e-4491-9f1a-5232414542be" TYPE="swap"

/dev/sdb1: LABEL="EFI" UUID="3F3C-1AF6" TYPE="vfat"
/dev/sdb2: UUID="200408e4-4c38-378d-b8ad-b26c7a0d1c4d" LABEL="Lion 7.2" TYPE="hfsplus"

I find blkid very handy for this too.

Thanks for sharing guys.

#13
hellslinger

hellslinger

    InsanelyMac Protégé

  • Members
  • Pip
  • 18 posts
Glad to hear it worked, bignumbas. I'm about to install kubuntu 64 also.

MiMe,

My MSI UEFI Sandy Bridge motherboard will display a ad-hoc boot menu when I press F11. I have the options to boot things in EFI mode or as MBR/DOS mode. Are you able to get such a menu on your thinkpad? It might help to try both methods: I have noticed very different boot behavior.

#14
rahoolm

rahoolm

    InsanelyMac Protégé

  • Members
  • Pip
  • 1 posts

Hello All,
 
I wanted to boot mac iso file using grub2. I saw this topic which seems a little same though here you are trying to boot OS X partition directly.
here is what I am trying to do.

menuentry "Bootable ISO Image: Mac try 2"  --class osx --class darwin {
insmod part_msdos
insmod hfsplus
set root=(hd0,msdos7)/boot/images/mac.iso
search --no-floppy --set=root (hd0,msdos7)/boot/images/mac.iso
xnu_kernel /kernelcache
chainloader /System/Library/CoreExtensions/boot.efi
multiboot /boot
 
}

 

Is it possible to boot from macosx.iso using grub2 on Ubuntu?

Shall I open new topic to ask my question?

 

Please give me some direction.

 

Thanks!







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy