6.5 Create Linux Volume

create linux volume <type> <<device> [size] | <part>> [mp] [mkopt] [mntopt] [lvm] [name] [group] [shared] [ip] [ncp] [volid]

Create a Linux POSIX volume on a device.

nlvm [nlvm_options] create linux volume <type> <<device> [size] | <part>> [mp] [mkopt] [mntopt] [lvm] [name] [group] [shared] [ip] [ncp] [volid]

For a cluster-enabled LVM volume, issue the command from the master node in the cluster.

Command Options

type=fstype

Mandatory. Specify the type of Linux POSIX file system to use for mkfs.

Supported file system types are btrfs (in OES 11 SP1 and later; requires the btrfsprogs package), ext2, ext3, ext4, reiserfs, and xfs.

Examples

type=ext3
type=reiserfs
device=<devicename|anydisk>

Mandatory unless the part option is used. Specify the device to use for the Linux POSIX volume, or specify the keyword anydisk.

IMPORTANT:NLVM does not support using Linux software RAID devices or NSS software RAID devices with Linux POSIX file systems. You can use a hardware RAID device to achieve device fault tolerance for Linux POSIX volumes.

If the device is seen by a single server, or a single node in a cluster, do not use the shared option.

If the device is seen by multiple nodes in a OES Cluster Services cluster, you must specify the devicename and use the shared, ip, name, lvm, and group (optional) options to create the Linux volume group cluster resource. Specify an unshared initialized device. For OES 11 SP2 and later, you can alternatively specify a shared device with no data partitions or an uninitialized device. The cluster-enabled LVM volume group uses the entire device. OES Cluster Services mounts the cluster resource exclusively on one node at a time.

Examples

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

Mandatory unless the shared option is used, or unless the part option is used instead of the device option. Specify a size of the partition to create for the Linux volume, or specify max to use all of the free unpartitioned space for the volume. The minimum allowed size is 8 MB.

If the shared option is used, the entire device is dedicated to the LVM volume group. If the size option is specified, it is ignored.

If the part option is used, the entire partition is dedicated to the volume. If the size option is specified, it is ignored.

Examples

size=20G
size=100m
size=max
part=partition_name

Specify the node name (such as sdc2) for the partition you want to use for a non-clustered volume. The partition must exist; it is not created with this command. The partition type must be compatible with the type of Linux volume you want to create on it, such as type 83 for a Linux native volume or type 8E for a Linux LVM volume. The entire partition is used for the volume you create.

Do not specify the part option in combination with the device option. The size option is ignored.

Do not specify the part option in combination with the shared option. You can use a partition only for non-clustered volumes.

Example

part=sdc2
mp=</mount_path>

Specify the path of the mount point where the volume is to be mounted. If the path does not currently exist, it will be created.

For LVM volumes, the name option must be used with the lvm option to specify a volume name. The full mount point path can specify a directory path that is the same or different than the specified volume name. If a mount path is not specified for an LVM volume or a clustered LVM volume, the utility assigns a default mount path of /usr/novell/<volume_name>.

For Linux POSIX volumes, the final directory of the full mount point path is used as the volume name. For example, if the mount point is /home/users/bob, the volume name is bob. The final directory name must be unique as a volume name on the server. If you use the ncp option, the NCP volume name is based on the final directory name, but all letters are capitalized. Ensure that the final directory name does not exceed 14 characters and does not use special characters. Letters A-Z, letters a-z, numbers 0-9, and underscores are supported.

If a mount path is not specified for a Linux POSIX volume, the utility assigns a default mount path of /usr/novell/<file_system_type>_<next_available_number>. For example, if the file system type is ext3, the default mount path is /usr/novell/ext3_0. If that path is not available, the path is /usr/novell/ext3_1, and so forth until a unique volume name is achieved.

Example

mp=/home
mkopt=<option1[,option2,...]>

Specify the options to use when running mkfs. For a list of available options, see the mkfs(8) man page. No default option is specified.

Example

mkopt=-v
mntopt=<option1[,option2[],...]>

Specify the options to use when mounting the volume. For a list of available options, see the mount(8) man page. The default mntopt value is rw.

Example

mntopt=rw
lvm

Used to specify that an LVM volume and volume group is to be created.

If the lvm option is used, the name option must be provided to specify a name for the LVM volume. Specifying a different name for the LVM volume group is optional.

Example

lvm
name=<lvm_volume_name>

Used with the lvm option to specify a name for the LVM volume.

If you do not specify the group option, this name is also used as the LVM volume group name.

For LVM logical volume naming conventions, see Section 5.2.5, Linux LVM Volume Group and Logical Volume Names. If you use the ncp option, the NCP volume name is based on the LVM volume name, but all letters are capitalized. Ensure that the name does not exceed 14 characters and does not use special characters. Letters A-Z, letters a-z, numbers 0-9, and underscores are supported.

