# Zfs root & boot



## singularity (Jan 20, 2009)

I did a little test with OpenSolaris and it seemed sluggish.
However, someone else may have liked it and that's why I need to say it was just what I saw on a 2GB C2D machine.

ZFS was very nice and that's why I'd like to try it out on FreeBSD.
However, I'd like to use it for my root partition.

Here are two articles on how to do that:
https://www.ish.com.au/solutions/articles/freebsdzfs
http://wiki.freebsd.org/ZFSOnRoot
http://wiki.freebsd.org/ZFS

However, FreeBSD can't boot without the help of an UFS partition with a bootloader on it.

What would it need to be able to boot from ZFS? Does it still need that UFS partition in 7.1?

If it still does need it, I'd like to see what can be done and do what it takes to fix that and allow native ZFS boot.


----------



## Maledictus (Jan 20, 2009)

http://blogs.freebsdish.org/lulf/2008/12/16/setting-up-a-zfs-only-system/


----------



## singularity (Jan 20, 2009)

Maledictus said:
			
		

> http://blogs.freebsdish.org/lulf/2008/12/16/setting-up-a-zfs-only-system/



Thanks for the link, but, it seems I need to get current in order to get a gptzfsboot.


----------



## f-andrey (Jan 21, 2009)

singularity said:
			
		

> Thanks for the link, but, it seems I need to get current in order to get a gptzfsboot.


The gpt(8) now supports ZFS.GPT support on 7.x


----------



## f-andrey (Jan 21, 2009)

may be to write a string in make.conf

```
echo LOADER_ZFS_SUPPORT=yes >>/etc/make.conf
```
and 

```
cd /usr/src/sys/boot
	make cleandir; make cleandir
	make obj depend all install
```


----------



## singularity (Jan 21, 2009)

Thanks, I will try it out.


----------



## singularity (Jan 22, 2009)

I received a "NO UFS partition found" after trying that.


----------



## f-andrey (Jan 25, 2009)

singularity said:
			
		

> I received a "NO UFS partition found" after trying that.



may be you forgot to do

```
# gpart bootcode -b /boot/pmbr da4
da4 has bootcode
# gpart add -b 34 -s 128 -t freebsd-boot da4
da4p1 added
# gpart bootcode -p /boot/gptzfsboot -i 1 da4
```
My Experiment install FreeBSD-CURRENT on 2 hdd with ZFS
http://f-andrey.blogspot.com/2009/01/freebsd-zfs.html


----------



## singularity (Jan 28, 2009)

No, I didn't forget.
I used gptboot, not gptzfsboot because there wasn't one .
How do I get the gptzfsboot file? I followed your guide to enable it with ENABLE_ZFS_SUPPORT=yes and it didn't work, I don't get a gptzfsboot in /boot or anywhere else.


----------



## singularity (Jan 28, 2009)

Anyone else who wants to get gptzfsboot can get it from the -CURRENT sources.


----------



## f-andrey (Jan 29, 2009)

singularity said:
			
		

> Anyone else who wants to get gptzfsboot can get it from the -CURRENT sources.


Yes gptzfsboot only -CURRENT.
add boot on ufs may be.


----------



## tobe (Mar 17, 2009)

from http://en.wikipedia.org/wiki/ZFS



> When entire disks are added to a ZFS pool, ZFS automatically enables their write cache. This is not done when ZFS only manages discrete slices of the disk, since it doesn't know if other slices are managed by non-write-cache safe filesystems, like UFS.



It is relevant to FreeBSD ?

I ask this because I've only one disk in my laptop, but I'd like to test the performances of ZFS under heavy loads.


----------



## ecazamir (Oct 2, 2010)

I managed to install FreeBSD 8.1 amd64 on ZFS root using this method.


----------

