ZFS File-backed iSCSI volume appears as cbb device in iostat

I'm fooling around with FreeBSD as a storage server. I have iSCSI target LUNs that are actually files on ZFS datasets (i.e. not zvols).

Something cool/unusual is how iostat displays these as cbb<x> devices alongside the rest of my [actual] block devices. This seems to be a re-cycling of the old naming convention for PCCard devices.

1736727569319.png


Especially neat is how these cbb stats reflect all LUN traffic regardless of back-end zpool/ARC/cache activity. Thus I can watch data "ingest" via cbb then watch said data again when it's time for ZFS to close the current txg. Similarly ARC [hit] reads against these target LUNs are typically invisible to iostat but these cbb lines reveal all!

Unfortunately I've yet to find another utility with awareness of file-backed iSCSI LUNs. gstat-rs is particularly interesting but it, too, is oblivious. There are no cbb devices in my /dev tree:

Code:
[root@bsd /]# find / -name cbb*
/boot/kernel/cbb.ko
/usr/lib/debug/boot/kernel/cbb.ko.debug
/usr/share/man/man4/cbb.4.gz

What is iostat doing that's special and might there be any quick hacks for gaining visibility with other tools?
 
If you search for "cbb in the kernel source code, you will find it mentioned in the file src/sys/cam/ctl/ctl_backend_block.c. In that file a call to devstat_new_entry() can be found. The next step is to open and read the man page of that function.

FreeBSD offers you the source code of everything as well as plenty of documentation and you are allowed to make use of them.
 
Yep, I found that in the source after posting the above. It seems iostat leverages the devstat facility while many related utils appear to interface with geom.

Thus far the utility I like most is gstat-rs. I need to dig in and see if perhaps it can be extended... I've never worked with Rust but there's a first time for everything!
 
Back
Top