Intel Optane DC Persistent Memory - Configuration and Setup White Paper

12TECHNICAL WHITE PAPER
Creating a Namespace
To create and manage Namespaces, we use the ndctl utility
1. ndctl list -NDR
This command will list all namespaces, devices, and regions on the system. Regions are the AppDirect/
AppDirectNotInterleaved pools we made in the previous step.
2. ndctl create-namespace
This command will create an fsdax namespace with default parameters.
3. ndctl create-namespace -m [raw/sector/fsdax/devdax]
using the -m (or --mode=) option will allow you to specify the mode of your namespace.
There are four modes for namespaces in linux:
1. raw mode will create a memory disk that does not support dax.
2. sector mode will enable BTT, which will ensure write atomicity at the cost of some performance.
3. fsdax, or lesystem-dax, is used to enable direct access on le systems and is the default mode when creating
a namespace with ndctl. This mode will enable dax-aware le systems to take advantage of the features of dax.
4. devdax, or device-dax, enables memory mapping capabilities similar to fsdax, however instead of creating a
block device capable of supporting a le system, devdax creates a character device. This character device
can be used for assigning persistent memory to virtual machines, registering memory for RDMA, or for when
gigantic memory mappings are required.
Please consult the ndctl documentation at http://pmem.io/ndctl/ for more information on any of these modes.
Use the -r (--region=) option to specify the region you want to create the namespace on if you’ve congured your
system with multiple regions.
Deleting a Namespace
Warning - Deleting a Namespace will also delete all data contained on the namespace. Ensure any critical data is
backed up prior to deleting a namespace.
To delete a namespace, you must rst disable and then delete using ndctl.
1. ndctl list -N
Will display all namespaces on the system. Note the namespace you wish to delete. Namespaces will usually
have names like “namespace0.0” unless you set a custom one during namespace creation.
2. ndctl disable-namespace namespace0.0
this command will disable the namespace named “namespace0.0”.
3. ndctl destroy-namespace namespace0.0
once the namespace is disabled, it can be deleted with the destroy-namespace command.
Formatting DCPMM
1. Once you have the namespaces set up, the DCPMM device should show up as /dev/pmem[N] in your system
(or something similar – dierent namespaces show up in the system dierently). If it is a “sector” namespace,
you can format this device or add it to a volume group or software RAID as you would with any normal block
device. Consult your distribution’s documentation on how to do this.
2. To enable lesystem-dax on a namespace created with the fsdax mode, the le system block size must be the
same as the kernel page size. To determine the kernel page size, run this command:
getconf PAGESIZE
This command should return your kernel page size.
You must then specify a block size for the le system the same size as the kernel page size during le system
creation. An example for EXT4 le system:
°
mkfs.ext4 -b <kernel page size> </path/to/device>
example: mkfs.ext4 -b 4096 /dev/pmem1
Once you have your le system set up, you need to mount it with the dax option to enable dax.
°
mount -odax <other options> </path/to/device> </mount/point>
example: mount -odax /dev/pmem1 /mnt/dcpmm
CONTENTS & NAVIGATION
1
Introduction
5
DCPMM Security
Overview
System Requirements
6
System Setup Overview
8
Appendices