New-Volume

Creates a volume with the specified file system.

Syntax

New-Volume
   [-StoragePool] <CimInstance>
   -FriendlyName <String>
   [-FileSystem <FileSystemType>]
   [-AccessPath <String>]
   [-DriveLetter <Char>]
   [-AllocationUnitSize <UInt32>]
   [-Size <UInt64>]
   [-ResiliencySettingName <String>]
   [-ProvisioningType <ProvisioningType>]
   [-MediaType <MediaType>]
   [-PhysicalDiskRedundancy <UInt16>]
   [-NumberOfColumns <UInt16>]
   [-NumberOfGroups <UInt16>]
   [-StorageTiers <CimInstance[]>]
   [-StorageTierFriendlyNames <String[]>]
   [-StorageTierSizes <UInt64[]>]
   [-WriteCacheSize <UInt64>]
   [-ReadCacheSize <UInt64>]
   [-UseMaximumSize]
   [-CimSession <CimSession>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [<CommonParameters>]
New-Volume
   -StoragePoolFriendlyName <String>
   -FriendlyName <String>
   [-FileSystem <FileSystemType>]
   [-AccessPath <String>]
   [-DriveLetter <Char>]
   [-AllocationUnitSize <UInt32>]
   [-Size <UInt64>]
   [-ResiliencySettingName <String>]
   [-ProvisioningType <ProvisioningType>]
   [-MediaType <MediaType>]
   [-PhysicalDiskRedundancy <UInt16>]
   [-NumberOfColumns <UInt16>]
   [-NumberOfGroups <UInt16>]
   [-StorageTiers <CimInstance[]>]
   [-StorageTierFriendlyNames <String[]>]
   [-StorageTierSizes <UInt64[]>]
   [-WriteCacheSize <UInt64>]
   [-ReadCacheSize <UInt64>]
   [-UseMaximumSize]
   [-CimSession <CimSession>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [<CommonParameters>]
New-Volume
   -StoragePoolName <String>
   -FriendlyName <String>
   [-FileSystem <FileSystemType>]
   [-AccessPath <String>]
   [-DriveLetter <Char>]
   [-AllocationUnitSize <UInt32>]
   [-Size <UInt64>]
   [-ResiliencySettingName <String>]
   [-ProvisioningType <ProvisioningType>]
   [-MediaType <MediaType>]
   [-PhysicalDiskRedundancy <UInt16>]
   [-NumberOfColumns <UInt16>]
   [-NumberOfGroups <UInt16>]
   [-StorageTiers <CimInstance[]>]
   [-StorageTierFriendlyNames <String[]>]
   [-StorageTierSizes <UInt64[]>]
   [-WriteCacheSize <UInt64>]
   [-ReadCacheSize <UInt64>]
   [-UseMaximumSize]
   [-CimSession <CimSession>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [<CommonParameters>]
New-Volume
   -StoragePoolUniqueId <String>
   -FriendlyName <String>
   [-FileSystem <FileSystemType>]
   [-AccessPath <String>]
   [-DriveLetter <Char>]
   [-AllocationUnitSize <UInt32>]
   [-Size <UInt64>]
   [-ResiliencySettingName <String>]
   [-ProvisioningType <ProvisioningType>]
   [-MediaType <MediaType>]
   [-PhysicalDiskRedundancy <UInt16>]
   [-NumberOfColumns <UInt16>]
   [-NumberOfGroups <UInt16>]
   [-StorageTiers <CimInstance[]>]
   [-StorageTierFriendlyNames <String[]>]
   [-StorageTierSizes <UInt64[]>]
   [-WriteCacheSize <UInt64>]
   [-ReadCacheSize <UInt64>]
   [-UseMaximumSize]
   [-CimSession <CimSession>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [<CommonParameters>]
New-Volume
   [-Disk] <CimInstance>
   -FriendlyName <String>
   [-FileSystem <FileSystemType>]
   [-AccessPath <String>]
   [-DriveLetter <Char>]
   [-AllocationUnitSize <UInt32>]
   [-CimSession <CimSession>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [<CommonParameters>]
New-Volume
   [-DiskNumber] <UInt32>
   -FriendlyName <String>
   [-FileSystem <FileSystemType>]
   [-AccessPath <String>]
   [-DriveLetter <Char>]
   [-AllocationUnitSize <UInt32>]
   [-CimSession <CimSession>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [<CommonParameters>]
New-Volume
   -DiskPath <String>
   -FriendlyName <String>
   [-FileSystem <FileSystemType>]
   [-AccessPath <String>]
   [-DriveLetter <Char>]
   [-AllocationUnitSize <UInt32>]
   [-CimSession <CimSession>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [<CommonParameters>]
New-Volume
   -DiskUniqueId <String>
   -FriendlyName <String>
   [-FileSystem <FileSystemType>]
   [-AccessPath <String>]
   [-DriveLetter <Char>]
   [-AllocationUnitSize <UInt32>]
   [-CimSession <CimSession>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [<CommonParameters>]

Description

The New-Volume cmdlet creates a volume with the specified file system. The cmdlet manages the creation of the virtual disk with the specified size and resiliency setting, initializes the disk, creates a partition on it and formats the volume with the specified file system, including Cluster Shared Volumes (CSVs).

Examples

Example 1: Create a volume on a mirror space

PS C:\> New-Volume -StoragePoolName "CompanyData" -FriendlyName "TestVolume" -Size 10GB -ResiliencySettingName "Mirror" -FileSystem NTFS -AccessPath "M: "-ProvisioningType Fixed

This command creates a new storage space in the CompanyData pool using the Mirror resiliency setting and fixed provisioning, and then formats the volume with the NTFS file system and assigns drive letter M.

Example 2: Create a volume on a new tiered storage space

PS C:\>New-Volume -StoragePoolFriendlyName "CompanyData" -FriendlyName "UserData" -AccessPath "M:" -ResiliencySettingName "Mirror" -ProvisioningType "Fixed" -StorageTiers (Get-StorageTier -FriendlyName "*SSD*"), (Get-StorageTier -FriendlyName "*HDD*") -StorageTierSizes 20GB, 80GB -FileSystem NTFS

This command creates new storage space in the CompanyData pool using the Mirror resiliency setting, fixed provisioning, a 20 GB SSD storage tier, and an 80 GB HDD storage tier, and then formats the volume with the NTFS file system and assigns drive letter M.

Example 3: Create a volume on disk

PS C:\>Get-Disk | Where-Object OperationalStatus -eq 'Offline'|
         Initialize-Disk -PartitionStyle GPT -PassThru |
            New-Volume -FileSystem NTFS -DriveLetter F -FriendlyName 'New-Volume'

` This command initializes a new disk added to a host then creates a new volume on each new disk.

Parameters

-AccessPath

Specifies a drive letter, or a mount point.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AllocationUnitSize

Specifies the allocation unit size to use when creating the volume.

Type:UInt32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AsJob

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Type:CimSession
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Disk

Specifies a Disk object. To obtain a Disk object, use the Get-Disk cmdlet.

Type:CimInstance
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DiskNumber

Specifies the disk number of the disk on which to create a volume.

Type:UInt32
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DiskPath

Specifies the path of the disk on which to create a volume.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DiskUniqueId

Specifies the ID of the disk on which to create a volume.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DriveLetter

Specifies the drive letter of the disk on which to create a volume.

Type:Char
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FileSystem

Specified the file system to use on the volume. The acceptable values for this parameter are: NTFS, and ReFS, as well as the cluster shared volume versions of these file systems for use on a scale-out file server: CSVFS_NTFS, and CSVFS_ReFS,

Type:FileSystemType
Accepted values:NTFS, ReFS, CSVFS_NTFS, CSVFS_ReFS
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FriendlyName

Specifies the friendly name to use for the volume.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-MediaType

Specifies the media type of the storage tier. The cmdlet creates the storage tier for the media type that you specify. The acceptable values for this parameter are:

  • SSD
  • SCM
  • HDD

Use SCM for storage-class memory such as NVDIMMs.

Type:MediaType
Accepted values:HDD, SSD, SCM
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NumberOfColumns

Specifies the number of columns to use when creating the volume on a Windows Storage subsystem. Columns represent the number of underlying physical disks across which one stripe of data for a volume is written.

Type:UInt16
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NumberOfGroups

Specifies the number of groups used by Local Reconstruction Coding (LRC) with a dual parity virtual disk. We recommend omitting this parameter and using the defaults.

Type:UInt16
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PhysicalDiskRedundancy

Specifies the physical disk redundancy value to use during the creation of a volume on a Windows Storage subsystem. This value represents how many failed physical disks the volume can tolerate without data loss. Redundancy values are as follows:

  • For two-way mirror spaces, the virtual disk can tolerate 1 failed physical disk without data loss.
  • For three-way mirror spaces, the virtual disk can tolerate 2 failed physical disks without data loss.
  • For single-parity spaces, the virtual disk can tolerate 1 failed physical disk without data loss.
  • For dual-parity spaces the virtual disk can tolerate 2 failed physical disks without data loss.
Type:UInt16
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ProvisioningType

Specifies the type of provisioning. The acceptable values for this parameter are: Fixed and Thin. Specify Fixed for storage spaces that use storage tiers or a clustered storage pool

Type:ProvisioningType
Accepted values:Unknown, Thin, Fixed
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ReadCacheSize

This parameter is no longer supported.

Type:UInt64
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResiliencySettingName

Specifies the resiliency setting (storage layout) to use for the volume. Acceptable values vary by storage subsystem.

Allowed values for the Windows Storage subsystem are: Simple, Mirror, or Parity. By default, when you specify Mirror, Storage Spaces creates a two-way mirror, and when you specify Parity, Storage Spaces creates a single-parity space.

To create a three-way mirror space, specify 3 for the NumberofDataCopies parameter or 2 for the PhysicalDiskRedundancy parameter.

To create a dual-parity space, specify 2 for the PhysicalDiskRedundancy parameter and Fixed provisioning for the ProvisioningType parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Size

Specifies the size of the volume to create. The default unit is bytes. To specify a different unit, enter the size followed by one of the following unit values, with no spaces: Bytes, KB, MB, GB, or TB.

Type:UInt64
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StoragePool

Specifies the storage pool object in which you want to create a volume. To obtain a storage pool object, use the Get-StoragePool cmdlet.

Type:CimInstance
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-StoragePoolFriendlyName

Specifies the friendly name of the storage pool in which to create a volume.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StoragePoolName

Specifies the name of the storage pool in which to create a volume.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StoragePoolUniqueId

Specifies the unique ID of the storage pool in which to create a volume.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StorageTierFriendlyNames

Specifies the names of storage tiers to use when creating the volume.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StorageTiers

Specifies the storage tier objects to use when creating the volume.

Type:CimInstance[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StorageTierSizes

Specifies how big to make each storage tier on this volume.

Type:UInt64[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ThrottleLimit

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UseMaximumSize

Indicates that this cmdlet creates the largest volumn possible.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WriteCacheSize

Specifies the size of the write-back cache. The cmdlet creates the write-back cache of the size that you specify when the cmdlet creates the virtual disk space.

The following describes the behavior of this parameter based on the value that you specify:

  1. If you do not specify this parameter, the cmdlet sets the value of the WriteCacheSizeDefault property from the storage pool.
  2. The default setting of WriteCacheSizeDefault for a storage pool is Auto, which specifies that Windows Server automatically selects the optimal write-back cache size for your configuration. You can change the value of WriteCacheSizeDefault to a concrete value at any time.
  3. The Auto setting for WriteCacheSize operates as follows:
    1. If any of the following is true, Auto is set to 1 GB:
      1. The storage pool contains at least N drives with enough capacity and you set the Usage parameter to Journal. N = 1 for simple spaces, N = 2 for two-way mirror and single parity, N = 3 for three-way mirror and dual parity.
      2. The storage pool contains at least N drives with enough capacity and the media type of the virtual disk is set to SSD. N = 1 for simple spaces, N = 2 for two-way mirror and single parity, N = 3 for three-way mirror and dual parity.
    2. Otherwise, Auto is set to 0 (no log) for simple and mirror spaces, and 32 MB for parity spaces.
  4. If you specify Auto or 0 (zero) for this parameter and the storage space is not a parity space, the cmdlet verifies that either 3.a.i or 3.a.ii is true. If either 3.a.i or 3.a.ii is not true, you cannot set WriteCacheSize to Auto or 0.
    1. The objective of these conditions is to help you avoid scenarios in which you force the creation of a write-back cache in situations that result in slower performance.
Type:UInt64
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

CimInstance

You can use the pipeline operator to pass an MSFT_StoragePool object to the InputObject parameter.

Outputs

CimInstance

This cmdlet outputs an object that represents the newly created volume.

Notes

  • To create a volume on a new storage space with enclosure-awareness enabled (providing resiliency for an entire JBOD enclosure failure), use the Set-StoragePool cmdlet with the -EnclosureAwareDefault $true parameter to set the storage pool to create storage spaces with enclosure awareness enabled by default.
  • When used in Failover Cluster, cmdlets from the Storage module operate on cluster level (all servers in the cluster).