Quick Start
The ndctl command is designed to be user friendly. Once installed, a list of commands can be shown using any of the following:
1) With no arguments or options, ndctl and daxctl show a simple usage message:
1
# ndctl
2
3
usage: ndctl [--version] [--help] COMMAND [ARGS]
4
5
6
See 'ndctl help COMMAND' for more information on a specific command.
7
ndctl --list-cmds to see all available commands
Copied!
1
# daxctl
2
3
usage: daxctl [--version] [--help] COMMAND [ARGS]
4
5
6
See 'daxctl help COMMAND' for more information on a specific command.
7
daxctl --list-cmds to see all available commands
8
Copied!
2) Using ndctl help and daxctl help displays basic help and syntax:
1
# ndctl help
2
3
usage: ndctl [--version] [--help] COMMAND [ARGS]
4
5
See 'ndctl help COMMAND' for more information on a specific command.
6
ndctl --list-cmds to see all available commands
7
Copied!
1
# daxctl help
2
3
usage: daxctl [--version] [--help] COMMAND [ARGS]
4
5
6
See 'daxctl help COMMAND' for more information on a specific command.
7
daxctl --list-cmds to see all available commands
8
Copied!
Below is an example of using the ndctl help command to launch the create-namespace man page:
1
# ndctl help create-namespace
Copied!
3) Using ndctl --list-cmds and daxctl --list-cmdslists all commands as a single list.
1
# ndctl --list-cmds
2
version
3
enable-namespace
4
disable-namespace
5
create-namespace
6
destroy-namespace
7
read-infoblock
8
write-infoblock
9
check-namespace
10
clear-errors
11
enable-region
12
disable-region
13
enable-dimm
14
disable-dimm
15
zero-labels
16
read-labels
17
write-labels
18
init-labels
19
check-labels
20
inject-error
21
update-firmware
22
inject-smart
23
wait-scrub
24
activate-firmware
25
start-scrub
26
setup-passphrase
27
update-passphrase
28
remove-passphrase
29
freeze-security
30
sanitize-dimm
31
load-keys
32
wait-overwrite
33
list
34
monitor
35
help
Copied!
1
# daxctl --list-cmds
2
version
3
list
4
help
5
migrate-device-model
6
reconfigure-device
7
online-memory
8
offline-memory
Copied!
An alternative method for listing commands uses the TAB key completion feature of ndctl and daxctl. By typingndctl <TAB> <TAB> or daxctl <TAB> <TAB> we can list the available commands, eg:
1
# ndctl <TAB> <TAB>
2
activate-firmware freeze-security setup-passphrase
3
check-labels help start-scrub
4
check-namespace init-labels update-firmware
5
clear-errors inject-error update-passphrase
6
create-namespace inject-smart version
7
destroy-namespace list wait-overwrite
8
disable-dimm load-keys wait-scrub
9
disable-namespace monitor write-infoblock
10
disable-region read-infoblock write-labels
11
enable-dimm read-labels zero-labels
12
enable-namespace remove-passphrase
13
enable-region sanitize-dimm
Copied!
1
# daxctl <TAB> <TAB>
2
help online-memory
3
list reconfigure-device
4
migrate-device-model split-acpi
5
offline-memory version
Copied!

TAB Command and Argument Completion

ndctl and daxctlsupports command completion using the TAB key. For example, typing ndctl enable-<TAB> lists all commands beginning with 'enable', eg:
1
# ndctl enable-<TAB>
2
enable-dimm enable-namespace enable-region
Copied!
TAB completion also works with command arguments. For example, typing ndctl enable-dimm <TAB> will show all available command arguments. For example, the 'enable-dimm' command can enable one, more than one, or all NVDIMMs. It will list all available NVDIMMs (nmem) devices when using the TAB completion, eg:
1
# ndctl enable-dimm <TAB>
2
all nmem10 nmem3 nmem6 nmem9
3
nmem0 nmem11 nmem4 nmem7
4
nmem1 nmem2 nmem5 nmem8
Copied!

Getting Help

