Jump to content

GRUB2 as the only boot loader: it's possible!


srs5694
 Share

59 posts in this topic

Recommended Posts

For you guys having problems with Chameleon not showing Linux installation, this is how it works for me.

First, make sure you have a way to boot your installs if something goes wrong.. get Super Grub Disk, it will boot your Linux install if everything else fails. Also keep a pre-boot CD for OS X, you can make one with this app.. i'm mentioning a pre-boot CD because it's the only method i can trust atm.. use what ever works for you.

Tests i made were done using Ubuntu 9.10, selecting Grub to install to /.

 

First case.. GUID partitioned HD:

- the only problem here is that, Chameleon gets wiped out of MBR. yeah, even installing it to /.

Also, when configuring installation there's no mention of the "BIOS boot partition" creation.. i think that lead me to a second install, as the first one was not showing on Chameleon. I'm assuming Grub didn't got installed to the correct partition (or not installed at all) because of the creation of "BIOS boot partition" but, there's always the possibility i messed up ;) can't be sure atm.

I removed this install because, this breaks all the nice things DiskUtility can do to GUID HD's like resizing, deleting, adding partitions. I only did it to test Grub.. i already knew this would break from previous tests. Don't know if it's the presence of another file system or the fact that these installations don't use the same layout as OS X installs (no 128MB unallocated space between partitions).

 

Second case.. MBR partitioned HD:

- no problems with MBR being wiped here and no "BIOS boot partition" creation. A lot of problems caused by Extended/Logical partitions.

The only way i got this to work was by setting up a Primary partition for Ubuntu, after XP/Windows 7 and installing Ubuntu without Swap partition. I did a install providing Swap partition (on Extended partition) and it did show on Chameleon but then, Ubuntu would take forever to boot.. and i do mean "forever", so much i didn't had the patience to wait :P I'm a patient guy so... If you get the blinking cursor, wait a couple of minutes, probably it's booting slow.(*)

Letting Ubuntu do the partitioning always leads to the use of Extended partition, even if i only leave XP partition.

 

After this tests, this is my HD layout:

- Note: HD's are not in the correct order.. OS X insists on doing that a lot lately, more than usual..

Azi@AziLandz:~

>dul  [b]<alias to "diskutil list"[/b]
/dev/disk0  [b]<SATA 3[/b]
  #:                       TYPE NAME                    SIZE       IDENTIFIER
  0:      GUID_partition_scheme                        *500.1 GB   disk0
  1:                        EFI                         209.7 MB   disk0s1
  2:                  Apple_HFS Snow                    200.0 GB   disk0s2
  3:                  Apple_HFS Home                    99.9 GB    disk0s3
  4:                  Apple_HFS SnowLab                 30.0 GB    disk0s4
  5:                  Apple_HFS Leo                     30.0 GB    disk0s5
/dev/disk1  [b]<SATA 1[/b]
  #:                       TYPE NAME                    SIZE       IDENTIFIER
  0:     FDisk_partition_scheme                        *320.1 GB   disk1
  1:               Windows_NTFS XP                      64.4 GB    disk1s1
  2:               Windows_NTFS Windows_7               32.2 GB    disk1s2
  3:                      Linux Ubuntu                  32.2 GB    disk1s3
[i]Extended partition[/i]
  4:                 Linux_Swap                         2.1 GB     disk1s5
  5:                  Apple_HFS Virtual                 53.7 GB    disk1s6
  6:                  Apple_HFS Hyperspace              135.4 GB   disk1s7

 

As you can see i have the Swap partition, added later to the Extended partition. The thing is, the Swap partition is not activated at startup.. a simple way to activate it is by using GParted after you boot into the system. Anyway, unless you have small RAM size or you need to do some "heavy lifting", most probably the system wont use the Swap.

 

As a sort of conclusion:

- doing this on GUID HD is much easier. Just install manually, Chameleon boot0 back to MBR and Grub2 to the partition if it doesn't show on Chameleon.

- if you really have to do it to MBR HD, follow my testing and keep in mind, this can work different on your machine. Installing Grub2 manually didn't help in the cases were it didn't show up on Chameleon. It always shows a "not good idea" msg when installing to partition, even when install is successful. In the cases were Ubuntu was installed to Logical partition, manual Grub2 installation was never successful.

 

As for the real theme of this thread, one thing is certain, Grub2 is not prepared to deal with Snow.. it's not that difficult to understand why, just look at the path for system mkext on grub.cfg entries (first post).

Atm choosing any OS X installation to boot sends me back to Grub2 prompt. I did some attempts while testing.. they all ended up in kp. Will have to test this with more time and reading.

 

Hope this helps..

See ya.

 

Edits:

- One less important thing i forgot to mention.. Ubuntu always insisted on creating a 5,8MB unallocated space before the / partition, except when i left only the first one, XP.

 

(*): This just happened again, after i installed some updates on Ubuntu (including a Proposed update for Grub), rebooted, tried to boot OS X and booted Ubuntu again. A new reboot and another one, were ok. But, no audio.. grrrr.. this already happened while testing and booting with Super Grub Disk. It seems it's not SGD's fault!

Edited by Azimutz
Link to comment
Share on other sites

First case.. GUID partitioned HD:

- the only problem here is that, Chameleon gets wiped out of MBR. yeah, even installing it to /.

 

Unfortunately, the most common Linux GPT tools (GNU Parted and its GUI relatives) wipe out the boot loader from the MBR on GPT disks. I believe the logic is that EFI doesn't use this code, so it "should" be empty, and the partitioning tools make it so.

 

Also, when configuring installation there's no mention of the "BIOS boot partition" creation.. i think that lead me to a second install, as the first one was not showing on Chameleon. I'm assuming Grub didn't got installed to the correct partition (or not installed at all) because of the creation of "BIOS boot partition" but, there's always the possibility i messed up :) can't be sure atm.

 

On a GPT disk, GRUB2 works best when a BIOS Boot Partition is present, since GRUB2 installs part of its code there. (This partition can be quite small -- 100KB is probably plenty big, although I'm not sure exactly how big it should be for GRUB2.) Without a BIOS Boot Partition, GRUB2 should still install and work, but it'll be more susceptible to failure if files get moved around on the boot partition.

 

I believe there's a way to create a BIOS Boot Partition in GNU Parted, but I don't recall the exact procedure. It's quite simple in GPT fdisk -- just create a partition and assign it a type code of ef02. (Note that GPT fdisk's type codes are unique to it; I used this scheme because the real GPT type codes are GUIDs, which are 16-byte numbers -- 21686148-6449-6E6F-744E-656564454649, in the case of the BIOS Boot Partition. Expecting users to type or remember such numbers is unreasonable.)

 

I removed this install because, this breaks all the nice things DiskUtility can do to GUID HD's like resizing, deleting, adding partitions. I only did it to test Grub.. i already knew this would break from previous tests. Don't know if it's the presence of another file system or the fact that these installations don't use the same layout as OS X installs (no 128MB unallocated space between partitions).

 

