# Can't boot GPT hard disks



## argatoga (Oct 13, 2009)

For awhile now I have been using a USB stick to boot my system (root on ZFS). Now that I am running 8.0-rc1 I'd like to boot from my hard disks. 

I have two mirrored 500GB drives set-up with GPT.

```
=>       34  976773101  ad1  GPT  (466G)
         34        128    1  freebsd-boot  (64K)
        162  976772973    2  freebsd-zfs  (466G)

=>       34  976773101  ad10  GPT  (466G)
         34        128     1  freebsd-boot  (64K)
        162  976772973     2  freebsd-zfs  (466G)
```

When I run 
	
	



```
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ad1
```
 or 
	
	



```
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ad10
```
 I am told the bootcode has been installed, but when I try to boot to either of them the computer's BIOS tells me that there is no OS. So it doesn't look like the bootloader is installed.

Any ideas?


----------



## graudeejs (Oct 13, 2009)

Check if your bios is set to actually boot from HDD


----------



## gordon@ (Oct 13, 2009)

Do you have a mobo that uses EFI?


----------



## argatoga (Oct 14, 2009)

The motherboard is an Intel D94GCLF Atom 230.


----------



## gordon@ (Oct 21, 2009)

According to
http://www.intel.com/assets/pdf/prodbrief/d945gclf_prodbrief.pdf

This MOBO only has a standard BIOS, not EFI. As such, you cannot boot GPT disks. At least that is my understanding.


----------



## graudeejs (Oct 21, 2009)

Am I missing something here?
I have standard BIOS and used GPT for long time, still use it...
trick is to set it bootable

with gpart you do this like this:

```
gpart create -s gpt [red]da0[/red]
gpart add -v 34 -s 128 -i 1 -t freebsd-boot [red]da0[/red]
gpart add -v 162 -s [red]2000[/red] -i 2 -t freebsd-ufs [red]da0[/red]
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 [red]da0[/red]
```

and no problem
-s 2000 <--- i just improvised, use size you need
make sure that on 2 gpt partition you have at least /boot
gpt partition 1 can't be used, it's used already (we wrote bootcode to it)

replace da0 with appropriate device

P.S. I had no success booting straight from zfs on flash 
Will have to try one day later


----------



## os (Oct 24, 2009)

you don't need an EFI capable motherboard.. 

FYI on 8RC1 -s switch to gpart works with GB suffix, like (if I remember correctly):

```
gpart add -s 2GB -t freebsd-ufs ad0
```


----------



## os (Oct 24, 2009)

argatoga said:
			
		

> I am told the bootcode has been installed



Has been installed or already installed? E.g. it might be telling you that theres already a bootcode so it didnt do anything .. 

Or maybe the files got corrupted or something? You could try to install the bootcode from the 8RC1 install cd (fixit shell) instead.. all you need is there.


----------



## RyanColp (Nov 4, 2009)

If you're using ZFS on GPT, use the gptzfsboot partition code instead of gptboot.


```
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ad1
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ad10
```

If you don't have gptzfsboot in your /boot directory, you can install it from the Fixit console of the 8.0RC1 CD or USB key.


```
Fixit # /dist/sbin/gpart bootcode -b /dist/boot/pmbr -p /dist/boot/gptzfsboot -i 1 ad1
Fixit # /dist/sbin/gpart bootcode -b /dist/boot/pmbr -p /dist/boot/gptzfsboot -i 1 ad10
```

I've been working on setting up a server with a ZFS mirror on GPT, and found this wiki page to be very useful:  http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror


----------

