# How should I install FreeBSD on ZFS?



## Zlop (Jan 5, 2013)

I've been thinking to install FreeBSD 9.1 on a zfs file system but I've encountered a problem regarding ZFS pools. I'd like to put /boot, / and /usr to a ssd and /var, /tmp, /swap and /home to a hdd to extend the life of the ssd. The problem is that I'm not sure what should I do with the zpool. Should I make own pool for both disks?


----------



## SirDice (Jan 7, 2013)

If you want to set it up like that you're going to need two zpools, one for the SSD and the other for the HD. Another idea is to put everything on the HD and use the SSD as L2ARC.

NB. Don't put /boot on a separate filesystem.


----------



## vermaden (Jan 7, 2013)

Zlop said:
			
		

> I've been thinking to install FreeBSD 9.1 on a zfs file system but I've encountered a problem regarding ZFS pools. I'd like to put /boot, / and /usr to a ssd and /var, /tmp, /swap and /home to a hdd to extend the life of the ssd. The problem is that I'm not sure what should I do with the zpool. Should I make own pool for both disks?



Like that:
http://forums.freebsd.org/showthread.php?t=31662

This way You will also can use _ZFS Boot Environments_ (sysutils/beadm).

Use two pools, one *sys* for / (including /boot) and /usr, the second one, *local*, for the rest.


----------



## rami_bachar (Jan 7, 2013)

Hi,

I have this tutorial on my blog and it works fine (I use it myself to make new installations) it works on 9.0 and It should work on 9.1 also

http://www.suse.co.il/?page_id=5


----------



## Zlop (Jan 12, 2013)

I tried to install FreeBSD 9.1 with [thread=23544]this guide[/thread]. I did everything according to the guide, except the boot loader partition. Now I've got separate pools for the partition on my SSD and the partition on my HDD. / and /usr datasets are on the SSD and /var, /tmp and /swap are on the HDD.


----------



## Zlop (Jan 12, 2013)

[thread=23544]Here[/thread] is the correct link to the guide. I forgot to mention that I made the partitions of both devices start from sector 2048. The space between sector 34 and 2048 is unpartitioned.


----------



## Zlop (Jan 13, 2013)

I reinstalled FreeBSD and now booting is possible, but only in single user. In normal boot the following error appears (* is number between 0 and 7):

```
init: can't exec getty '/usr/libexec/getty' for port /dev/ttyv*
```
During the installation I exported the hdd pool before running these:

```
sh
cd /usr/freebsd-dist
export DESTDIR=/mnt
for file in base.txz lib32.txz kernel.txz doc.txz ports.txz src.txz;
do (cat $file | tar --unlink -xpJf - -C ${DESTDIR:-/}); done
```
If I hadn't exported the pool the system wouldn't have been installed on the disk I wanted, which is the ssd.

So, now the question is how to get rid of that error? I'd also like to know if there is any proper way to install FreeBSD split into two pools on two different disks?


----------

