Skip to main content

lun create

Suggest changes

Create a new LUN

Availability: This command is available to cluster and Vserver administrators at the admin privilege level.


This command creates a new LUN of a specific size. You cannot create a LUN at a path that already exists. You must create LUNs at the root of a volume or qtree. You can not create LUNs in the Vserver root volume.

You might find it useful to provide a meaningful path name for the LUN and containing volume. For example, you might choose a name that describes how the LUN is used, such as the name of the application, the type of data that it stores, or the user accessing the data. Examples are /vol/database/lun0, /vol/finance/lun1, and /vol/bill/lun2.

It is recommended that you distribute LUNs across the cluster.

When you can create a LUN, the size of the LUN could be larger than what you specified. The system generates a message if the size of the LUN is different from what you specified.

By default, when you create a LUN, it is online and it is space-reserved. Use the lun offline command to take a LUN offline. When you set space reserved to false, the LUN is non-space reserved.

Note For non-space reserved LUNs, write operations to that LUN might fail due to insufficient disk space. As a result, the host application or operating system might crash.
Note When you create a LUN from a file, that file cannot be deleted without deleting the LUN itself.
Note This command is not supported for FlexGroups or Vservers with Infinite Volumes.


-vserver <Vserver Name> - Vserver Name

Specifies the Vserver.

{ -path <path> - LUN Path

Specifies the path of the new LUN. The LUN path cannot contain any files. Examples of correct LUN paths are /vol/vol1/lun1 and /vol/vol1/qtree1/lun1 .

| -volume <volume name> - Volume Name

Specifies the volume that contains the new LUN.

[-qtree <qtree name>] - Qtree Name

Specifies the qtree that contains the new LUN.

-lun <text> - LUN Name }

Specifies the new LUN name. A LUN name is a case-sensitive name and has the following requirements:

  • Must contain one to 255 characters. Spaces are not allowed.

  • Can contain the letters A-Z, a-z, numbers 0-9, "-", "_", "}", "{", and ".".

{ -s, -size <size> - LUN Size

Specifies the size of the LUN in bytes. You can specify a one-character multiplier suffix:

  • c (1 byte)

  • w (2 bytes)

  • B (512 bytes)

  • k (1024 bytes)

  • M (k*k bytes)

  • G (k*m bytes)

  • T (m*m bytes)

[-use-exact-size <true>] - Use Exact Size

Create the LUN using the exact value specified by the -size parameter instead of rounding the size to best fit the LUN geometry. Size of the LUN must be a multiple of 512 bytes.

| -f, -file-path <text> - File Path }

Creates a LUN using the file path as the source.

| [-foreign-disk <text>] - Foreign Disk Serial number }

LUN is created with the same attributes (size, alignment, bytes per sector and so on) as the specified foreign disk.

[-P, -prefix-size <size>] - Prefix Size

Specifies the size of the prefix stream for the new LUN.

-t, -ostype {vmware|hyper_v|windows_2008|windows_gpt|windows|linux|xen|solaris|solaris_efi|hpux|aix|netware|openvms} - OS Type

Specifies the OS type for the new LUN. The OS types are:

  • aix - the LUN stores AIX data.

  • hpux - the LUN stores HP-UX data.

  • hyper_v - the LUN stores Windows Server 2008 or Windows Server 2012 Hyper-V data

  • linux - the LUN stores a Linux raw disk without a partition table.

  • netware - the LUN stores NetWare data.

  • openvms - the LUN stores Open-VMS data

  • solaris - the LUN stores Solaris raw disk in a single-slice partition.

  • solaris_efi - the LUN stores Solaris_EFI data.

  • vmware - the LUN stores VMware data

  • windows - the LUN stores a raw disk type in a single-partition Windows disk using the Master Boot Record (MBR) partitioning style.

  • windows_gpt - the LUN stores Windows data using the GUID Partition Type (GPT) partitioning style.

  • windows_2008 - the LUN stores Windows data for Windows 2008 and 2012 systems.

  • xen - the LUN stores Xen data

[-space-reserve {enabled|disabled}] - Space Reservation

Specifies whether the space reservation setting is enabled or disabled for the new LUN. If you set the parameter to enabled , the LUN is space-reserved. If you set the parameter to disabled , the LUN is non-space reserved. The default is enabled .

[-comment <text>] - Comment

A description for the LUN you want to create. If the comment string contains white space, you must enclose the comment string in double quotes. The limit is 254 characters.

[-space-allocation {enabled|disabled}] - Space Allocation

Specifies the value for the space allocation attribute of the LUN. The space allocation attribute determines if the LUN supports the SCSI Thin Provisioning features defined in the Logical Block Provisioning section of the SCSI SBC-3 standard.

Specifying enabled for this parameter enables support for the SCSI Thin Provisioning features.

Specifying disabled for this parameter disables support for the SCSI Thin Provisioning features.

Hosts and file systems that do not support SCSI Thin Provisioning should not enable space allocation.

The default is disabled .

[-class {regular|protocol-endpoint|vvol}] - Class

Specifies the class of the new LUN. The class types are:

  • regular - the LUN is for normal blocks protocol access. This is the default value.

  • protocol-endpoint - the LUN is a vvol protocol endpoint.

  • vvol - the LUN is a vvol data LUN.

[-qos-policy-group <text>] - QoS Policy Group

This optionally specifies which QoS policy group to apply to the LUN. This policy group defines measurable service level objectives (SLOs) that apply to the storage objects with which the policy group is associated. If you do not assign a policy group to a LUN, the system will not monitor and control the traffic to it.

Note If you specify this parameter for a LUN that you want to create from a file and that file belongs to a QoS policy group, Data ONTAP adds the LUN to the specified policy group and removes the file from its policy group. Both the file and the LUN that you created from the file cannot belong to QoS policy groups.
[-caching-policy <text>] - Caching Policy Name

This optionally specifies the caching policy to apply to the LUN. A caching policy defines how the system caches this volume's data in Flash Cache modules. If a caching policy is not assigned to this LUN, the system uses the caching policy that is assigned to the containing volume or Vserver. If a caching policy is not assigned to the containing volume or Vserver, the system uses the default cluster-wide policy. The available caching policies are:

  • none - Does not cache any user data or metadata blocks.

  • auto - Read caches all metadata and randomly read user data blocks, and write caches all randomly overwritten user data blocks.

  • meta - Read caches only metadata blocks.

  • random_read - Read caches all metadata and randomly read user data blocks.

  • random_read_write - Read caches all metadata, randomly read and randomly written user data blocks.

  • all_read - Read caches all metadata, randomly read and sequentially read user data blocks.

  • all_read_random_write - Read caches all metadata, randomly read, sequentially read, and randomly written user data.

  • all - Read caches all data blocks read and written. It does not do any write caching.

Default caching-policy is auto.


cluster1::> lun create -vserver vs1 -path /vol/vol1/lun1 -size 100M -ostype linux

Creates a 100MB LUN at path /vol/vol1/lun1 in Vserver vs1 . The OS type is Linux, and the state is online.