zdb and zpool cache-files?

Status
Not open for further replies.

Stilez

Guru
Joined
Apr 8, 2016
Messages
529
Clean install 9.10.2-u1. I want to tune my setup and some of the commands for that are run via zdb, so I've set up a test server to see what impact various changes might make. I got this output:

$ zpool get all
NAME PROPERTY VALUE
Test_pool size 5.44T

$ zpool list Test_pool
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
Test_pool 5.44T 3.83T 1.60T - 51% 70% 1.00x ONLINE /mnt

$ zdb -S Test_pool
zdb: can't open 'Test_pool': No such file or directory

$zdb <pretty much any command> Test_pool
zdb: can't open 'Test_pool': No such file or directory

I can't get zdb to work at all. From googling, it looks like the issue is lack of a zfs or zpool cache file or some kind (See PCBSD redmine - appears to focus on FreeNAS 9.10 and this issue although on PCBSD Redmine; also on FreeNAS forum; see also same at ZFSonlinux), and solutions in those threads include using zdb -U zdb -U /data/zfs/zpool.cache (or some other path), or running zpool set cachefile=/boot/zfs/zpool.cache your_pool "if there is a need for a cachefile".

Can someone clarify whether the error I'm seeing is expected for FreeNAS, and, if I want to use zdb on 9.10.2-u1 (for its enhanced output information), how do I do so, or should I use something else?

If I need to create a "cache file", should I, what is it, and how much will adding one impact a live server?
 
Last edited:

Mlovelace

Guru
Joined
Aug 19, 2014
Messages
1,111
@fracai is correct. zdb by default (since freeNAS started using zfs for it's boot volume) points to the 'freenas-boot' volume. To use zdb on your pool(s) you need to point zdb to /data/zfs/zpool.cache
 

Stilez

Guru
Joined
Apr 8, 2016
Messages
529
Thanks for the replies, which helped. Also, request filed for this to be clearer if it's going to fail, since zdb is usually a go-to tool for advanced stats: https://bugs.pcbsd.org/issues/21373
 
Status
Not open for further replies.
Top