[parted-devel] [PATCH] Add support for NVDIMM devices

Sebastian Parschauer sparschauer at suse.de
Thu Nov 2 10:41:43 UTC 2017


On 02.11.2017 01:35, Brian C. Lane wrote:
> On Wed, Nov 01, 2017 at 09:43:04AM -0400, Phil Susi wrote:
>> On 10/24/2017 4:22 AM, Sebastian Parschauer wrote:
>>> Recognize NVDIMM devices, so that "parted -s /dev/pmem7 p" now
>>> prints "Model: NVDIMM Device (pmem)" instead of
>>> "Model: Unknown (unknown)".
>>>
>>> In order for a device to be recognized as NVDIMM, it has to
>>> have a 'blkext' major number. But since this major can be
>>> used also by other device types, we also check that the device
>>> path contains 'pmem' as a substring.
>>
>> That will break if someone runs parted on /dev/disk/by-id or some such.
>> There must be a more reliable way to decide if it is an nvdimm device.
>> What about something in the device's sysfs node?
> 
> My understanding is that this is the only way to tell what these new
> devices are, and we're already doing the same thing for nvme. It's
> limited by a couple of things:
> 
>  1. Only blkext major's will be considered.
>  2. It's at the end of the if/else so SCSI, etc. have already been
>     checked.
>  3. The filename path is canonicalized by ped_device_get before calling
>     new() so internally we're always using the /dev/pmem name no matter
>     what the symlink says.
> 
> So I think this is pretty safe.

Exactly, thanks!

# cd /dev/disk/by-id
# ln -s /dev/pmem7 NVDIMM
# parted /dev/disk/by-id/NVDIMM p
Model: NVDIMM Device (pmem)

Looks like we don't have udev rules for those yet. Any HW independent
partition table can be put on those devices as they are usually not used
for booting from them. Usually those devices are regular RAM DIMMs on
one side and have flash cells on the other side. Special power supplies,
special motherboard and special FW are required to keep those DIMMs
powered on long enough to store the data to the flash cells. It is a bit
similar to the NVRAM of HW RAID controllers.

This can be used e.g. for persisting in-memory data bases. In the future
there will be really persistent RAM like e.g. ReRAM (Resistive RAM).



More information about the parted-devel mailing list