New-Volume

New-Volume

Creates a volume with the specified file system.

Syntax

Parameter Set: ByDisk
New-Volume [-Disk] <CimInstance> -FriendlyName <String> [-AccessPath <String> ] [-AllocationUnitSize <UInt32> ] [-CimSession <CimSession> ] [-DriveLetter <Char> ] [-FileSystem <FileSystemType> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>] [ <WorkflowParameters>]

Parameter Set: ByDiskNumber
New-Volume [-DiskNumber] <UInt32> -FriendlyName <String> [-AccessPath <String> ] [-AllocationUnitSize <UInt32> ] [-CimSession <CimSession> ] [-DriveLetter <Char> ] [-FileSystem <FileSystemType> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>] [ <WorkflowParameters>]

Parameter Set: ByDiskPath
New-Volume -DiskPath <String> -FriendlyName <String> [-AccessPath <String> ] [-AllocationUnitSize <UInt32> ] [-CimSession <CimSession> ] [-DriveLetter <Char> ] [-FileSystem <FileSystemType> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>] [ <WorkflowParameters>]

Parameter Set: ByDiskUniqueId
New-Volume -DiskUniqueId <String> -FriendlyName <String> [-AccessPath <String> ] [-AllocationUnitSize <UInt32> ] [-CimSession <CimSession> ] [-DriveLetter <Char> ] [-FileSystem <FileSystemType> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>] [ <WorkflowParameters>]

Parameter Set: ByStoragePool
New-Volume [-StoragePool] <CimInstance> -FriendlyName <String> [-AccessPath <String> ] [-AllocationUnitSize <UInt32> ] [-CimSession <CimSession> ] [-DriveLetter <Char> ] [-FileSystem <FileSystemType> ] [-MediaType <New-Volume.MediaType> ] [-NumberOfColumns <UInt16> ] [-NumberOfGroups <UInt16> ] [-PhysicalDiskRedundancy <UInt16> ] [-ProvisioningType <Microsoft.PowerShell.Cmdletization.GeneratedTypes.SetStoragePool.ProvisioningType> ] [-ReadCacheSize <UInt64> ] [-ResiliencySettingName <String> ] [-Size <UInt64> ] [-StorageTierFriendlyNames <String[]> ] [-StorageTiers <CimInstance[]> ] [-StorageTierSizes <UInt64[]> ] [-ThrottleLimit <Int32> ] [-UseMaximumSize] [-WriteCacheSize <UInt64> ] [ <CommonParameters>] [ <WorkflowParameters>]

Parameter Set: ByStoragePoolFriendlyName
New-Volume -FriendlyName <String> -StoragePoolFriendlyName <String> [-AccessPath <String> ] [-AllocationUnitSize <UInt32> ] [-CimSession <CimSession> ] [-DriveLetter <Char> ] [-FileSystem <FileSystemType> ] [-MediaType <New-Volume.MediaType> ] [-NumberOfColumns <UInt16> ] [-NumberOfGroups <UInt16> ] [-PhysicalDiskRedundancy <UInt16> ] [-ProvisioningType <Microsoft.PowerShell.Cmdletization.GeneratedTypes.SetStoragePool.ProvisioningType> ] [-ReadCacheSize <UInt64> ] [-ResiliencySettingName <String> ] [-Size <UInt64> ] [-StorageTierFriendlyNames <String[]> ] [-StorageTiers <CimInstance[]> ] [-StorageTierSizes <UInt64[]> ] [-ThrottleLimit <Int32> ] [-UseMaximumSize] [-WriteCacheSize <UInt64> ] [ <CommonParameters>] [ <WorkflowParameters>]

