Lvcreate

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Options

-n

Sets the name for the new logical volume. If not specified, a default name will be generated.

--type

The segment type for the logical volume:

  • linear
  • striped
  • thin-pool
  • thin
  • snapshot

For more details, see:

Logical Volume Types

--size

--size LogicalVolumeSize[b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E]

Gives the size to allocate for the new logical volume. A size suffix of B for bytes, S for sectors as 512 bytes, K for kilobytes, M for megabytes, G for gigabytes, T for terabytes, P for petabytes or E for exabytes is optional. Default unit is megabytes.

--chunksize

--chunksize ChunkSize[b|B|s|S|k|K|m|M|g|G]


Gives the size of chunk for snapshot, cache pool and thin pool logical volumes. Default unit is in kilobytes. For snapshots the value must be power of 2 between 4KiB and 512KiB and the default value is 4KiB. For cache pools the value must a multiple of 32KiB between 32KiB and 1GiB. The default is 64KiB. When the size is specified with volume caching, it may not be smaller than cache pool creation chunk size was. For thin pools the value must be a multiple of 64KiB between 64KiB and 1GiB. Default value starts with 64KiB and grows up to fit the pool metadata size within 128MiB, if the pool metadata size is not specified. See lvm.conf(5) setting allocation/thin_pool_chunk_size_policy to select different calculation policy.

--poolmetadatasize

--poolmetadatasize MetadataVolumeSize[b|B|s|S|k|K|m|M|g|G]

Sets the size of pool's metadata logical volume. Supported values are in range between 2MiB and 16GiB for thin pool, and upto 16GiB for cache pool. The minimum value is computed from pool's data size. Default value for thin pool is (Pool_LV_size / Pool_LV_chunk_size * 64b). To work with a thin pool, there should be at least 25% of free space when the size of metadata is smaller then 16MiB, or at least 4MiB of free space otherwise. Default unit is megabytes.

Create a Thin Pool Logical Volume

lvcreate -y --type thin-pool --zero n --size LogicalVolumeSize --chunksize $CHUNK_SIZE_ARG --poolmetadatasize ${META_SIZE}s -n docker-pool docker_vg