PDA

View Full Version : Booting Linux from an external hard drive using Boot Camp and rEFIt?


lojo
30th August 2006, 05:11 AM
Hi - I've gotten Ubuntu installed onto a Linux partition on my external drive. There's also an HFS+ partition on the drive as well. I compiled the gptsync tool from rEFIt on OSX so I could give it a MBR table that matched my GPT table. When booted from the Live/Install CD, I ran grub and told it to install on the linux partition itself (NOT the main MBR table), in hopes that rEFIt will see it and allow me to boot from it. Well, rEFIt does indeed see it, but when I select it the screen goes black and it tries to boot XP that's on my internal disk.

Unless I'm mistaken, I MUST boot from the MBR table if I want accelerated drivers to work (meaning under Boot Camp), so using the EFI-patched GRUB won't cut it. Anyone know what I'm doing wrong?

Oh, I should add that I'm using an Intel-based Mac Mini - and the external disk is GPT format with an MBR table synced with it.

chrisp
1st September 2006, 02:43 PM
I compiled the gptsync tool from rEFIt on OSX so I could give it a MBR table that matched my GPT table.
If you did the syncing from within Mac OS X, please make sure that writing the new table was actually successful -- I've seen Mac OS X refuse the write call even with root rights. (Could be that's only on the current system disk, though.)

Well, rEFIt does indeed see it, but when I select it the screen goes black and it tries to boot XP that's on my internal disk.
I'm afraid the 0.7 release doesn't support legacy-booting from external disks. It has been fixed in the development tree and I hope to make a 0.8 release soon. In the meantime you can get an up-to-date refit.efi binary here: http://svn.sourceforge.net/viewvc/refit/trunk/dist/efi/refit/

Unless I'm mistaken, I MUST boot from the MBR table if I want accelerated drivers to work (meaning under Boot Camp), so using the EFI-patched GRUB won't cut it.
Correct, using the EFI-patched grub2 is equivalent to elilo, so there's no Video BIOS loaded.

lojo
2nd September 2006, 09:50 AM
Awesome, I'll give it a try, thanks! You've been very helpful :)

And yes, I did have a problem writing out the MBR table to the external disk at first. I don't remember what I did to fix it though. Perhaps I ran it with sudo. But I verified that it did indeed work since booting the Ubuntu liveCD and running "fdisk -l" on it worked fine.

Since I have your attention, is it the case that even though the official Apple boot selector sees my external partition, it will never work since Boot Camp does not support external boot? (Since it was geared towards XP I could see why Apple never tried to add this support, since XP cannot boot purely externally anyway).

Oh, and by the way - it appeared to me that gptsync.efi under the EFI shell can only sync the main internal disk and nothing else - it didn't seem to accept another disk as an argument. That's why I compiled the source for OSX itself. Is that the way it's supposed to be?

lojo
2nd September 2006, 10:35 AM
Just wanted to add that I just tried it out, and I definitely get further. It appears that booting externally using FireWire isn't supported, but USB2 is. Luckily my external drive has both. Using USB I get "GRUB loading Stage 2" then it sits there. But this error sounds familiar at least, and I will investigate more online myself. Just thought I'd mention it in case you immediate had an idea of what that could be. I instructed GRUB to install itself on the actual partition, and NOT the MBR of the external disk, since I seem to recall instructions saying that putting it in the MBR is not going to work.

chrisp
3rd September 2006, 12:52 PM
Since I have your attention, is it the case that even though the official Apple boot selector sees my external partition, it will never work since Boot Camp does not support external boot? (Since it was geared towards XP I could see why Apple never tried to add this support, since XP cannot boot purely externally anyway).
The firmware does support external boot, but there are some limitations -- in Apple's code, in the BIOS design, and in the Windows and Linux boot sequences.

Apple's EFI program that kicks off a legacy boot takes one of three parameters: "HD", "CD" or "USB". Version 0.7 of rEFIt only uses the first two, so that's why you can't boot from an external drive at all. But in any case there is no way to specify which of several drives you want to boot from. To some extent that's not even Apple's fault, because booting from a secondary drive isn't easy with BIOS in any case.

Oh, and by the way - it appeared to me that gptsync.efi under the EFI shell can only sync the main internal disk and nothing else - it didn't seem to accept another disk as an argument. That's why I compiled the source for OSX itself. Is that the way it's supposed to be?
I didn't take the time to write a selection screen, so the EFI version of gptsync is hardcoded to look for the first internal hard disk. That's the way it is. I thought about taking arguments for a moment, but EFI is notorously bad at naming hard disks or partitions in a human-usable way...

Using USB I get "GRUB loading Stage 2" then it sits there.
Plain GRUB as included in most Linux distros won't work because of some A20 gate issue. You may want to try LILO instead.

Actually, putting GRUB in the MBR should work (from looking at the source), it just won't embed itself in the first track because that space is occupied by the GPT partition table. But since it's not working anyway, no one bothered to research the details on that...