Parameter Set: ByStoragePoolName
New-Volume -FriendlyName <String> -StoragePoolName <String> [-AccessPath <String> ] [-AllocationUnitSize <UInt32> ] [-CimSession <CimSession> ] [-DriveLetter <Char> ] [-FileSystem <FileSystemType> ] [-MediaType <New-Volume.MediaType> ] [-NumberOfColumns <UInt16> ] [-NumberOfGroups <UInt16> ] [-PhysicalDiskRedundancy <UInt16> ] [-ProvisioningType <Microsoft.PowerShell.Cmdletization.GeneratedTypes.SetStoragePool.ProvisioningType> ] [-ReadCacheSize <UInt64> ] [-ResiliencySettingName <String> ] [-Size <UInt64> ] [-StorageTierFriendlyNames <String[]> ] [-StorageTiers <CimInstance[]> ] [-StorageTierSizes <UInt64[]> ] [-ThrottleLimit <Int32> ] [-UseMaximumSize] [-WriteCacheSize <UInt64> ] [ <CommonParameters>] [ <WorkflowParameters>]

Parameter Set: ByStoragePoolUniqueId
New-Volume -FriendlyName <String> -StoragePoolUniqueId <String> [-AccessPath <String> ] [-AllocationUnitSize <UInt32> ] [-CimSession <CimSession> ] [-DriveLetter <Char> ] [-FileSystem <FileSystemType> ] [-MediaType <New-Volume.MediaType> ] [-NumberOfColumns <UInt16> ] [-NumberOfGroups <UInt16> ] [-PhysicalDiskRedundancy <UInt16> ] [-ProvisioningType <Microsoft.PowerShell.Cmdletization.GeneratedTypes.SetStoragePool.ProvisioningType> ] [-ReadCacheSize <UInt64> ] [-ResiliencySettingName <String> ] [-Size <UInt64> ] [-StorageTierFriendlyNames <String[]> ] [-StorageTiers <CimInstance[]> ] [-StorageTierSizes <UInt64[]> ] [-ThrottleLimit <Int32> ] [-UseMaximumSize] [-WriteCacheSize <UInt64> ] [ <CommonParameters>] [ <WorkflowParameters>]




Detailed 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).

Parameters

-AccessPath<String>

Specifies a drive letter, or a mount point.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AllocationUnitSize<UInt32>

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CimSession<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.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Disk<CimInstance>

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


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true(ByValue)

Accept Wildcard Characters?

false

-DiskNumber<UInt32>

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


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DiskPath<String>

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


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DiskUniqueId<String>

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


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DriveLetter<Char>

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FileSystem<FileSystemType>

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,


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FriendlyName<String>

Specifies the friendly name to use for the volume.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MediaType<New-Volume.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.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NumberOfColumns<UInt16>

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.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NumberOfGroups<UInt16>

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.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PhysicalDiskRedundancy<UInt16>

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.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ProvisioningType<Microsoft.PowerShell.Cmdletization.GeneratedTypes.SetStoragePool.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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ReadCacheSize<UInt64>

This parameter is no longer supported.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ResiliencySettingName<String>

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.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Size<UInt64>

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.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-StoragePool<CimInstance>

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


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true(ByValue)

Accept Wildcard Characters?

false

-StoragePoolFriendlyName<String>

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


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-StoragePoolName<String>

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


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-StoragePoolUniqueId<String>

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


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-StorageTierFriendlyNames<String[]>

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-StorageTiers<CimInstance[]>

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-StorageTierSizes<UInt64[]>

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ThrottleLimit<Int32>

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.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UseMaximumSize

Indicates that this cmdlet creates the largest volumn possible.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WriteCacheSize<UInt64>

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:
---- a. If any of the following is true, Auto is set to 1 GB:
------ i. 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.
------ ii. 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.
---- b. 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.
---- a. 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.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see    about_CommonParameters.

<WorkflowParameters>

This cmdlet supports the following workflow common parameters: -PSParameterCollection, -PSComputerName, -PSCredential, -PSConnectionRetryCount, -PSConnectionRetryIntervalSec, -PSRunningTimeoutSec, -PSElapsedTimeoutSec, -PSPersist, -PSAuthentication, -PSAuthenticationLevel, -PSApplicationName, -PSPort, -PSUseSSL, -PSConfigurationName, -PSConnectionURI, -PSAllowRedirection, -PSSessionOption, -PSCertificateThumbprint, -PSPrivateMetadata, -AsJob, -JobName, and –InputObject. For more information, see    about_WorkflowCommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

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.

Examples

Example 1: Create a volume on a mirror space

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.


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

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

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.


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

Related topics

Community Additions

ADD
Show: