# Installing on a GPT harddrive hoses existing bootloader?



## mercurysquad (May 3, 2009)

Hello,

I have a GPT partitioned harddrive with Chameleon bootloader to boot HFS+ partitions and any foreign OSes. I see that FreeBSD 7.1+ supports booting off GPT so I tried to install it on an empty partition I had set aside earlier. I chose "Do not install any bootloader in the MBR" option during setup, as the bootloader I have can already boot foreign OSes. However, the setup replaced my bootloader anyway! :-\

This happened twice, once with 7.1 release and again last night when I tried 8-CURRENT. The multiboot choice screen doesn't show up, instead, FreeBSD boots off directly. I'm guessing that the setup doesn't recognize the GPT disk, instead sees the dummy MBR partition map which GPT disks have, and so screws up the gpt map, installs itself on the given partition and sets it as active. What I don't get is, unless FreeBSD actually overwrote the MBR, why would the BIOS boot the now-active freebsd partition directly instead of loading the boot code in the MBR (which should then load my custom bootloader from the hfs+ partition)? This led me to conclude that freebsd installer modifies the bootcode in the MBR regardless of if I choose "Do NOT install any bootloader".

Is this a known issue, i.e. is it currently not possible to install freebsd on a GPT harddrive using the setup .ISOs (and have it not touch the MBR bootcode)? Or did I make some mistakes during setup? I'd like to know so that when I try to install fbsd on GPT a third time, I get it right  I had to restore the entire hdd from backup images last night.

Thanks.


----------



## Djn (May 3, 2009)

I'm reasonably sure you'd only need to restore the first few sectors - so if you dd something like the first MB of the disk onto an USB drive, you should be able to make that recovery rather much faster. 

As for why, uhm. It really shouldn't do anything like that, and I'm no expert on sysinstall - you'll have to hope for someone more qualified to drop by.


----------



## f-andrey (May 4, 2009)

Sysinstall almost certainly not support GPT.
Create boot-sector, example man gpart(8)


----------



## mercurysquad (May 6, 2009)

Thanks, I decided to install on an external MBR-partitioned disk instead.


----------