If the lvm option is not specified, this option is ignored.

Example

name=mylvmvol1
group=<lvm_volume_group_name>

Optional. Used with the lvm option to specify a name for the LVM volume group. If the group option is not specified, the volume group name is the same as the LVM volume name.

For LVM volume group naming conventions, see Section 5.2.5, Linux LVM Volume Group and Logical Volume Names.

If the lvm option is not specified, this option is ignored.

Example

group=clustervg01
shared

Used to cluster-enable an LVM volume group. This creates an LVM volume group cluster resource, including its load, unload, and monitoring scripts, for use in an existing OES Cluster Services cluster. The cluster resource name is the LVM volume group name plus _resource; that is, <lvm_vg_name>_resource. For example, mylvmvg01_resource. The resource is created and set to an Offline state. You can use the Clusters plug-in in iManager to modify the scripts and resource settings as needed, and then use iManager or cluster commands to online the resource.

If the shared option is used, the ip, name, and lvm options must also be provided. You can use the group option to specify a different name for the LVM volume group.

The device should already be initialized, but do not mark the device as shareable. The LVM volume group uses the entire device. Use OES Cluster Services tools or commands to online the cluster resource exclusively on one node at a time.

Examples

shared lvm ip=10.10.10.101 name=mylvmvol1
shared lvm ip=10.10.10.101 name=mylvmvol1 group=mylvmvg1
ip=<IP_address_for_LVM_volgroup_cluster_resource>

Used with the shared option to specify the IP address to use for the Linux volume group cluster resource. This is required for cluster-enabled Linux volume groups on OES Cluster Services clusters. Specify the IP address in IPv4 format.

If the shared option is not specified, this option is ignored.

Example

ip=10.10.10.101
ncp

Used to enable the Linux POSIX file system on the volume to be accessed with the NetWare Control Protocol (NCP). An NCP volume ID is assigned automatically to the volume. You can use the volid option in combination with the shared and ncp options to assign an NCP volume ID for a clustered LVM volume.

If you use the ncp option, the volume name used for the name option must comply with the name limitations described in Section 5.2.4, NCP Volume Names.

volid=value

(Optional) Used in combination with the shared and ncp options to assign an NCP volume ID for a clustered LVM volume. If the volid option is not used, a volume ID is automatically assigned. For clustered volumes, the valid range is 254 to 0, in descending order.

In a OES Cluster Services cluster, the volume ID must be unique across all member nodes. In a Business Continuity Cluster, the volume ID must be unique across all nodes in every peer cluster.

Example

lvm shared ip=10.10.10.134 name=lvmvol40 ncp volid=240

The volid option requires the shared and ncp options. The shared option requires the lvm, ip, and name options.

Command Examples

nlvm create linux volume type=ext3 device=sdf size=10G mp=/home/bob mntopt=rw

Create a 10 GB Linux POSIX volume using the Ext3 file system on the /dev/sdf device. Mount the volume on path /home/bob with the Read/Write mount option.

nlvm create linux volume type=ext3 device=/dev/sdf mp=/home/bob mntopt=rw lvm shared ip=10.10.10.101 group=clustervgbob name=clustervolbob

Create and cluster-enable an LVM volume group on the /dev/sdf device with a resource IP address of 10.10.10.101, an LVM volume name of clustervolbob, and an LVM volume group name of clustervgbob. Create a Linux POSIX volume on the LVM volume using the Ext3 file system. The entire device is dedicated to the LVM volume.

This command automatically creates an LVM volume group cluster resource called clustervgbob_resource in a OES Cluster Services cluster where the node is a member. It creates its resource load, unload, and monitoring scripts; sets the resource to offline; and waits to be brought online by using the cluster commands. You manage the resource by using OES Cluster Services tools and commands.

nlvm create linux volume type=ext3 device=sdf mp=/home/bob mntopt=rw lvm shared ip=10.10.10.101 group=clustervgbob name=clustervolbob ncp volid=240

Create and cluster-enable an LVM volume group on the /dev/sdf device with a resource IP address of 10.10.10.101, an LVM volume group name of clustervgbob, and an LVM volume name of clustervolbob. Create a Linux POSIX volume on the LVM volume using the Ext3 file system. The entire device is dedicated to the LVM volume.

NCP-enable the volume and automatically assign it the NCP name of CLUSTERVOLBOB, which is the assigned LVM name in all capital letters. Assign it the NCP volume ID of 240, which the administrator knows to be unique across all member nodes in the OES Cluster Services cluster and across all peer clusters in a Business Continuity Cluster.

This command automatically creates an LVM volume group cluster resource called clustervgbob_resource in a OES Cluster Services cluster where the node is a member. It creates its resource load, unload, and monitoring scripts; sets the resource to offline; and waits to be brought online by using the cluster commands. You manage the resource by using OES Cluster Services tools and commands.