Managing NVDIMMs
Managing physical or emulated NVDIMMs using ndctl
has no functional difference. Physical NVDIMM features and options may be controlled through the system BIOS. The BIOS cannot see emulated NVDIMMs.
Observe the following restrictions when managing NVDIMMs
DO NOT change the memory slot of physical NVDIMMs when they are part of an Interleave Set. Doing so changes the order of interleaving so data access will be compromised or corrupted. If interleaving is disabled, moving NVDIMMs to different slot locations is okay, but not recommended.
DO NOT disable NVDIMMs when they are part of an active Region and/or Namespace as this will prevent data access and may corrupt data.
ALWAYS backup the data and make a copy of the configuration layout prior to any changes.
Listing active/enabled NVDIMMs
The ndct list -D
, or equivalent ndct list --dimm
, can be used to show active/enabled NVDIMM devices on the system, eg:
Listing disabled/inactive NVDIMMs
By default, ndctl
only lists enabled/active dimms, regions, and namespaces. To include previously disabled (inactive) NVDIMMs, include the -i
flag to show both enabled and disabled devices, eg:
NVDIMM vendor specific tools can be used to display more information about the NVDIMMs from the operating system layer. For example, Intel Optane DC Persistent Memory Modules can be managed using the ipmctl utility. Refer to the IPMCTL User Guide for more information. For other persistent memory products, refer to the vendor specific documentation.
Disabling NVDIMMs
NVDIMMs can only be disabled if they have no active Regions or Namespaces. If an active/enabled namespace and/or region exists, a message is displayed:
1) List the current active/enabled configuration
2) Verify no fsdax or devdax namespaces are mounted or in-use by running applications
3) Destroy or disable any active/enabled namespace(s).
See Destroying Namespaces or Disabling Namespaces for more information.
4) Disable the regions used by the NVDIMM (nmem) that needs to be disabled
See Disabling Regions for more information.
5) Disable a single, subset, or all NVDIMM (nmem) devices
To disable a single NVDIMM, use:
To disable a subset or specific list or NVDIMMs, use:
To disable all NVDIMMs, use:
6) Verify the NVDIMM(s) are disabled by listing inactive dimms and verifying the 'state':
Enabling NVDIMMs
1) Verify the nmem device, or list of nmem devices, that need to be enabled using the ndctl list -Di
command:
2) Enable the NVDIMM(s)
To enable a single NVDIMM (nmemX) device, use:
To enable a subset of disabled NVDIMMs, use:
To enable all disabled NVDIMMs, use:
3) Verify the state by listing all NVDIMMs
A filtered list of NVDIMMs can shown using the -d <nmemX>
or -dimm <nmemX>
option, eg:
Sanitize NVDIMMs
Sanitizing one or more NVDIMMs perform a cryptographic destruction or overwrite of the contents of the given NVDIMM(s). The sanitize-dimm command performs a cryptographic destruction of the contents of the given NVDIMM. It scrambles the data, and any metadata or info-blocks, but it doesn’t modify namespace labels. Therefore, any namespaces on regions associated with the given NVDIMM will be retained, but they will end up in the raw mode.
Additionally, after completion of this command, the security and passphrase for the given NVDIMM will be disabled, and the passphrase and any key material will also be removed from the keyring and the ndctl keys directory at /etc/ndctl/keys.
The command supports two different methods of performing the cryptographic erase. The default is crypto-erase, but additionally, an overwrite option is available which overwrites not only the data area, but also the label area, thus losing record of any namespaces the given NVDIMM participates in.
Sanitizing NVDIMMs requires the region to be disabled first. If there are existing namespaces, those too must be destroyed or disabled. See the Managing Regions section for more information.
Examples
Sanitize a single NVDIMM. This requires the region is disabled. The following destroys all namespaces, disables the region, the sanitizes the DIMMs within the region.
1) Stop all applications that use a namespace associated with the NVDIMMs that need to be sanitized.
2) Unmount any mounted file systems
3) Destroy the namespaces
4) Identify the NVDIMMs associated with the region using the ndctl list -Rvv
or ndctl list -DR
command. -D
displays DIMMs, -R
displays regions. The JSON formatted output shows the hierarchy.
5) Disable the region(s)
6) Sanitize the DIMM(s) associated with the region(s) using the overwrite (-o
) procedure. The -c
(cryptographic) option works on DIMMs that were previously encrypted.
Note: If the DIMMs were not encrypted with a passphrase, you may see harmless messages such as the following for each DIMM
7) You may need to re-provision the NVDIMMs using the vendors utility. For example, use ipmctl for Intel Optane DC Persistent Memory to recreate the goal. Then use ndctl
to create the namespace configuration.
Last updated