Creating a DAX-Enabled File System for Persistent Memory Database

Learn how to create and use a DAX-enabled file system for your Persistent Memory Database.

You must use an XFS-based DAX file system as the filestore for the PMEM database. Scalability and performance of the Persistent Memory Database is affected without the correct configuration, hence Oracle recommends that you use the XFS file system using the following configuration steps.

This configuration ensures that XFS extents are aligned to 2 MB and you can use 2 MB pages when mapping a file to an Oracle process.

  1. Ensure that you have a namespace in FSDAX mode with a 2 MB alignment.
    $ ndctl list
    [
      {
        "dev":"namespace0.0",
        "mode":"fsdax",
        "map":"dev",
        "size":91953823744,
        "uuid":"e11456a7-b26a-4409-b31a-f11b8ee06e5a",
        "sector_size":512,
        "align":2097152,
        "blockdev":"pmem0"
      }
    ]
  2. Create two partitions on your PMEM storage device. One small partition of approximately 2% for the metadata and the rest for the data.
  3. Ensure that the starting sector of the data partition is aligned to 2 MB. Ensure that the data partition is configured as a real time device when creating the xfs filesystem to guarantee 2 MB aligned extents. The starting sector number of the data partition should be a multiple of 4096 when you run the fdisk -l command.

    In this example, the data partition /dev/pmem0p2 starts at a sector offset that is a multiple of 4096.

    $ sudo /sbin/fdisk -l /dev/pmem0
    
    Disk /dev/pmem0: 92.0 GB, 91953823744 bytes, 179597312 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk label type: dos
    Disk identifier: 0x1ef2bc18
    
          Device Boot      Start         End      Blocks   Id  System
    /dev/pmem0p1            2048     4196351     2097152   83  Linux
    /dev/pmem0p2         4198400   179597311    87699456   83  Linux
  4. Create an XFS file system with the data partition as the real time device and an extent size of 2 MB.
    mkfs.xfs -m rmapbt=0,reflink=0 -d rtinherit=1 -r rtdev=/dev/pmem0p2,extsize=2m /dev/pmem0p1
  5. Mount the Persistent Memory (PMEM) device with DAX using the following real time device mount options.
    mount /dev/pmem0p1 /mnt -o dax,rtdev=/dev/pmem0p2