18.6. Creating a device DAX namespace on an NVDIMM


Configure the NVDIMM device that is attached to your system, in device DAX mode to support character storage with direct access capabilities.

To do this, consider the following options:

  • Reconfiguring an existing namespace to device DAX mode.
  • Creating a new device DAX namespace, if there is space available.

18.6.1. NVDIMM in device direct access mode

Device direct access (device DAX, devdax) provides a means for applications to directly access storage, without the involvement of a file system. The benefit of device DAX is that it provides a guaranteed fault granularity, which can be configured using the --align option of the ndctl utility.

For the Intel 64 and AMD64 architecture, the following fault granularities are supported:

  • 4 KiB
  • 2 MiB
  • 1 GiB

Device DAX nodes support only the following system calls:

  • open()
  • close()
  • mmap()

You can view the supported alignments of your NVDIMM device using the ndctl list --human --capabilities command. For example, to view it for the region0 device, use the ndctl list --human --capabilities -r region0 command.

참고

The read() and write() system calls are not supported because the device DAX use case is tied to the SNIA Non-Volatile Memory Programming Model.

18.6.2. Reconfiguring an existing NVDIMM namespace to device DAX mode

You can reconfigure an existing Non-Volatile Dual In-line Memory Modules (NVDIMM) namespace to device DAX mode.

주의

Reconfiguring a namespace deletes previously stored data on the namespace.

Prerequisites

Procedure

  1. List all namespaces on your system:

    # ndctl list --namespaces --idle
    
    [
      {
        "dev":"namespace1.0",
        "mode":"raw",
        "size":34359738368,
        "uuid":"ac951312-b312-4e76-9f15-6e00c8f2e6f4"
        "state":"disabled",
        "numa_node":1
      },
      {
        "dev":"namespace0.0",
        "mode":"raw",
        "size":38615912448,
        "uuid":"ff5a0a16-3495-4ce8-b86b-f0e3bd9d1817",
        "state":"disabled",
        "numa_node":0
      }
    ]
  2. Reconfigure any namespace:

    # ndctl create-namespace --force --mode=devdax --reconfig=namespace-ID

    예 18.1. Reconfiguring a namespace as device DAX

    The following command reconfigures namespace0.1 for data storage that supports DAX. It is aligned to a 2-MiB fault granularity to ensure that the operating system faults in 2-MiB pages at a time:

    # ndctl create-namespace --force --mode=devdax --align=2M --reconfig=namespace0.1
    {
      "dev":"namespace0.1",
      "mode":"devdax",
      "map":"dev",
      "size":"35.44 GiB (38.05 GB)",
      "uuid":"426d6a52-df92-43d2-8cc7-046241d6d761",
      "daxregion":{
        "id":0,
        "size":"35.44 GiB (38.05 GB)",
        "align":2097152,
        "devices":[
          {
            "chardev":"dax0.1",
            "size":"35.44 GiB (38.05 GB)",
            "target_node":4,
            "mode":"devdax"
          }
        ]
      },
      "align":2097152
    }

    The namespace is now available at the /dev/dax0.1 path.

Verification

  • Verify if the existing namespaces on your system is reconfigured:

    # ndctl list --namespace namespace0.1
    [
      {
        "dev":"namespace0.1",
        "mode":"devdax",
        "map":"dev",
        "size":38048628736,
        "uuid":"426d6a52-df92-43d2-8cc7-046241d6d761",
        "chardev":"dax0.1",
        "align":2097152
      }
    ]

18.6.3. Creating a new NVDIMM namespace in device DAX mode

You can create a new device DAX namespace on a Non-Volatile Dual In-line Memory Modules (NVDIMM) device if there is available space in the region.

Prerequisites

  • The ndctl utility is installed. For more information, see Installing ndctl.
  • The NVDIMM device supports labels to create multiple namespaces in a region. You can check this using the following command:

    # ndctl read-labels nmem0 >/dev/null
    read 1 nmem

    This indicates that it read the label of one NVDIMM device. If the value is 0, it implies that your device does not support labels.

Procedure

  1. List the pmem regions on your system that have available space. In the following example, space is available in the region1 and region0 regions:

    # ndctl list --regions
    [
      {
        "dev":"region1",
        "size":2156073582592,
        "align":16777216,
        "available_size":2117418876928,
        "max_available_extent":2117418876928,
        "type":"pmem",
        "iset_id":-9102197055295954944,
        "badblock_count":1,
        "persistence_domain":"memory_controller"
      },
      {
        "dev":"region0",
        "size":2156073582592,
        "align":16777216,
        "available_size":2143188680704,
        "max_available_extent":2143188680704,
        "type":"pmem",
        "iset_id":736272362787276936,
        "badblock_count":3,
        "persistence_domain":"memory_controller"
      }
    ]
  2. Allocate one or more namespaces on any of the available regions:

    # ndctl create-namespace --mode=devdax --region=regionN --size=namespace-size

    For example, the following command creates a 36-GiB device DAX namespace on region0. It is aligned to a 2-MiB fault granularity to ensure that the operating system faults in 2-MiB pages at a time:

    # ndctl create-namespace --mode=devdax --region=region0 --align=2M --size=36G
    {
      "dev":"namespace0.2",
      "mode":"devdax",
      "map":"dev",
      "size":"35.44 GiB (38.05 GB)",
      "uuid":"89d13f41-be6c-425b-9ec7-1e2a239b5303",
      "daxregion":{
        "id":0,
        "size":"35.44 GiB (38.05 GB)",
        "align":2097152,
        "devices":[
          {
            "chardev":"dax0.2",
            "size":"35.44 GiB (38.05 GB)",
            "target_node":4,
            "mode":"devdax"
          }
        ]
      },
      "align":2097152
    }

    The namespace is now available as /dev/dax0.2.

Verification

  • Verify if the new namespace is created in device DAX mode:

    # ndctl list -RN -n namespace0.2
    {
      "regions":[
        {
          "dev":"region0",
          "size":2156073582592,
          "align":16777216,
          "available_size":2065879269376,
          "max_available_extent":2065879269376,
          "type":"pmem",
          "iset_id":736272362787276936,
          "badblock_count":3,
          "persistence_domain":"memory_controller",
          "namespaces":[
            {
              "dev":"namespace0.2",
              "mode":"devdax",
              "map":"dev",
              "size":38048628736,
              "uuid":"89d13f41-be6c-425b-9ec7-1e2a239b5303",
              "chardev":"dax0.2",
              "align":2097152
            }
          ]
        }
      ]
    }
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동