// SPDX-License-Identifier: GPL-2.0

cxl-set-partition(1)
====================

NAME
----
cxl-set-partition - set the partitioning between volatile and persistent capacity on a CXL memdev

SYNOPSIS
--------
[verse]
'cxl set-partition <mem0> [ [<mem1>..<memN>] [<options>]'

DESCRIPTION
-----------
CXL devices may support both volatile and persistent memory capacity.
The amount of device capacity set aside for each type is typically
established at the factory, but some devices also allow for dynamic
re-partitioning.

Use this command to partition a device into volatile and persistent
capacity. The change in partitioning becomes the “next” configuration,
to become active on the next device reset.

Use "cxl list -m <memdev> -I" to examine the partitioning capabilities
of a device. A partition_alignment_size value of zero means there is
no available capacity and therefore the partitions cannot be changed.

Using this command to change the size of the persistent capacity shall
result in the loss of data stored.

OPTIONS
-------
<memory device(s)>::
include::memdev-option.txt[]

include::bus-option.txt[]

-t::
--type=::
	Type of partition, 'pmem' or 'ram' (volatile), to modify.
	Default: 'pmem'

-s::
--size=::
	Size of the <type> partition in bytes. Size must align to the
	devices alignment requirement. Use 'cxl list -m <memdev> -I'
	to find 'partition_alignment_size', or, use the --align option.
	Default: All available capacity is assigned to <type>.

-a::
--align::
	Select this option to allow the automatic alignment of --size
	to meet device alignment requirements. When using this option,
	specify the minimum --size of the --type partition needed. When
	this option is omitted, the command fails if --size is not
	properly aligned. Use 'cxl list -m <memdev> -I' to examine the
	partition_alignment_size.

-v::
        Turn on verbose debug messages in the library (if libcxl was built with
        logging and debug enabled).

include::../copyright.txt[]

SEE ALSO
--------
linkcxl:cxl-list[1],
CXL-2.0 8.2.9.5.2
