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.

Louis Waweru
  • 175
  • 1
  • 8

1 Answers1

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

Scott McClung
  • 1,675
  • 14
  • 14