NDCTL ships with a man page for each command. Each man page describes the required arguments and features in detail. Man pages can be found and accessed using the man or ndctl utilities. The following man -k ndctl searches for any man page containing the "ndctl" keyword:
1
# man -k ndctl
2
ndctl (1) - Manage "libnvdimm" subsystem devices (Non-volatile Memory)
3
ndctl-check-labels (1) - determine if the given dimms have a valid namespace index block
4
ndctl-check-namespace (1) - check namespace metadata consistency
5
ndctl-clear-errors (1) - clear all errors (badblocks) on the given namespace
6
ndctl-create-namespace (1) - provision or reconfigure a namespace
7
ndctl-destroy-namespace (1) - destroy the given namespace(s)
8
ndctl-disable-dimm (1) - disable one or more idle dimms
9
ndctl-disable-namespace (1) - disable the given namespace(s)
10
ndctl-disable-region (1) - disable the given region(s) and all descendant namespaces
11
ndctl-enable-dimm (1) - enable one more dimms
12
ndctl-enable-namespace (1) - enable the given namespace(s)
13
ndctl-enable-region (1) - enable the given region(s) and all descendant namespaces
14
ndctl-freeze-security (1) - Set the given DIMM(s) to reject future security operations
15
ndctl-init-labels (1) - initialize the label data area on a dimm or set of dimms
16
ndctl-inject-error (1) - inject media errors at a namespace offset
17
ndctl-inject-smart (1) - perform smart threshold/injection operations on a DIMM
18
ndctl-list (1) - dump the platform nvdimm device topology and attributes in json
19
ndctl-load-keys (1) - load the kek and encrypted passphrases into the keyring
20
ndctl-monitor (1) - Monitor the smart events of nvdimm objects
21
ndctl-read-infoblock (1) - read and optionally parse the info-block a namespace
22
ndctl-read-labels (1) - read out the label area on a dimm or set of dimms
23
ndctl-remove-passphrase (1) - Stop a DIMM from locking at power-loss and requiring a passphrase to access media
24
ndctl-sanitize-dimm (1) - Perform a cryptographic destruction or overwrite of the contents of the given NVDIMM(s)
25
ndctl-setup-passphrase (1) - setup and enable the security passphrase for an NVDIMM
26
ndctl-start-scrub (1) - start an Address Range Scrub (ARS) operation
27
ndctl-update-firmware (1) - provides for updating the firmware on an NVDIMM
28
ndctl-update-passphrase (1) - update the security passphrase for an NVDIMM
29
ndctl-wait-overwrite (1) - wait for an overwrite operation to complete
30
ndctl-wait-scrub (1) - wait for an Address Range Scrub (ARS) operation to complete
31
ndctl-write-infoblock (1) - generate and write an infoblock
32
ndctl-write-labels (1) - write data to the label area on a dimm
33
ndctl-zero-labels (1) - zero out the label area on a dimm or set of dimms
Copied!
1
# man -k daxctl
2
daxctl (1) - Provides enumeration and provisioning commands for the Linux kernel Device-DAX facility
3
daxctl-list (1) - dump the platform Device-DAX regions, devices, and attributes in json.
4
daxctl-migrate-device-model (1) - Opt-in to the /sys/bus/dax device-model, allow for alternative Device-DAX instance drivers.
5
daxctl-offline-memory (1) - Offline the memory for a device that is in system-ram mode
6
daxctl-online-memory (1) - Online the memory for a device that is in system-ram mode
7
daxctl-reconfigure-device (1) - Reconfigure a dax device into a different mode
Copied!
Note: If man -k ndctl returns "ndctl: nothing appropriate." or similar, see the Troubleshooting section to manually build the indexes.
Additionally, executing ndctl help <command> can be used to display the man page for the command, eg:
1
# ndctl help enable-dimm
Copied!
A list of ndctl and daxctl man pages are available online. See NDCTL Man Pages and DAXCTL Man Pages for a complete list.

Displaying Bus, NVDIMM, Region, and Namespace Information

The ndctl list command is a very powerful and feature rich command. A list of options is shown below:
1
# ndctl list -?
2
Error: unknown switch `?'
3
4
usage: ndctl list [<options>]
5
6
-b, --bus <bus-id> filter by bus
7
-r, --region <region-id>
8
filter by region
9
-d, --dimm <dimm-id> filter by dimm
10
-n, --namespace <namespace-id>
11
filter by namespace id
12
-m, --mode <namespace-mode>
13
filter by namespace mode
14
-t, --type <region-type>
15
filter by region-type
16
-U, --numa-node <numa node>
17
filter by numa node
18
-B, --buses include bus info
19
-D, --dimms include dimm info
20
-F, --firmware include firmware info
21
-H, --health include dimm health
22
-R, --regions include region info
23
-N, --namespaces include namespace info (default)
24
-X, --device-dax include device-dax info
25
-C, --capabilities include region capability info
26
-i, --idle include idle devices
27
-c, --configured include configured namespaces, disabled or not
28
-M, --media-errors include media errors
29
-u, --human use human friendly number formats
30
-v, --verbose increase output detail
Copied!
Using the filters is a powerful way to limit the output.

Examples

To list all active/enabled namespaces:
1
# ndctl list -N
Copied!
To list all active/enabled regions:
1
# ndctl list -R
Copied!
To list all active/enabled NVDIMMs:
1
# ndctl list -D
Copied!
To list all active/enabled NVDIMMs, Regions, and Namespaces:
1
# ndctl list -DRN
Copied!
To list all active/enabled and disabled/inactive (idle) NVDIMMs, Regions, and Namespaces:
1
# ndctl list -DRNi
Copied!
To list all active/enabled and disabled/inactive (idle) NVDIMMs, Regions, and Namespaces with human readable values:
1
# ndctl list -iNuRD
Copied!

Increasing output verbosity

The -v, --verbose option increases the output verbosity of the command. Using -vv or --vvv further increases the output and verbosity.
Last modified 1yr ago