Comment 1 for bug 1853506

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

(k)rafaeldtinoco@emulated:~$ sudo ndctl enable-dimm all
enabled 2 nmems

(k)rafaeldtinoco@emulated:~$ sudo ndctl list -D
[
  {
    "dev":"nmem1",
    "id":"8680-57341200",
    "handle":2,
    "phys_id":0,
    "flag_failed_arm":true
  },
  {
    "dev":"nmem0",
    "id":"8680-56341200",
    "handle":1,
    "phys_id":0,
    "flag_failed_arm":true
  }
]

(k)rafaeldtinoco@emulated:~$ sudo ndctl enable-region all
enabled 2 regions

(k)rafaeldtinoco@emulated:~$ ndctl list -R
[
  {
    "dev":"region1",
    "size":2145386496,
    "available_size":0,
    "max_available_extent":0,
    "type":"pmem",
    "persistence_domain":"unknown"
  },
  {
    "dev":"region0",
    "size":2145386496,
    "available_size":0,
    "max_available_extent":0,
    "type":"pmem",
    "persistence_domain":"unknown"
  }
]

(k)rafaeldtinoco@emulated:~$ sudo ndctl create-namespace -r region0
{
  "dev":"namespace0.0",
  "mode":"fsdax",
  "map":"dev",
  "size":"2014.00 MiB (2111.83 MB)",
  "uuid":"c3621fd1-6b37-4241-956f-eeffdb498872",
  "sector_size":512,
  "align":2097152,
  "blockdev":"pmem0"
}

(k)rafaeldtinoco@emulated:~$ sudo ndctl create-namespace -r region1
{
  "dev":"namespace1.0",
  "mode":"fsdax",
  "map":"dev",
  "size":"2014.00 MiB (2111.83 MB)",
  "uuid":"ec231ca1-cc4a-41e6-892b-e8afd3e36313",
  "sector_size":512,
  "align":2097152,
  "blockdev":"pmem1"
}

(k)rafaeldtinoco@emulated:~$ sudo cat /proc/iomem
...
240000000-2bfdfffff : Persistent Memory
  240000000-2bfdfffff : namespace0.0
2bfe00000-33fbfffff : Persistent Memory
  2bfe00000-33fbfffff : namespace1.0

(k)rafaeldtinoco@emulated:~$ sudo fdisk -l /dev/pmem0
Disk /dev/pmem0: 1.99 GiB, 2111832064 bytes, 4124672 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
Disklabel type: dos
Disk identifier: 0x6e3d7965

Device Boot Start End Sectors Size Id Type
/dev/pmem0p1 4096 4124671 4120576 2G 83 Linux

(k)rafaeldtinoco@emulated:~$ sudo mkfs.ext4 -b 4096 -E stride=512 -F /dev/pmem0
mke2fs 1.45.3 (14-Jul-2019)
Found a dos partition table in /dev/pmem0
Creating filesystem with 515584 4k blocks and 129024 inodes
Filesystem UUID: d6d72f36-28bb-40ed-9108-252e3787b08e
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

k)rafaeldtinoco@emulated:~$ sudo mkfs.ext4 -b 4096 -E stride=512 /dev/pmem0
pmem0# pmem0p1#
(k)rafaeldtinoco@emulated:~$ sudo mkfs.ext4 -b 4096 -E stride=512 /dev/pmem0p1
mke2fs 1.45.3 (14-Jul-2019)
Creating filesystem with 515072 4k blocks and 128768 inodes
Filesystem UUID: 56e9b056-eea1-41dd-9eaa-3f9e66c712d0
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

(k)rafaeldtinoco@emulated:~$ sudo mount /dev/pmem0p1 /mnt

(k)rafaeldtinoco@emulated:/mnt$ sudo dd if=/dev/zero of=./teste bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.70624 s, 397 MB/s