I don't know precisely what Apple's Disk Utility requires of GPT disks in order to support resizing, but the 128MB between partitions is certainly a possibility. Apple specifies this as something that should be done for its disks, although it's not part of the GPT specification. IIRC, Microsoft's tools also create such a gap between partitions, but neither GNU Parted nor GPT fdisk enforces such a rule. (You can still create such layouts, but you'll need to set the start and end points to add this gap.) Apple also recommends aligning partitions on 4KB boundaries, apparently because of HFS+ issues. AFAIK, no non-Apple tool enforces that rule, either.

 

Second case.. MBR partitioned HD:

- no problems with MBR being wiped here and no "BIOS boot partition" creation. A lot of problems caused by Extended/Logical partitions.

 

On MBR disks, I think (but am not positive) that GRUB2 installs part of its boot loader in the unpartitioned space between the MBR (the first sector of the disk) and the start of the first partition, which is normally sector 63. This effectively serves the same role as the BIOS Boot Partition on GPT disks.

 

Letting Ubuntu do the partitioning always leads to the use of Extended partition, even if i only leave XP partition.

 

Most Linux distributions have taken to using simplified partitioning tools with few options as part of their install routines. IIRC, Fedora uses primary partitions exclusively unless you want more than three or four partitions, at which point it begins using logical partitions for the extras. I'm not intimately familiar with Ubuntu's installer, but it doesn't surprise me to hear that it does things differently, favoring logical partitions. FWIW, the lack of the primary/extended/logical partition distinctions is one of the big advantages of GPT over MBR.

 

As you can see i have the Swap partition, added later to the Extended partition. The thing is, the Swap partition is not activated at startup.. a simple way to activate it is by using GParted after you boot into the system. Anyway, unless you have small RAM size or you need to do some "heavy lifting", most probably the system wont use the Swap.

 

Check your /etc/fstab file. In Linux, swap is defined there, in a line like this:

 

/dev/sda6	   none			swap	sw			  0	   0

 

The device identifier (/dev/sda6 in this example) may be replaced by something taking another form, such as a UUID, to make the system less susceptible to device ID changes. In any event, if you don't see a line like this, you can add one. If you do see such a line, verify that the device identifier is correct.

 

Although a system with plenty of RAM might not need swap for most things, having it is helpful insurance in case of an unusual RAM demand. It's also used for deep sleep modes (most useful on notebooks and netbooks); Linux stores its RAM snapshot to swap for quick recovery when it wakes up.

 

- One less important thing i forgot to mention.. Ubuntu always insisted on creating a 5,8MB unallocated space before the / partition, except when i left only the first one, XP.

 

I suspect this is related to cylinder alignment code in GNU Parted, upon which Ubuntu's partitioning tool is probably based. In some GNU GNU Parted variants I've seen, there's a check box to enable or disable cylinder alignment. Turning it on produces gaps at the starts and ends of the disk; turning it off eliminates those gaps. This feature is useful for producing MBR disks that are less likely to cause problems in older OSes, but AFAIK it's completely useless for GPT disks.

Link to comment
Share on other sites

Ok everyone, I have finally figured some things out and my system is up and running.

 

Originally I was trying to set up my system as so:

 

Sda1: testing blank partition

Sda2: Windows 7

Sda3: OSX

Sda4 - EXTENDED

Sda5: Karmic

Sda6: Swap

Sda7: Storage for docs

 

This setup worked great when I had Jaunty, but Karmic was giving me lots of trouble. After multiple installs and googling for hours, and thanks to some posts here, I quickly found out that Karmic does not like to be on an extended partition for some reason. So my thought process was simple. Swap OSX and the Karmic partitions. I did so, and I could never get OSX to boot off of the extended either. I am not sure why. However, since I hardly use the testing partition, I felt that it was in my best interest that I dump this and Keep it to three up front and swap and storage on the extended.

 

So I reformated and installed karmic and Os X, and restored an image of windows 7 I had to the 3 primary partitions up front on my drive.

 

During my Karmic install I made sure that I installed grub to that partition. The OSX install went normal as planned, and then I installed chameleon to that drive and the boot process works fine. Anyway, I hope this helps any of you that are running into the same issues that I have had. Thanks again for all of the help.

Link to comment
Share on other sites

First case.. GUID partitioned HD:

- the only problem here is that, Chameleon gets wiped out of MBR. yeah, even installing it to /.

Also, when configuring installation there's no mention of the "BIOS boot partition" creation.. i think that lead me to a second install, as the first one was not showing on Chameleon. I'm assuming Grub didn't got installed to the correct partition (or not installed at all) because of the creation of "BIOS boot partition" but, there's always the possibility i messed up :D can't be sure atm.

I removed this install because, this breaks all the nice things DiskUtility can do to GUID HD's like resizing, deleting, adding partitions. I only did it to test Grub.. i already knew this would break from previous tests. Don't know if it's the presence of another file system or the fact that these installations don't use the same layout as OS X installs (no 128MB unallocated space between partitions).

 

I understand that chameleon can only chain boot linux by loading a partitions boot sector with grub in it (post #17), so if grub2 cannot be installed just there in a GPT disk and it needs to be in mbr and bios boot partition, I think its imposible to make it work with chameleon at its current state.

 

As for the real theme of this thread, one thing is certain, Grub2 is not prepared to deal with Snow.. it's not that difficult to understand why, just look at the path for system mkext on grub.cfg entries (first post).

Atm choosing any OS X installation to boot sends me back to Grub2 prompt. I did some attempts while testing.. they all ended up in kp. Will have to test this with more time and reading.

 

You are surely right about grub2 not being able to deal with snow but I doubt the mkext location error would stop it, if I understand the grub code right, it will just load the kexts from /S/L/E when it doesnt find /S/L/Extensions.mkext. I changed the grub entry to this:

 

[code
xnu_kernel /mach_kernel boot-uuid=${uuid} rd=*uuid
if [ /System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext -nt /System/Library/Extensions ]$
xnu_mkext /System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext
else
xnu_kextdir /System/Library/Extensions
fi
}[/code]

 

and it didnt make any difference, the panic that appears seem to be related to boot arguments, the same one as reported above:

 

panic(cpu 0 caller 0x2ac8d5): "Incompatible boot args version 1 revision 4\n"0/SourceCaches/xnu/xnu-1456.1.25/osfmk/i386/AT386/nodul_dmp.c:542

 

It seems to be traced to this file in the kernel source and this snipped of code:

 

/* Remap EFI runtime areas. */
void
hibernate_newruntime_map(void * map, vm_size_t map_size, uint32_t system_table_offset)
{
boot_args *args = (boot_args *)PE_state.bootArgs;

kprintf("Reinitializing EFI runtime services\n");

if (args->Version != kBootArgsVersion1)
return;
do
{
	vm_offset_t vm_size, vm_addr;
vm_map_offset_t phys_addr;
EfiMemoryRange *mptr;
unsigned int msize, mcount;
unsigned int i;

gPEEFISystemTable	 = 0;
gPEEFIRuntimeServices = 0;

system_table_offset += ptoa_32(args->efiRuntimeServicesPageStart);

kprintf("Old system table 0x%x, new 0x%x\n",
	(uint32_t)args->efiSystemTable,	system_table_offset);

args->efiSystemTable	= system_table_offset;

kprintf("Old map:\n");
msize = args->MemoryMapDescriptorSize;
mcount = args->MemoryMapSize / msize;
mptr = (EfiMemoryRange *)ml_static_ptovirt(args->MemoryMap);
for (i=0; i < mcount; i++, mptr = (EfiMemoryRange *)(((vm_offset_t)mptr) + msize)) {
	if ((mptr->Attribute & EFI_MEMORY_RUNTIME) == EFI_MEMORY_RUNTIME) {

	vm_size = (vm_offset_t)i386_ptob((uint32_t)mptr->NumberOfPages);
	vm_addr =   (vm_offset_t) mptr->VirtualStart;
	phys_addr = (vm_map_offset_t) mptr->PhysicalStart;

	kprintf("mapping[%u] %qx @ %lx, %llu\n", mptr->Type, phys_addr, (unsigned long)vm_addr, mptr->NumberOfPages);
	}
}

pmap_remove(kernel_pmap, i386_ptob(args->efiRuntimeServicesPageStart), 
			 i386_ptob(args->efiRuntimeServicesPageStart + args->efiRuntimeServicesPageCount));

kprintf("New map:\n");
msize = args->MemoryMapDescriptorSize;
mcount = (unsigned int )(map_size / msize);
mptr = map;
for (i=0; i < mcount; i++, mptr = (EfiMemoryRange *)(((vm_offset_t)mptr) + msize)) {
	if ((mptr->Attribute & EFI_MEMORY_RUNTIME) == EFI_MEMORY_RUNTIME) {

	vm_size = (vm_offset_t)i386_ptob((uint32_t)mptr->NumberOfPages);
	vm_addr =   (vm_offset_t) mptr->VirtualStart;
	phys_addr = (vm_map_offset_t) mptr->PhysicalStart;

	kprintf("mapping[%u] %qx @ %lx, %llu\n", mptr->Type, phys_addr, (unsigned long)vm_addr, mptr->NumberOfPages);

#if defined(__i386__)
	pmap_map
#elif defined(__x86_64__)
	pmap_map_bd /* K64todo resolve pmap layer inconsistency */
#endif
		(vm_addr, phys_addr, phys_addr + round_page(vm_size),
		 (mptr->Type == kEfiRuntimeServicesCode) ? VM_PROT_READ | VM_PROT_EXECUTE : VM_PROT_READ|VM_PROT_WRITE,
		 (mptr->Type == EfiMemoryMappedIO)	   ? VM_WIMG_IO   : VM_WIMG_USE_DEFAULT);
	}
}

	if ((args->Version != kBootArgsVersion1) || (args->Version == kBootArgsVersion1 && args->Revision < kBootArgsRevision1_5 ))
		panic("Incompatible boot args version %d revision %d\n", args->Version, args->Revision);

	kprintf("Boot args version %d revision %d mode %d\n", args->Version, args->Revision, args->efiMode);
	if (args->efiMode == kBootArgsEfiMode64) {
	efi_set_tables_64((EFI_SYSTEM_TABLE_64 *) ml_static_ptovirt(args->efiSystemTable));
	} else {
	efi_set_tables_32((EFI_SYSTEM_TABLE_32 *) ml_static_ptovirt(args->efiSystemTable));
	}
}
while (FALSE);

kprintf("Done reinitializing EFI runtime services\n");

return;
}

 

I'm not a coder so I dont really understand whats going wrong, something related with memory remapping?

 

Can someone confirm if we need to load efiemu? I understand that IT IS NEEDED to boot Mac OS X kernels on non-EFI machines, the fact that osprober script that creates the built-in grub.cfg entry for OS X doesnt put it there it could be only because it is made for real macs which doesnt need it, but I'm not sure if the modules would get autoloaded when needed (i.e. if xnu_kernel finds out it cant load the kernel without efiemu, would it be loaded automatically or not?)

 

I tried to play with the efiemu commands but arrived no where :-(

These are the mods to grub.cfg I tried:

insmod efiemu
# use only one, 32 or 64
# efiemu_loadcore /boot/grub/efiemu64.o
efiemu_loadcore /boot/grub/efiemu32.o
efiemu_pnvram
efiemu_prepare

 

But it made no difference at all...

Maybe an updated grub2 package or compilation will fix it, I was just using the built-in Kubuntu 9.10 package.

 

 

 

This setup worked great when I had Jaunty, but Karmic was giving me lots of trouble. After multiple installs and googling for hours, and thanks to some posts here, I quickly found out that Karmic does not like to be on an extended partition for some reason.

 

I cant confirm this, I got Karmic installed to a logical partition with grub2 installed onto it, and it boots and works just fine from there, it shows up in pcefi 10.5, never tried to boot it from there though as I use BootIt NextGen to multiboot but I cant see why it would not work.

Link to comment
Share on other sites

  • 1 month later...
And could you maybe give an example of how that would look?

 

Been trying with this but can not get it to work. I have saved the MBR from the working USB-stick to /boot/chameleon.mbr and I have added this in grub.config:

 

menuentry "MacOS X, chameleon" {
		  set root=(hd0,2)
		  chainloader (hd0,6)/boot/chameleon.mbr +1
  }

 

hd0,2 is the SnowLeo partition and hd0,6 is my Ubuntu-partition. I end up at a black screen with the text:

 

y-MORE--

 

yo - here is grub.cfg for leopard 10.5.7 - this should give you the way to go for snow leopard - no uuid's neccessary and I'll show you my insmod loaded before the menuentries--

i won't ditch chameleon, it very intelligently detects all partitions on an sd that have a boot loader - try to use multiboot as per below

 


...

insmod linux

insmod terminal

insmod boot

insmod 915resolution

insmod video

insmod jpeg

915resolution 34 1366 768

set gfxmode=1366x768

...

menuentry "**********XxX********** Leopard (/dev/sda1)" {

set root=(hd0,1)

multiboot (hd0,1)/boot

}

[code]

 

Works flawlessly for me, I had to mod the resolution to get my native.

 

cheers

-TheFugitive

EDIT: This works for the grub-1.96 package on 32bit. Am currently working on a 915resolution to grub-1.98 64bit. And then next week, will be working on grub-1.98 resolution for SnowLeopard 10.6.3 - Hope that helped

Link to comment
Share on other sites

I have it set up the same way as drbrando007, except I made a script in the Grub config directory, so every time Ubuntu updates the kernel and the Grub entries, the Chameleon option remains.

 

I made a script as /etc/grub.d/11-OSX86

 

#!/bin/sh
 exec tail -n +3 $0
echo "Adding Chameleon Entry..." >&2
 menuentry "Chameleon" {
	  set root=(hd0,0)			   <-------------Your partition number.
	  multiboot (hd0,0)/boot	   <-------------Your partition number.
 }

 

and made it executable

 

sudo chmod a+x /etc/grub.d/11-OSX86

Link to comment
Share on other sites

I've been playing around with the GRUB2 boot loader a bit recently, and I've run across some interesting references. To summarize what I've found, it's possible to use GRUB2 as the only boot loader to boot both Linux and OS X. That is, there's no need for PC-EFI, Chameleon, Boot Think, etc. GRUB2 will also boot Windows, although it does need the help of the 2nd-stage Windows boot loader (BCD, I believe it's called). The end result is one menu for all your OSes. This configuration also reduces the chances of problems from one boot loader overwriting another one's files.

 

So, let's back up a bit. GRUB2 is the next generation of the GRUB boot loader. (The original is now called "GRUB Legacy.") GRUB2 is still officially in beta, but I've been using it on my multi-boot laptop for a while (currently SUSE Linux 11.0, OS X 10.5.6, and Windows 7 RC). GRUB2 is designed to be more modular than GRUB Legacy, it's multi-platform, and it's got various other enhancements. Two of these are limited EFI emulation support and support for loading XNU kernels.

 

I'm going to assume in the following that you know a bit about Linux, software compilation, and GRUB or GRUB2 installation and configuration. If you don't, try Googling on these topics to find some tutorials.

 

My initial tests, using a GRUB2 RPM intended for Fedora 10 systems, were less than successful. To get OS X booting, I had to download the grub-1.97~beta3.tar.gz source code tarball from the GRUB Web site and compile it locally. (I compiled under Linux. A quick attempt under OS X failed, but it's conceivable this problem could be overcome.)

 

If you're familiar with GRUB but not GRUB2, you should be aware that the configuration file name and syntax have changed. The new filename is /boot/grub/grub.cfg. Some of the configuration file changes will be obvious below, but note that GRUB2 numbers partitions differently. What was (hd0,0) in GRUB Legacy is (hd0,1) in GRUB2, with corresponding changes to other partition numbers. Below are the three entries I'm using to boot Linux, Windows, and Mac OS X:

 

menuentry "openSUSE 11.0 - 2.6.25.20-0.5" {
 set root=(hd0,3)
 linux /boot/vmlinuz-2.6.25.20-0.5-default root=/dev/sda3 showopts
 initrd /boot/initrd-2.6.25.20-0.5-default
}

menuentry "Windows 7 RC" {
 set root=(hd0,7)
 chainloader +1
}

menuentry "Mac OS X" {
 set root=(hd0,6)
 insmod video
 insmod vbe
 gfxmode="1280x800x32"
 xnu_kernel /mach_kernel rd=disk0s6
 if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
	xnu_mkext /System/Library/Extensions.mkext
 else
	xnu_kextdir /System/Library/Extensions
 fi
}

 

If you try something similar, pay careful attention to system-specific items, such as the disk and partition identifiers and the video mode. After setting this up, typing "/usr/local/sbin/grub-install /dev/sda" installed it for me, including copying a boatload of files to the /boot/grub directory. The explicit path to /usr/local/sbin ensures that I installed my locally-compiled GRUB2 rather than the distribution's standard GRUB. The new files in /boot/grub hold the modular GRUB2 components, such as filesystem drivers, the EFI emulation code, etc.

 

A few random comments:

 

  • The system boots in verbose mode, similar to passing the "-v" parameter via Chameleon or some other traditional OSx86 boot loader. I haven't yet figured out if it's possible to get a more GUI boot out of GRUB2.
  • My test system is running a Voodoo kernel. I know of no reason other kernels wouldn't work, but I've also not tested them.
  • My system has a hybrid MBR, which GRUB sees as GPT. I haven't tried this on an MBR-only system. I have no reason to think it wouldn't work, but I thought I'd point out this detail.
  • On GPT disks, GRUB2 likes to have a small (a few tens or hundreds of KB) partition of type "BIOS boot partition" in which it can install its second-stage boot loader. It will work without this partition, but such a partition is recommended.
  • I haven't yet investigated ways to pass additional parameters to the system (-f, -x, etc.).
  • GRUB2 allows you to edit its entries on the fly, so you can make boot-time changes. IIRC, you press the 'e' key when the menu comes up and you can edit the menu item.
  • I've reconfigured my system to use an HFS+ /boot partition (in Linux) so that I can edit the grub.cfg file in either OS. This seems fine so far, but it's only been set up this way for a short time. FAT might also work, but my experience is that some GRUB and GRUB2 configurations rely on symbolic links, which aren't supported in FAT. Oddly, the OS X Disk Utility deleted my EFI System partition and reverted my hybrid MBR to a plain GPT setup when I used it to format the /boot partition. Both problems were easily rectified, but annoying.
  • GRUB2 is not yet common on emergency disks. GRUB-2 includes a grub-mkrescue command that I believe creates emergency boot disks (USB flash drives, CD-ROMs, etc.), but I've not yet tested this.
  • So far I've tested this on only one system. I've got another multi-boot system with which I might test this configuration, but I haven't gotten around to it yet.

 

Overall, I wouldn't recommend that everybody ditch Chameleon, Boot Think, etc. in favor of GRUB2. It might be worth considering such a configuration if you dual-boot with Linux or some other OS that relies upon GRUB or GRUB2, though. This will give you one boot loader configuration file and a reduced risk of problems from one boot loader stepping on another's feet, as it were. If possible, I recommend keeping a second boot path option available -- in other words, a GRUB2 option to boot via Chameleon, Boot Think, PC-EFI, or whatever. This might be handy if GRUB2 suddenly stops liking your XNU kernel or something.

 

Will above method work for iAtkos_v7 ?

Link to comment
Share on other sites

  • 2 weeks later...

Sorry guys...I am new and my English is very poor. I am trying to understand how to solve some issue with grub 2. This is my problem

 

I followed various forums in order to have 3 different OS on my old Pentium 4.

Jas 10.4.8 works fine. Then I installed XP on a different primary partition. The same with Ubuntu 9.10.

 

When rebooting I can chose from Grub 2 which OS to use. XP works fine, Ubuntu fine BUT when I chose Mac Os X I just get some strange commands line....and I cant boot

 

panic(cpu 0 caller 0x001a3129) unresolved kernel, trap (CPU, type 14 page fault)

 

and so on......

 

what is wrong...

 

sorry but I am really new and sorry for my english, but your hel will be really appreciate

 

Sorry guys...I am new and my English is very poor. I am trying to understand how to solve some issue with grub 2. This is my problem

 

I followed various forums in order to have 3 different OS on my old Pentium 4.

Jas 10.4.8 works fine. Then I installed XP on a different primary partition. The same with Ubuntu 9.10.

 

When rebooting I can chose from Grub 2 which OS to use. XP works fine, Ubuntu fine BUT when I chose Mac Os X I just get some strange commands line....and I cant boot

 

panic(cpu 0 caller 0x001a3129) unresolved kernel, trap (CPU, type 14 page fault)

 

and so on......

 

what is wrong...

 

sorry but I am really new and sorry for my english, but your hel will be really appreciate

 

#

# DO NOT EDIT THIS FILE

#

# It is automatically generated by /usr/sbin/grub-mkconfig using templates

# from /etc/grub.d and settings from /etc/default/grub

#

 

### BEGIN /etc/grub.d/00_header ###

if [ -s /boot/grub/grubenv ]; then

have_grubenv=true

load_env

fi

set default="5"

if [ ${prev_saved_entry} ]; then

saved_entry=${prev_saved_entry}

save_env saved_entry

prev_saved_entry=

save_env prev_saved_entry

fi

insmod ext2

set root=(hd0,5)

search --no-floppy --fs-uuid --set 7a59e598-8f7d-49ac-beee-84e805090ec0

if loadfont /usr/share/grub/unicode.pf2 ; then

set gfxmode=640x480

insmod gfxterm

insmod vbe

if terminal_output gfxterm ; then true ; else

# For backward compatibility with versions of terminal.mod that don't

# understand terminal_output

terminal gfxterm

fi

fi

if [ ${recordfail} = 1 ]; then

set timeout=-1

else

set timeout=20

fi

### END /etc/grub.d/00_header ###

 

### BEGIN /etc/grub.d/05_debian_theme ###

set menu_color_normal=white/black

set menu_color_highlight=black/white

### END /etc/grub.d/05_debian_theme ###

 

### BEGIN /etc/grub.d/10_linux ###

menuentry "Ubuntu, Linux 2.6.31-14-generic" {

recordfail=1

if [ -n ${have_grubenv} ]; then save_env recordfail; fi

set quiet=1

insmod ext2

set root=(hd0,5)

search --no-floppy --fs-uuid --set 7a59e598-8f7d-49ac-beee-84e805090ec0

linux /boot/vmlinuz-2.6.31-14-generic root=UUID=7a59e598-8f7d-49ac-beee-84e805090ec0 ro splash quiet splash

initrd /boot/initrd.img-2.6.31-14-generic

}

menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {

recordfail=1

if [ -n ${have_grubenv} ]; then save_env recordfail; fi

insmod ext2

set root=(hd0,5)

search --no-floppy --fs-uuid --set 7a59e598-8f7d-49ac-beee-84e805090ec0

linux /boot/vmlinuz-2.6.31-14-generic root=UUID=7a59e598-8f7d-49ac-beee-84e805090ec0 ro single splash

initrd /boot/initrd.img-2.6.31-14-generic

}

### END /etc/grub.d/10_linux ###

 

### BEGIN /etc/grub.d/20_memtest86+ ###

menuentry "Memory test (memtest86+)" {

linux16 /boot/memtest86+.bin

}

menuentry "Memory test (memtest86+, serial console 115200)" {

linux16 /boot/memtest86+.bin console=ttyS0,115200n8

}

### END /etc/grub.d/20_memtest86+ ###

 

### BEGIN /etc/grub.d/30_os-prober ###

menuentry "Mac OS X (on /dev/sda1)" {

insmod hfsplus

set root=(hd0,1)

search --no-floppy --fs-uuid --set d8d3935e73aae5d9

insmod vbe

do_resume=0

if [ /var/vm/sleepimage -nt10 / ]; then

if xnu_resume /var/vm/sleepimage; then

do_resume=1

fi

fi

if [ $do_resume == 0 ]; then

xnu_uuid d8d3935e73aae5d9 uuid

if [ -f /Extra/DSDT.aml ]; then

acpi -e /Extra/DSDT.aml

fi

xnu_kernel /mach_kernel boot-uuid=${uuid} rd=*uuid

if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then

xnu_mkext /System/Library/Extensions.mkext

else

xnu_kextdir /System/Library/Extensions

fi

if [ -f /Extra/Extensions.mkext ]; then

xnu_mkext /Extra/Extensions.mkext

fi

if [ -d /Extra/Extensions ]; then

xnu_kextdir /Extra/Extensions

fi

if [ -f /Extra/devtree.txt ]; then

xnu_devtree /Extra/devtree.txt

fi

if [ -f /Extra/splash.jpg ]; then

insmod jpeg

xnu_splash /Extra/splash.jpg

fi

if [ -f /Extra/splash.png ]; then

insmod png

xnu_splash /Extra/splash.png

fi

if [ -f /Extra/splash.tga ]; then

insmod tga

xnu_splash /Extra/splash.tga

fi

fi

}

menuentry "Windows XP Media Center Edition (on /dev/sda2)" {

insmod ntfs

set root=(hd0,2)

search --no-floppy --fs-uuid --set 59ab94f45db861f0

drivemap -s (hd0) ${root}

chainloader +1

}

### END /etc/grub.d/30_os-prober ###

 

### BEGIN /etc/grub.d/40_custom ###

# This file provides an easy way to add custom menu entries. Simply type the

# menu entries you want to add after this comment. Be careful not to change

# the 'exec tail' line above.

### END /etc/grub.d/40_custom ###

Link to comment
Share on other sites

  • 2 weeks later...
Sorry guys...I am new and my English is very poor. I am trying to understand how to solve some issue with grub 2. This is my problem

 

I followed various forums in order to have 3 different OS on my old Pentium 4.

Jas 10.4.8 works fine. Then I installed XP on a different primary partition. The same with Ubuntu 9.10.

 

When rebooting I can chose from Grub 2 which OS to use. XP works fine, Ubuntu fine BUT when I chose Mac Os X I just get some strange commands line....and I cant boot

 

panic(cpu 0 caller 0x001a3129) unresolved kernel, trap (CPU, type 14 page fault)

 

and so on......

 

If you have Chameleon installed to your OS X partition, you can load it via Grub 2 by doing the following:

 

1. Boot into Ubuntu, open a terminal and type:

sudo gedit /etc/grub.d/40_custom

 

Then use one of the following entries to put into this file and save the file (credit goes to thorazine74's post from this thread)

 

menuentry "Mac OS X Chameleon" {
        insmod hfsplus
        search --file --set=root /boot
        multiboot /boot
}

 

or

 

menuentry "Mac OS X Chameleon" {
        insmod hfsplus
        set root=(hd0,X)
        multiboot /boot
}

 

where X in (hd0,X) is the partition number; in your case, X = 1

The title between the " " above can be anything; it doesn't have to be Mac OS X Chameleon.

 

2. After saving the 40_custom file and closing it, at the terminal type:

sudo update-grub

This will update the grub.cfg file.

 

Now reboot and you should see the custom entry you made in Grub 2 and it should boot to Chameleon and you can then boot OS X. This works with Chameleon 2.0 RC3 and RC4; I don't know if it works with older Chameleon versions. You can update to these Chameleon versions if necessary.

Link to comment
Share on other sites

Hi all,

 

I have read all your topics and if i have well understanded (i'm french...), you can't launch mac os x with grub2 without have chameleon install on your computer, isn't it ?

 

I have installed iATKOS_v7 on my pc, but before installation, i have unchecked the chameleon boot loader (for use grub2). So, i can't use your methods for boot chamelon with grub2. I have to install chameleon (still if i have all well understanded), but how do that without erase my grub2 ??

 

Hope you will understand me,

vivelapsp

Link to comment
Share on other sites

<br />Hi all,<br /><br />I have read all your topics and if i have well understanded (i'm french...), you can't launch mac os x with grub2 without have chameleon install on your computer, isn't it ?<br /><br />I have installed iATKOS_v7 on my pc, but before installation, i have unchecked the chameleon boot loader (for use grub2). So, i can't use your methods for boot chamelon with grub2. I have to install chameleon (still if i have all well understanded), but how do that without erase my grub2 ??<br /><br />Hope you will understand me,<br />vivelapsp<br /><br />

 

You CAN use grub2 WITHOUT Chameleon.

Just follow 1st post.

Install grub2 or update grub2 it should find the osx install.

On your linux-Partition: In your /boot/grub/grub.cfg - file replace the uuid stuff with your actual partition!

Example:

xnu_kernel64 /mach_kernel boot-uuid=${uuid} rd=*uuid

replace:

rd=... with: rd=disk0s1 (s1 for sda1)

 

then grub2 will boot, I think.

Link to comment
Share on other sites

some success here -- I'm expecting a Mini 9 from the UPS soon, and I want a dual boot w/o the Chameleon thing if possible (discrete, inconspicuous, etc) so I'm experimenting on my GA-EP45-UD3r and a spare HD to see what might be possible (if anything).

 

I'm using a 32 bit Ubuntu minimal install CD (like 12 mb or something), then building it up manually -- with Windowmaker, gdm, and some basic stuff -- Firefox, Opera, Chrome, Open Office, Xmms2 w/ Promoe or something, VLC, mplayer, etc... I'm looking at a Linux install of -- well, I'm going to try to reserve 2.5 gigs including swap -- my Linux build is up to 1.8 Gigs of hard drive utilization or so and is only bound to grow as I continue to add a little bit of stuff here and there -- but it's really only mostly for show so I don't really need the space I just want to have the dual boot so that I'm not showing off the OS X all the time -- plus the hfsplus package gives me read/write on the hfs+ partition anyway -- so maybe 2.25 gigs + 250megs swap or something? -- for my roll-your-own Ubuntu, the rest of the 16GB SSD will go to OS X.

 

So here's what my weekend of experimentation has taught me. GRUB2 (technically 1.97 beta 4 in Ubuntu 9.10 karmic) does in fact boot the hfs+ partition w/o the apple logo. But can I do it with the GUID partition? MBR is no problem, BTW, but you might need an iPC or something along those lines, retail seems to be easier with the GUID, so I'd rather do retail with GUID. That's the plan, anyway.

 

I install Leopard (not Snow) with a GUID partition table -- basically, fire up the install method, plop in the install disk, and when it comes to interrupting the process to go to Disk Utility, I "partition" with 3 partitions -- one for the Linux, one for the swap, and one for the hfs+. I left the swap and Linux parts (the hfs+ is the tail end of the disk) as empty space. Install as normal, options says GUID, name the one partition whatever, install to it when you exit out of Disk Utility.

 

Install proceeds as normal, reboot, registration screen, etc. I install Chameleon, and it works just fine, all I need now is kexts for the sound card and maybe another thing or two. Worry about that later.

 

So I reboot and it's working on its own, I plop in the Ubuntu minimal install CD, and reboot. If you're not familiar with the "cli" -- command line install, well, anyway, I've used Linux for about a decade, that's another post for another time.

 

I partition manually, and there's all these partitions (like 6 of them or something, a few small GUID ones or whatever). I leave the hfs+ partition and a 130 something megabyte partition on the far side of (end of the disk) that says empty space, but I delete everything else in front of it, leaving the swap. Now I have empty space, swap, and hfs+, and a 130 something megabyte partition on the other side of the hfs+ which I just left there (think it said empty space). I re-create the Linux (I chose xfs) partition, make it bootable, leaving the swap intact. Now the xfs partition is #1, the hfs+ partition is #2, and the swap is partition #4 (I deleted a EFI partition in there somewhere). Just leave the hfs+ intact -- it's the only thing I left intact -- and don't worry -- GRUB2 will boot it up for you, right?

 

Now the one thing -- I delete the swap 'cause it's #4 and not #3, recreate the swap, and now it's partition #3.

 

Then I install Ubuntu -- it's a quick process, it downloads the basic system (about 10-15 mins) and asks you time zones and things like that. Where it kept failing for me was on the GRUB install -- the command line interfaces asks you to specify where you want to install GRUB, and I used GRUB terminology -- (hd0), then I tried (hd0,1), etc... to no avail. But the installer also lets you use the /dev thing, so I tried specifying /dev/sda and it worked! Or was that /dev/sda1 -- I don't remember 100% -- I was trying all sorts of things over and over (I'm pretty sure it was /dev/sda though) Installed grub2 to /dev/sda and completed the Linux install process -- reboot, and voila -- there it is -- Grub's menu says "Mac OS X (on /dev/sda2)" as a selection, select it and I'm in. No messing with the menu.lst, it's automatically detected.

 

So that's it -- use a distro that uses Grub2, and at least with Ubuntu's command line installer (which is actually quite a cinch if you asked me) specify the "dev/sdx" format, not the (hdx,x) grub format on the command line install when it asks you towards the end, and when you partition near the start of the process, basically delete all the partitions except the hfs+ -- clean that disk up -- keep the one OS X partition, non-blessed, perhaps, and GRUB should detect it, list it, and boot it up for you. Of course, YMMV.

 

URL's that were important to me throughout this whole process:

 

Ubuntu minimal install: https://help.ubuntu.com/community/Installation/MinimalCD

 

Install on Low Memory Systems (may be relevant, may by not): https://help.ubuntu.com/community/Installat...owMemorySystems

 

Grub2 Title Tweaks: http://ubuntuforums.org/showthread.php?t=1287602

 

Anyway, it's working now on my Gigabyte board. Disk utility still says GUID Partition table, I'm assuming that Chameleon is gone or inaccessible -- I don't think it's actually possible to get to it at all even if it isn't gone, it would probably would need to be reinstalled and GRUB removed or something, but I'd rather have grub in this particular instance anyway, which was the whole point of this exercise for me -- doing it with grub.

 

Anyway, will have to wait and see if it works on the Mini 9, but it works just 100% great on the Gigabyte board, flawlessly. If only it was my main computer and not a testbed I'd be totally psyched.

Link to comment
Share on other sites

I install Leopard (not Snow) with a GUID partition table -- basically, fire up the install method, plop in the install disk, and when it comes to interrupting the process to go to Disk Utility, I "partition" with 3 partitions -- one for the Linux, one for the swap, and one for the hfs+.

 

One comment: With GRUB2 on GPT, you're best off creating a small (~100KB, yes *K*) BIOS Boot Partition. This partition holds some GRUB2 code; if it's absent, GRUB2 uses sector block lists to point to files on a regular filesystem, but that approach is less reliable than setting aside a BIOS Boot Partition. I don't believe that Apple's Disk Utility can create this type of partition, but both GNU Parted and GPT fdisk can. If you use these tools, though, you're advised to follow Apple's GPT partitioning recommendations; Disk Utility does this automatically, but most other tools don't. The issue of the space between partitions is the most important one; OS X 10.6 won't install unless it sees that space around its target partition. Currently, the EFI System partition is unused on most Hackintoshes, although I believe Boot Think uses it. It might be used in the future, so I'd recommend keeping it.

 

I partition manually, and there's all these partitions (like 6 of them or something, a few small GUID ones or whatever). I leave the hfs+ partition and a 130 something megabyte partition on the far side of (end of the disk) that says empty space, but I delete everything else in front of it, leaving the swap.

 

The Ubuntu installer is probably setting up separate partitions for various parts of itself. On such a tiny install, this is inadvisable. It might be setting up a BIOS Boot Partition and/or an EFI System Partition, too. (Actually, Disk Utility sets up an EFI System Partition, but doesn't tell you about it.) You could of course prepare the partitions beforehand using GNU Parted or GPT fdisk.

 

I re-create the Linux (I chose xfs) partition,

 

Why XFS? Its strength is handling big files, and on such a tiny installation, you won't be using big files. You'll probably get better performance from ext3fs, ext4fs, or ReiserFS.

 

Installed grub2 to /dev/sda and completed the Linux install process -- reboot, and voila -- there it is -- Grub's menu says "Mac OS X (on /dev/sda2)" as a selection, select it and I'm in. No messing with the menu.lst, it's automatically detected.

 

Are you saying that you didn't see any hint of Chameleon prompts when you selected OS X in GRUB? If so, then the default configuration in Ubuntu 9.10 must be akin to the one I described in the first post of this thread. It's also possible to boot indirectly, via Chameleon. That method appears to be more reliable at the moment, although it's vulnerable to certain types of damage that wouldn't affect a direct-load from GRUB.

Link to comment
Share on other sites

Thanks, srs5694. That's some awesome advice.

 

It works. It is "-v", though. First, I tried to change the OSInstall.mpkg to allow installation to an MBR. I already had Ubuntu installed at that point, but it changed my MBR to a GPT, and I couldn't boot into Linux or OS X at that point.

 

So I reinstalled Linux and moved some partitions around.

 

The final setup I chose was this -- starting from the head of the disk:

 

14.8 KB Free Space (OS X put that there, I left it)

128 KB reserved BIOS boot partition (technically partition #4)

Space for Ubuntu (I settled on JFS) -- (partition #1)

Swap -- (partition #2)

128MB Free Space

OS X (hfs+) -- (partition #3)

2.1MB Free Space (OS X also put this here -- as I've learned, it's definitely a good idea)

 

Probably could have put the 128MB sectors in there between each partition, as well as the 200MB one up front, but I'm dealing with a 16GB SSD, so I just put the free space in front of the OS X partition. I just didn't have the room, because I sized the hfs+ partition counting on an MBR and I didn't feel like messing with it, and my swap was already down to 512MB. If I had to do it all over again, I'd probably put all of those things in. Hopefully, it'll be OK.

 

The free space in back and the BIOS boot partition seem like the most important things.

 

I used the Ubuntu 9.10 minimal install, with the expert install option from the menu, and everything proceeded as normal, I chose GRUB 2 when it asked me, and specified "/dev/sda" when it asked me where to install GRUB.

 

I was happy to see that the partitioner it uses had an entry for the type of partition used for the BIOS boot partition.

 

But it does boot up in a verbose mode, though -- some people may want the grey Apple screen with the spinning logo, but OTOH, for some reason, that screen actually makes me kind of nervous because I don't know what's going on.

 

Thanks again for that awesome advice, this really helped clear things up for me. Couldn't have done it without you.

 

BTW I used the Netbookmaker 0.8.3 on a Retail copy, FWIW.

 

So what I'd do to tweak it in the future is plan on a GPT and calculate the partition sizes accordingly so all of the recommendations can be adhered to, and I would also install OS X first, then Linux. Maybe partition the Linux areas in OS X at first, leave them as free space, then fine-tune the partitions once I'm in Ubuntu -- that's a fairly nice helpful, accurate partitioner they have there.

Link to comment
Share on other sites

  • 4 weeks later...

I tried all possible combinaisons and it's not working...

I got chamelon installed on the first partition of my second hardrive, ubuntu see it as sdb2, i mounted it under ubuntu, I got a /boot file, but i tested set root=(hd1,1), (hd1,2), hd1,3... multiboot, chainloader +1/+1 and it never work...

Anyone got an idea ? thanks

 

haha it worked with jsut this:

 

menuentry "osx" {

set root=(hd1,1)

exit

}

 

chameleon load

Link to comment
Share on other sites

  • 4 weeks later...

menuentry "Mac OS X (32-bit) (on /dev/sda2)" {
	insmod hfsplus   
	set root='(hd0,2)'
	search --no-floppy --fs-uuid --set 196bcb9970cacb3a
	insmod vbe
	set do_resume=0 
	if [ /var/vm/sleepimage -nt10 / ]; then
	   if xnu_resume /var/vm/sleepimage; then
		 set do_resume=1
	   fi
	fi
	if [ $do_resume == 0 ]; then
	   xnu_uuid 196bcb9970cacb3a uuid
	   if [ -f /Extra/DSDT.aml ]; then
		  acpi -e /Extra/DSDT.aml
	   fi
	   xnu_kernel /mach_kernel boot-uuid=${uuid} rd=*uuid
	   if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
		  xnu_mkext /System/Library/Extensions.mkext
	   else
		  xnu_kextdir /System/Library/Extensions
	   fi
	   if [ -f /Extra/Extensions.mkext ]; then
		  xnu_mkext /Extra/Extensions.mkext
	   fi
	   if [ -d /Extra/Extensions ]; then
		  xnu_kextdir /Extra/Extensions
	   fi
	   if [ -f /Extra/devprop.bin ]; then
		  xnu_devprop_load /Extra/devprop.bin
	   fi
	   if [ -f /Extra/splash.jpg ]; then
		  insmod jpeg
		  xnu_splash /Extra/splash.jpg
	   fi
	   if [ -f /Extra/splash.png ]; then
		  insmod png
		  xnu_splash /Extra/splash.png
	   fi
	   if [ -f /Extra/splash.tga ]; then
		  insmod tga
		  xnu_splash /Extra/splash.tga
	   fi
	fi
}

 

I just recently upgrade my Ubuntu to 10.04 and now my grub2 allow me to boot my Mac WITHOUT darwin. But somehow there is no display on my laptop, but there is output for my external monitor. WEIRD... anyone know y

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

I have tried to read this topic and find a solution to my problem with with grub2 multiboot. I currently have 3 hdd and 3 operating systems: win7, ubuntu 9.10 x64 and osx. Actually I got 4 os because I got both Snow Leopard and Leopard through Chameleon R4 bootloader. SL is vanilla version with right E/E and S/L/E installed after iAtkos7 Leopard.

 

Here my fdisk -l list where you can see what hdd's I got.

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7c155af2

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      102400    7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2              13        6494    52058112    7  HPFS/NTFS
/dev/sda3            6494       12996    52224000    7  HPFS/NTFS
/dev/sda4           12996       60802   383998976    7  HPFS/NTFS

Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000baf86

  Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            9135       30402   170825319   af  HFS / HFS+
/dev/sdb2   *           1        8892    71418880   83  Linux
/dev/sdb3            8892        9135     1951744+   5  Extended
/dev/sdb5            8892        9135     1951744   82  Linux swap / Solaris

Partition table entries are not in disk order

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc223d2ae

  Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1          26      204819+  ee  GPT
/dev/sdc2              26       30427   244193292   af  HFS / HFS+
/dev/sdc3   *       30443       60785   243726308   af  HFS / HFS+

Like you can see I got Windows 7 (sda2) and all ntfs other ntfs partitions in first sda/hd0 disk.

In second disk sdb/hd1 I got Timemachine BU-disk (sdb1) and Ubuntu (sdb2) and swap.

Third disk sdc/hd2 got SnowLeopard 10.6.3 (sdc2) and Leopard (sdc3).

 

I can boot to Win7 and Ubuntu through grub easily but not to osx. :) If I change that sdc/hd2 as first boot disk I am able to boot up Win7 and both of osx through Chameleon bootloader.

 

Now I want to get my grub to work as only bootloader because it seems to be "the easiest" way to get multiboot work. Chameleon is not an option because sleep ain't working with win7 when I start it through Chameleon.

 

Here is my /boot/grub/grub.cfg and like you can see it is generated automatically. I tried to add couple osx entries manually without success.

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
 have_grubenv=true
 load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
 saved_entry=${prev_saved_entry}
 save_env saved_entry
 prev_saved_entry=
 save_env prev_saved_entry
fi
insmod ext2
set root=(hd1,2)
search --no-floppy --fs-uuid --set c8bb670b-35e3-493c-bde8-9f9555942b61
if loadfont /usr/share/grub/unicode.pf2 ; then
 set gfxmode=640x480
 insmod gfxterm
 insmod vbe
 if terminal_output gfxterm ; then true ; else
   # For backward compatibility with versions of terminal.mod that don't
   # understand terminal_output
   terminal gfxterm
 fi
fi
if [ ${recordfail} = 1 ]; then
 set timeout=-1
else
 set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set a6fa52fbfa52c769
chainloader +1
}
menuentry "Mac OS X (on /dev/sdc2)" {
insmod hfsplus
set root=(hd2,2)
search --no-floppy --fs-uuid --set 18294667071f4c98
       insmod vbe
       do_resume=0
       if [ /var/vm/sleepimage -nt10 / ]; then
          if xnu_resume /var/vm/sleepimage; then
            do_resume=1
          fi
       fi
       if [ $do_resume == 0 ]; then
          xnu_uuid 18294667071f4c98 uuid
          if [ -f /Extra/DSDT.aml ]; then
             acpi -e /Extra/DSDT.aml
          fi
          xnu_kernel /mach_kernel boot-uuid=${uuid} rd=*uuid
          if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
             xnu_mkext /System/Library/Extensions.mkext
          else
             xnu_kextdir /System/Library/Extensions
          fi
          if [ -f /Extra/Extensions.mkext ]; then
             xnu_mkext /Extra/Extensions.mkext
          fi
          if [ -d /Extra/Extensions ]; then
             xnu_kextdir /Extra/Extensions
          fi
          if [ -f /Extra/devtree.txt ]; then
             xnu_devtree /Extra/devtree.txt
          fi
          if [ -f /Extra/splash.jpg ]; then
             insmod jpeg
             xnu_splash /Extra/splash.jpg
          fi
          if [ -f /Extra/splash.png ]; then
             insmod png
             xnu_splash /Extra/splash.png
          fi
          if [ -f /Extra/splash.tga ]; then
             insmod tga
             xnu_splash /Extra/splash.tga
          fi
       fi
}
menuentry "Mac OS X (on /dev/sdc3)" {
insmod hfsplus
set root=(hd2,3)
search --no-floppy --fs-uuid --set 11f705d93d3c7cac
       insmod vbe
       do_resume=0
       if [ /var/vm/sleepimage -nt10 / ]; then
          if xnu_resume /var/vm/sleepimage; then
            do_resume=1
          fi
       fi
       if [ $do_resume == 0 ]; then
          xnu_uuid 11f705d93d3c7cac uuid
          if [ -f /Extra/DSDT.aml ]; then
             acpi -e /Extra/DSDT.aml
          fi
          xnu_kernel /mach_kernel boot-uuid=${uuid} rd=*uuid
          if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
             xnu_mkext /System/Library/Extensions.mkext
          else
             xnu_kextdir /System/Library/Extensions
          fi
          if [ -f /Extra/Extensions.mkext ]; then
             xnu_mkext /Extra/Extensions.mkext
          fi
          if [ -d /Extra/Extensions ]; then
             xnu_kextdir /Extra/Extensions
          fi
          if [ -f /Extra/devtree.txt ]; then
             xnu_devtree /Extra/devtree.txt
          fi
          if [ -f /Extra/splash.jpg ]; then
             insmod jpeg
             xnu_splash /Extra/splash.jpg
          fi
          if [ -f /Extra/splash.png ]; then
             insmod png
             xnu_splash /Extra/splash.png
          fi
          if [ -f /Extra/splash.tga ]; then
             insmod tga
             xnu_splash /Extra/splash.tga
          fi
       fi
}
### END /etc/grub.d/10_os-prober ###

### BEGIN /etc/grub.d/11_linux ###
menuentry "Ubuntu, Linux 2.6.31-20-generic" {
       recordfail=1
       if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,2)
search --no-floppy --fs-uuid --set c8bb670b-35e3-493c-bde8-9f9555942b61
linux	/boot/vmlinuz-2.6.31-20-generic root=UUID=c8bb670b-35e3-493c-bde8-9f9555942b61 ro   quiet splash
initrd	/boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
       recordfail=1
       if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,2)
search --no-floppy --fs-uuid --set c8bb670b-35e3-493c-bde8-9f9555942b61
linux	/boot/vmlinuz-2.6.31-20-generic root=UUID=c8bb670b-35e3-493c-bde8-9f9555942b61 ro single 
initrd	/boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
       recordfail=1
       if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd1,2)
search --no-floppy --fs-uuid --set c8bb670b-35e3-493c-bde8-9f9555942b61
linux	/boot/vmlinuz-2.6.31-14-generic root=UUID=c8bb670b-35e3-493c-bde8-9f9555942b61 ro   quiet splash
initrd	/boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
       recordfail=1
       if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd1,2)
search --no-floppy --fs-uuid --set c8bb670b-35e3-493c-bde8-9f9555942b61
linux	/boot/vmlinuz-2.6.31-14-generic root=UUID=c8bb670b-35e3-493c-bde8-9f9555942b61 ro single 
initrd	/boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/11_linux ###

### BEGIN /etc/grub.d/12_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "Chameleon1" {
set root=(hd2,1)
exit
}

menuentry "Chameleon2" {
set root=(hd2,1)
multiboot (hd2,1)/boot
}

menuentry "Mac OS X Chameleon" {
insmod hfsplus
search --file --set=root /boot
multiboot /boot
}

menuentry "Mac OS X Chameleon" {
insmod hfsplus
set root=(hd2,2)
multiboot /boot
}

menuentry "MacOS X, chameleon, multi" {
        insmod hfsplus
        set root=(hd2,2)
        multiboot /boot
}

menuentry "MacOS X, chameleon" {
        insmod hfsplus
        search --file --set=root /boot
        multiboot /boot
}

menuentry "MacOSX" {
 insmod hfsplus
 # Set the root device for Mac OS X's loader.
 set root=(hd2,2)
 # Load the loader.
 chainloader /usr/standalone/i386/boot.efi
}

menuentry "MacOSX" {
 insmod hfsplus
 # Search the root device for Mac OS X's loader.
 search --set /usr/standalone/i386/boot.efi
 # Load the loader.
 chainloader /usr/standalone/i386/boot.efi
}
### END /etc/grub.d/12_custom ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16	/boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16	/boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

 

Long story but really hoping that someone could give me answer how to get my grub working like real multibootloader should!

 

Please help me,

-samp0

Link to comment
Share on other sites

Yeah it took me a while to figure this one out. You need to edit /etc/grub.d/40_custom, then type "update-grub" and it will be added to the end of the file automatically.
Sry that grub.cfg was old one where my custom entries were missing. I edited my earlier post with my current grub.cfg. Like you can see I got several different entries but none is working. :)

Maybe the problem is in my partition table(hd2 is gpt) or in something else which I don't get...

Link to comment
Share on other sites

I just thought I'd chime in with my success story. I'm still using 10.5.x on a Dell XPS 1340 laptop, and the HD is GPT partitioned. I installed the Ubuntu Lucid beta with GRUB2, overwriting my Chameleon install. It automatically populated the menu with entries for OSX, and it boots perfectly, video and all. It uses my DSDT file, and loads kexts in /Extra with no additional configuration.

Link to comment
Share on other sites

  • 1 month later...

Hey guys, new here. I actually just started using Ubuntu about a week ago and I'm learning a whole bunch of new stuff. I quickly got accustomed to Grub 2 and how to edit the menus, etc. I decided I wanted to try and do an OSx86 triple boot between Ubuntu, OS X, and Win 7. After several tries I managed to get everything working except for OS X. I stumbled across this thread after a google search and I have to say that first post really helped me out. So far it seems like I actually have less trouble booting into OS X than I did before. For some reason when I boot via Grub 2 it will actually shutdown and restart OS X correctly as well. I don't know if you guys figured it out or not, but I noticed that you can have Grub 2 load it with commands such as -x, -v, and -f.

 

I just have it set like this:

 

menuentry "MacOS X (32-bit)" {

set root='(hd0,4)'

insmod video

insmod vbe

gfxmode="1440x900x32"

xnu_kernel /mach_kernel rd=disk0s4 -v -f

if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then

xnu_mkext /System/Library/Extensions.mkext

else

xnu_kextdir /System/Library/Extensions

fi

}

 

I had tested it by just throwing -x in there and it booted up in safe mode no problem. Or leave it and just hit the e key on that menu item in Grub 2 and add in whatever command you want it to boot with. Even if you guys have already come across this, I at least wanted to say thanks for the help!

Link to comment
Share on other sites

 Share

×
×
  • Create New...