# ZFS on UFS?



## virtualization (May 21, 2013)

Hi ppl people,

I have installed 9.1 with UFS, on a 20 G disk (old disk). So, I wasn't even thinking about ZFS. But today I noticed messages on bootloading regarding the use of ZFS.

*F*rom dmesg: 

```
ZFS NOTICE: Prefetch is disabled by default on i386 -- to enable [...]
ZFS WARNING: Recommended minimum kmem_size is 512MB; expect unstable behavior. Consider tuning vm.kmem_size and vm.kmem_size_max in /boot/loader.conf.
```

Can someone enlighten me before I lose my disk for good? And why is there even a /sbin/zfs? (I can't remember installing anything related to ZFS).

Is there a use for ZFS in /etc/rc.d too?


----------



## SirDice (May 21, 2013)

virtualization said:
			
		

> And why is there even a /sbin/zfs? (I can't remember installing anything related to ZFS)


ZFS is part of the OS, hence you also get the associated tools. Even if you don't use it.

Unless you ran any of the ZFS commands (zfs(8), zpool(8)) the ZFS filesystem won't be loaded. 

This doesn't do you any harm, if that's what you are worried about. UFS and ZFS can live happily next to each other.


----------



## virtualization (May 21, 2013)

Mostly, I was wondering _why_ it threw these warnings, though.


----------



## SirDice (May 21, 2013)

What's in /etc/rc.conf and /boot/loader.conf?


----------



## virtualization (May 21, 2013)

/etc/rc.conf:

```
hostname="Apollo"
ifconfig_rl0="DHCP"
ifconfig_rl0_ipv6="inet6 accept_rtadv"
moused_enable="YES"
hald_enable="YES"
dbus_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
dumpdev="NO"
webmin_enable="YES"
linux_enable="YES"
sendmail_enable="NO"
nginx_enable="YES"
```
/boot/loader.conf:

```
kern.maxfiles="25000"
```


----------



## SirDice (May 21, 2013)

I don't see anything that would load ZFS. So I'm guessing the message came after you tried one of the ZFS commands.


----------



## kpa (May 21, 2013)

The warning comes from the kernel when ZFS is initialized. Something is causing the zfs.ko module to be loaded on boot. You can ignore it, to make use of ZFS you have to explicitly initialize a pool with zpool(8).


----------



## ShelLuser (May 21, 2013)

Well, I can't fully comment because ZFS is one of the first things I enabled (it was the main drive for me to move to FreeBSD) but there are some options you can use to check what is happening here.

First of all you can check if the zfs.ko module is really loaded:


```
root@smtp2:/etc # kldstat -n zfs
Id Refs Address            Size     Name
 2    1 0xffffffff81524000 2084f8   zfs.ko
```
If the module is not loaded then you'll obviously get an error mentioning this.

As to dmesg, by default FreeBSD keeps 3 files: /var/log/dmesg.today and /var/log/dmesg.yesterday and there's also /var/run/dmesg.boot. Although the latter only contains messages which were generated during boot, this file will also be included when using the dmesg(8) command:


```
root@smtp2:/etc/rc.d # dmesg | grep -E 'zfs|ZFS'
ZFS filesystem version 5
ZFS storage pool version 28
Trying to mount root from zfs:zroot []...
```
The last line here actually originates from /var/run/dmesg.log.

But you could always try to re-use (or whatever you did) one of the zfs commands a few days later, and then check if any messages pop up in /var/log/dmesg.today.

Hope this can help too.


----------

