6.6 Create Partition

create partition <type> <device> <size> [label] [dm]

Create a partition on a disk.

nlvm [nlvm_options] create partition <type> <device> <size> [label] [dm]

The number of partitions per device can be limited by the device partitioning scheme, the partition type, or the device driver, whichever is the most restrictive.

  • Partitioning scheme: The MS-DOS format allows up to 4 primary partitions, where 1 can be an extended partition with logical partitions. The GPT format allows up to 128 partitions.

  • Partition type: If a device contains only Novell type partitions, the number of partitions is limited only by the space on the disk. If there are any non-Novell partitions on the device, each partition created, including Novell type partitions, will be a physical partition and limited by Linux to 255 partitions.

  • Device driver: Check your device vendor's documentation to determine driver restrictions. For example, the Hewlett-Packard CCISS device driver supports up to 15 partitions per device, regardless of the partition type.

Best Practices for Creating Partitions

  • Disks using Novell partitions should have only Novell partitions on the device.

  • Do not create more than 15 partitions on a device.

Command Options

type=partition_type

Mandatory. You must specify the partition type in hexadecimal, without the leading 0X.

Before you create a Novell Cluster Services SBD (split brain detector) partition with type=1ad, you must take the cluster down, and stop Novell Cluster Services from running on all nodes.

Examples

type=83  (partition type for Linux)
type=8e  (partition type for Linux LVM)
type=169 (partition type for NSS)
type=1ad (partition type for Novell Cluster Services SBD partition)
type=1ac (partition type for snapshots)
device=<devicename|anydisk|anyshared>

Mandatory. Specify the device to use for the partition, or specify the keyword anydisk or anyshared.

If you use NLVM to create an SBD, the nlvm create partition command can accept an initialized or uninitialized device when you use the type=1ad option. NLVM checks the specified device to see if it is initialized, and takes the following actions:

  • Uninitialized device: NLVM initializes the device, marks it as Shareable for Clustering, and creates the requested SBD partition.

  • Initialized and shared device: NLVM creates the requested SBD partition.

  • Initialized and unshared device: NLVM creates the requested SBD partition, but does not alter the shared state. It returns an error warning that the SBD partition is not shared.

    You must manually mark the device as Shareable for Clustering after the partition is created. You can use the nlvm share command to share the device.

Examples

device=sdb
device=/dev/sdb
device=anydisk
device=anyshared
size=<value[K|M|G|T]|max>

Mandatory. Specify the size of the partition to create, or specify max to use all free unpartitioned space. The minimum allowed size is 1 MB.

Because a physical partition must end on a cylinder boundary, its size might be slightly different than the size you specify. If the size does not fall naturally on a cylinder boundary, the partition size is rounded up or down, depending on the partition type, the size specified, and the amount of free space. For a Novell type partition (NSS or SBD), the size is rounded down. For a Linux type partition, the size is rounded up if enough free space is available; otherwise, the size is rounded down.

Examples

size=20G
size=100.45M
size=max
label="Label for the partition"

Specify the label to be added to a Novell partition type. This option is ignored for other partition types. If the label contains spaces, you must put quotation marks around it. If the label contains a special character, you must escape the character by adding a backslash character (\) in front of it.

If you create a Novell Cluster Services SBD partition, the label should be the cluster name. For example, if the cluster name is cluster1, NLVM creates a partition named cluster1.sbd. If an SBD partition already exists for the cluster, the new partition is named cluster1.sbd1, and the cluster does not recognize it. To use the new partition for the cluster, you must delete the old partition. Then the new partition is automatically renamed as cluster1.sbd, and is used by the cluster.

Examples

label="This label has spaces"
label=engineering
label=special\/character
label=cluster1 
dm

Create a device mapper object for this partition in the /dev/nss directory. This is useful when creating Novell partition types that need to be accessed directly.

Example

dm

Command Examples

nlvm create partition type=169 device=sdb size=20G dm

Create an NSS partition on the /dev/sdb device of size 20 GB. Also create a device mapper object for the partition, /dev/nss/sdb1.1.

nlvm create partition type=83 device=sdc size=200G

Create a Linux partition on the /dev/sdc device of size 200 GB.

nlvm create partition type=8e device=sdf size=200G

Create a Linux LVM partition on the /dev/sdf device of size 200 GB.

nlvm -s create partition type=1ad device=sdg size=max label=cluster1

Take the cluster down and stop Novell Cluster Services. Create a Novell Cluster Services SBD partition on the /dev/sdg device, and use all available free space on the device. Use the -s NLVM option to override the shared locking requirement and force the command to execute.