# ZFS+Software RAID Mirror Installation Issues



## nabioullinr (Jun 10, 2010)

I have been trying to install using 8.0-RELEASE-amd64-memstick to a system according to these directions: http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror
The only ways I have deviated from the instructions are:
1. dd'ing the first 1M with /dev/zero for each HDD (otherwise gpart will complain)
2. 
	
	



```
Fixit# gpart add -s 128 -t freebsd-boot ad0
 Fixit# gpart add -s 5g -t freebsd-swap -l swap0 ad0
 Fixit# gpart add -t freebsd-zfs -l disk0 ad0

 Fixit# gpart add -s 128 -t freebsd-boot ad4
 Fixit# gpart add -s 5g -t freebsd-swap -l swap4 ad4
 Fixit# gpart add -t freebsd-zfs -l disk4 ad4
```
(instead of explicitly entering the size and beginning in blocks)
3. Not having so many ZFS partitions, including /var/empty (only /tmp, /var, /usr, /usr/home).

The first issue to occur is that I cannot mirror the swap - /dev/gpt only contains disk0 and disk4, and /dev/mirror contains swap0 (already mirrored?). The most important issue, however, is that the system simply cannot boot from either HDD, as if the MBR is nonexistent/incorrect.

Any ideas? Thanks in advance.


----------



## nabioullinr (Jun 10, 2010)

One thing I noticed was that "-b 34" was used for freebsd-boot in the directions...maybe this is the issue.


----------



## jem (Jun 10, 2010)

Have you written your MBR and bootcode to partition 1 with the 'gpart bootcode' command?

'-b' specifies the beginning sector of a partition.  If you omit it, it will default to the first free sector.  If you run 'gpart show', you'll probably see that partition 1 starts at sector 34 already.

I can't really answer your specific swap mirroring issue, but on my box I don't care about capturing kernel crash dumps, so I have my swap partition in its own fixed size ZFS.  Then mirroring it is handled at the zpool level.

If you're still having problems, can you paste your 'gpart show' output in a reply?


----------



## nabioullinr (Jun 10, 2010)

Yes, I have invoked that command per instructions:

```
Fixit# gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptzfsboot -i 1 ad0
 Fixit# gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptzfsboot -i 1 ad4
```


----------



## nabioullinr (Jun 10, 2010)

Would the BIOS even recognize a Protected MBR (pmbr) and gptzfsboot loader?


----------



## jem (Jun 10, 2010)

Should do.  I've got two 7 year old PC's that boot from GPT disks just fine.

The BIOS executes the code in the PMBR, which in turn looks for bootcode in your freebsd-boot partition and executes that.


----------

