# FreeBSD install with zfs boot problem



## folivora (Oct 5, 2013)

Hi,

I decided to see how ZFS root-boot is done, I did follow this guide: 
	
	



```
https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/9.0-RELEASE
```
.

After all these steps, on the first boot I am getting this error:


```
Mounting from zfs:zroot/ROOT/default failed with error 2: unknown

Loader variables: vfs.root.mountfrom=zfs:zroot/ROOT/default

mountroot>
```

I did update cache with:


```
zpool set cachefile=/boot/zfs/zpool.cache   zroot
```

Best Regards


----------



## J65nko (Oct 5, 2013)

Do you have the following in /boot/loader.conf?

```
zfs_load="YES"
```


----------



## ShelLuser (Oct 5, 2013)

That loader variable doesn't look correct to me. In my situation I don't specify anything apart from the main ZFS pool:


```
$ grep mountfrom loader.conf
vfs.root.mountfrom="zfs:zroot"
```
Where zroot is obviously my main ZFS pool.


----------



## kpa (Oct 5, 2013)

No, when used with ZFS the vfs.root.mountfrom variable specifies a ZFS dataset that is to be used as the root filesystem, not the pool.


----------



## ShelLuser (Oct 6, 2013)

kpa said:
			
		

> No, when used with ZFS the vfs.root.mountfrom variable specifies a ZFS dataset that is to be used as the root filesystem, not the pool.


I'm aware of that, but as soon as you create the pool it will also create a matching dataset (or filesystem if you will). And considering how vfs.root.mountfrom points to a single slice when used on UFS I think the OP's value looks peculiar.

Might help if the OP could show us the output from `zfs list -r zroot`.


----------



## kpa (Oct 6, 2013)

It depends on how you organize the datasets in the pool. If you are using the so called boot environments layout (here it looks exactly like that) there is a top level dataset, for example zroot, that is not going to be used for mounting but containing a dataset named ROOT that is also not going to be mounted. Below the ROOT dataset are the datasets that will contain the root filesystems for each boot environment. Let's say you have this type of hierarchy:


```
zroot
zroot/ROOT
zroot/ROOT/default
zroot/ROOT/default/usr
...
zroot/ROOT/test
zroot/ROOT/test/usr
...
```

That is two boot environments, default and test and you could switch between them by setting the bootfs property for the pool to either zroot/ROOT/default or zroot/ROOT/test.


----------

