metaslab debug load on scale

btapps

Cadet
Joined
Jul 18, 2022
Messages
4
Hi all,

I'm not able to enable the setting 'metaslab_debug_load' to '1' on TrueNAS scale 22.02.2. I've tried through the sysctl menu and also as a boot time script (echo 1 > /sys/module/zfs/parameters/metaslab_debug_load). It appears either option is applied too late (after zfs volumes are mounted, due to the dynamic config generation stored on ZFS boot volumes).

Is there any way around this, or is this feature request territory?

Thanks.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399

btapps

Cadet
Joined
Jul 18, 2022
Messages
4
Thanks for the suggestion, but both setting the modprobe option and setting the /sys/tunable dont work in scale as the zfs filesystem is already mounted by the point the config is loaded as /etc is dynamically generated. For example when configuring 'Advanced\scripts' I have no options to run commands before monuting the filesystem, only:

Select when the command or script runs:
Pre Init is early in the boot process, after mounting filesystems and starting networking.
Post Init is at the end of the boot process, before FreeNAS services start.
Shutdown is during the system power off process.

Googling for ideas there is a BSD module debugging command 'mdb' to force the setting post startup - but I don't know the linux equivalent for TrueNAS Scale:
eg issue "echo metaslab_debug/W1 | mdb -kw" at run-time for instantly changing the setting.
 

btapps

Cadet
Joined
Jul 18, 2022
Messages
4
An alternative for me is to use the inverse option to prevent metaslabs being unloaded. Eventually during runtime this will have the same effect. I don't think any tunables that occour only during pool import will work in an environment like Scale as the config is stored on the same storage pool.

metaslab_debug_load (int)

Load all metaslabs during pool import.
Use 1 for yes and 0 for no (default).


metaslab_debug_unload (int)

Prevent metaslabs from being unloaded.
Use 1 for yes and 0 for no (default).
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Since it appears this needs to be loaded from a modprobe.conf file in the initramdisk, try setting an extra kernel parameter via the API: midclt call system.advanced.update '{ "kernel_extra_options": "metaslab_debug_load=1" }'.
 
Top