Fedora, Macs and EFI

When installing Linux beside OS X, Fedora toggles the boot flag on for its partition. This causes GPT to see it as an “EFI boot partition,” rather than “Basic Data”. This appears to cause a problem if you want to triple boot with Windows and under OS X the disk utility will see it as one whole partition, with the Linux half missing.

To fix this, toggle the boot flag to off using parted and then sync the GPT partition table to the master boot record partition table. It’s easiest to do this while the installer’s running (switch to TTY2) else you’ll have to install anaconda under your install to get gptsync (or run it from the rEFIt menu).

Simply run the following:
parted /dev/sda
toggle 3 boot
gptsync /dev/sda

The gptsync command should spit out the “Current GPT partition table” which should show something like:
EFI System (FAT)
Basic Data
Basic Data (if you have a fourth partition for Windows)

The “Proposed new MBR partition table” should show something like:
EFI Protective
FAT32 (LBA) (or NTFS, depending if it's already been formated)

Now Windows should install cleanly on the fourth partition (if you’re doing that) and the partition structure under OS X should be correct.

20 thoughts on “Fedora, Macs and EFI

  1. Thanks for this. I’m still stuck on this same issue. I was not able to enter the terminal at all during install… is there a trick to it??? No combinations of ctrl, alt, 2, F2, etc. seem to work.

    I’m installing 12 from a DVD iso img. So I had to complete the install, then run /parted after booting into the installed Fedora. Works fine, but, it tells me I better reboot before making anymore changes to /dev/sda. So I reboot, then use rEFIt to sync. Everything looks good and the little boot star moves from partition 3 to partition 4. Unfortunately, on the next reboot into fedora, it switches back 🙂 I can never get it to stick, so I am stuck in some kind catch 22.

    I have tried every combination of running parted in linux, the gptsync in linux, reboot, or, parted in linux, gptsync in rEFIt, etc. but I can’t can’t get it to stick to the point where XP can correctly recognize the partition.

    Any clues, pointers or words of advice? I’ve been running around in circles with this.

  2. I solved the initial problem: the keyboard. I tried a different USB keyboard and the terminal was accessible during the Anaconda install (for anyone else who might miss this obvious solution)

    But it does not matter if I toggle & sync during install or after install. I’m still struggling with syncing. It does appear the Fedora & rEFIt are fighting over authority. I notice whenever I run the rEFIt partition utility (even if I don’t commit changes, or no changes need to be syncd) that Fedora will not boot on the next attempt.

    Any clues would be appreciated

  3. I am going to do a fresh install of everything and will report back. Thanks! While I’m in there, a seemingly dumb question: if I run parted during the anaconda install as you suggest, should I run it & gptsync before or after the partition is actually written to disk?

  4. After install of Linux, and booting into it + logging in I have:

    [root@localhost ~]# parted -l
    Model: ATA Hitachi HTS54502 (scsi)
    Disk /dev/sda: 250GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt

    Number Start End Size File system Name Flags
    1 20.5kB 210MB 210MB fat32 EFI system partition boot
    2 210MB 100GB 99.9GB hfs+ Customer
    3 100GB 175GB 75.0GB ext4 Linux
    4 175GB 250GB 74.8GB fat32 Windows

    Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0
    has been opened read-only.
    Error: /dev/sr0: unrecognised disk label

    [root@localhost ~]# fdisk -l

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

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

    Device Boot Start End Blocks Id System
    /dev/sda1 1 26 204819+ ee GPT
    /dev/sda2 26 12167 97525176 af HFS / HFS+
    /dev/sda3 * 12184 21302 73241600 83 Linux
    /dev/sda4 21302 30402 73094144 c W95 FAT32 (LBA)

  5. Well, MAC & Linux work, but my problem is still the one you discuss on this page…. when I go to install XP, Windows Setup finds only one C partition:

    C: Partition 1 [Unkonwn] 131072 MB (131071 MB Free)

    I can’t see to get around that even following your awesome suggestions. Any ideas? Thanks a million for the help! Hopefully, this will help others too.

  6. I was afraid you would ask that. First, I added anaconda to Fedora and rand gptsync there, shutdown, and tried Windows again. No luck.

    I reboot, ran the refit tool, it said “in sync, no need to run”

    When I rebooted from there into the Windows disk, still just the same partition 🙁 so sad! I have been logging back in to fedora to check the partitions and they look the same: all good, no change. I wonder if I should try a different version of Windows?

  7. Well, Windows *should* only see one partition, but it should see the last one, which on your machine looks like it should be about 75GB.

    I don’t know why it’s seeing 150GB, that makes no sense.

    Anyway, I’m thinking you could try booting to Fedora and use parted to toggle boot on the Windows partition.

    Same as instructed in the post, but partition 4, I think.

    You could also try formatting it NTFS under Linux, in case EFI is getting confused over two FAT32 partitions.

    Other than that, I’m running out of ideas..


  8. Something like:

    yum install ntfsprogs
    mkfs.ntfs /dev/sda4

    Then make sure that you do a partition sync using rEFIt.

    Then boot the Windows installer and see what happens..

  9. I got it, thanks for your help. Windows 7. It turns out it was just my crappy old version of XP that I had pulled out of the closet was the problem! The partitions were configured correctly the whole time, it was the XP install disk that was causing all the fuss. Once I tried a newer Vista & 7 disk, I had no problems.

    Formatting to NTFS made no difference. I will also note (for anyone stuck on this issue) that “toggle 4 boot” caused some problem when I tried to un-toggle it. It unset the boot, but removed the drive name and flagged is “msftrsv” and I was unable to toggle off that flag. After that the drive was not readable in the OSX diskutil (which scared me). The solution was to change the properties of the drive (I set it to MS-DOS) then delete it completely and start over with partition creation & resizing.

    Also, my original problem of not getting the drive changes to stick was solved by uninstalling rEFIt each time I started over.

    Thanks a million for your assist. My breakthrough was when you pointed out that XP calling the partition 150 made no sense… that got me to try another Windows installer.

    Now I am on to my next challenge of trying to get the Macbook broadcom wireless working in F12 🙂

  10. Ohhh thank you thank you and thank you!! Was trying to install Fedora 13 on my MacBook Pro and it kept going “no bootable device”, unflagging the boot bit sda3 works and now I am typing this in full installation of Fedora 13!! <3

  11. > you’ll have to install anaconda under your install to get gptsync

    I have anaconda installed, but running `gptsync` says “command not found”

  12. This is a very old post, I’m not sure that `gptsync` is even packaged any more… There might be another way this is mean to work, but I’m not sure as I don’t have any Apple computers any more, sorry.

Leave a Reply

Your email address will not be published. Required fields are marked *