Quick Start
The ndctl , daxctl, and cxl commands are 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 ,daxctl , and cxl 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
Copied!
1
$ cxl
2
3
usage: cxl [--version] [--help] COMMAND [ARGS]
4
5
6
See 'cxl help COMMAND' for more information on a specific command.
7
cxl --list-cmds to see all available commands
Copied!
2) Using ndctl help ,daxctl help , and cxl help displays basic help and syntax information for the sub-command. 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 daxctl --list-cmds, and cxl --list-cmds lists 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
split-acpi
6
migrate-device-model
7
create-device
8
destroy-device
9
reconfigure-device
10
online-memory
11
offline-memory
12
disable-device
13
enable-device
Copied!
1
$ cxl --list-cmds
2
version
3
list
4
help
5
zero-labels
6
read-labels
7
write-labels
Copied!
An alternative method for listing commands uses the TAB key completion feature. By typingndctl <TAB> <TAB> ,daxctl <TAB> <TAB> , or cxl <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 version
3
list split-acpi
4
migrate-device-model create-device
5
destroy-device reconfigure-device
6
online-memory offline-memory
7
disable-device enable-device
Copied!
1
$ cxl <TAB> <TAB>
2
help version
3
list zero-labels
4
read-labels write-labels
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-activate-firmware (1) - activate staged firmware on memory devices
4
ndctl-check-labels (1) - determine if the given dimms have a valid namespace index block
5
ndctl-check-namespace (1) - check namespace metadata consistency
6
ndctl-clear-errors (1) - clear all errors (badblocks) on the given namespace
7
ndctl-create-namespace (1) - provision or reconfigure a namespace
8
ndctl-destroy-namespace (1) - destroy the given namespace(s)
9
ndctl-disable-dimm (1) - disable one or more idle dimms
10
ndctl-disable-namespace (1) - disable the given namespace(s)
11
ndctl-disable-region (1) - disable the given region(s) and all descendant namespaces
12
ndctl-enable-dimm (1) - enable one more dimms
13
ndctl-enable-namespace (1) - enable the given namespace(s)
14
ndctl-enable-region (1) - enable the given region(s) and all descendant namespaces
15
ndctl-freeze-security (1) - Set the given DIMM(s) to reject future security operations
16
ndctl-init-labels (1) - initialize the label data area on a dimm or set of dimms
17
ndctl-inject-error (1) - inject media errors at a namespace offset
18
ndctl-inject-smart (1) - perform smart threshold/injection operations on a DIMM
19
ndctl-list (1) - dump the platform nvdimm device topology and attributes in json
20
ndctl-load-keys (1) - load the kek and encrypted passphrases into the keyring
21
ndctl-monitor (1) - Monitor the smart events of nvdimm objects
22
ndctl-read-infoblock (1) - read and optionally parse the info-block a namespace
23
ndctl-read-labels (1) - read out the label area on a dimm or set of dimms
24
ndctl-remove-passphrase (1) - Stop a DIMM from locking at power-loss and requiring a passphrase to access media
25
ndctl-sanitize-dimm (1) - Perform a cryptographic destruction or overwrite of the contents of the given NVDIMM(s)
26
ndctl-setup-passphrase (1) - setup and enable the security passphrase for an NVDIMM
27
ndctl-start-scrub (1) - start an Address Range Scrub (ARS) operation
28
ndctl-update-firmware (1) - update the firmware the given device
29
ndctl-update-passphrase (1) - update the security passphrase for an NVDIMM
30
ndctl-wait-overwrite (1) - wait for an overwrite operation to complete
31
ndctl-wait-scrub (1) - wait for an Address Range Scrub (ARS) operation to complete
32
ndctl-write-infoblock (1) - generate and write an infoblock
33
ndctl-write-labels (1) - write data to the label area on a dimm
34
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-create-device (1) - Create a devdax device
4
daxctl-destroy-device (1) - Destroy a devdax device
5
daxctl-disable-device (1) - Disables a devdax device
6
daxctl-enable-device (1) - Enable a devdax device
7
daxctl-list (1) - dump the platform Device-DAX regions, devices, and attributes in json.
8
daxctl-migrate-device-model (1) - Opt-in to the /sys/bus/dax device-model, allow for alternative Device-DAX instance drivers.
9
daxctl-offline-memory (1) - Offline the memory for a device that is in system-ram mode
10
daxctl-online-memory (1) - Online the memory for a device that is in system-ram mode
11
daxctl-reconfigure-device (1) - Reconfigure a dax device into a different mode
Copied!
1
$ man -k cxl
2
cxl (1) - Provides enumeration and provisioning commands for CXL platforms
3
cxl-list (1) - List CXL capable memory devices, and their attributes in json.
4
cxl-read-labels (1) - read out the label area on a CXL memdev
5
cxl-write-labels (1) - write data to the label area on a memdev
6
cxl-zero-labels (1) - zero out the label area on a set of memdevs
7
cxl_new (3) - Create a new library context object that acts as a handle for all library operations
8
libcxl (3) - A library to interact with CXL devices through sysfs(5) and ioctl(2) interfaces
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 man pages is available online. See NDCTL Man Pages, DAXCTL Man Pages, and CXL 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 13d ago