2

Let's say I set a parameter with the following command, how could I read it back later on?

mdb -kwe "spa_load_verify_metadata/W 0"

I am trying to read the man page, but I'm only in this OS temporarily and don't understand what it's talking about.

The search modifiers are:
       l   Search for the specified 2-byte value.
       L   Search for the specified 4-byte value.
       M   Search for the specified 8-byte value.

I would normally expect that value to be in /sys/modules/zfs/parameters/spa_load_verify_metadata where I could just cat the value, but /sys doesn't even exist.

I tried finding the variable using find, but it wasn't in the filesystem. I don't understand the concept of where these values are...

I'm actually just trying to read the values of other parameters that I know to exist.

1 Answer 1

2

On Linux, the natural way to export kernel parameters is virtual files in /sys or /proc. On Solaris and its derivatives, the debugger mdb can be used to read and write values.

# mdb -ke "spa_load_verify_metadata::print"
0x1 (B_TRUE)

Or as I used to do it:

# echo "spa_load_verify_metadata::print" | mdb -k
0x1 (B_TRUE)

You can find more information about the symbol with the debugger:

# mdb -k
> spa_load_verify_metadata::nm 
Value              Size               Type  Bind  Other Shndx    Name
0xfffffffffbfc11f0|0x0000000000000004|OBJT |GLOB |0x0  |6       |spa_load_verify_metadata

More information can be found here: Oracle Solaris Modular Debugger Guide

1
  • Thank you for such a complete answer! Commented Mar 2, 2020 at 3:50

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.