建立儲存空間直接存取中的磁碟區Creating volumes in Storage Spaces Direct

適用於:Windows Server 2016Applies To: Windows Server 2016

本主題說明如何使用 PowerShell 或容錯移轉叢管理員,建立儲存空間直接存取的磁碟區。This topic describes how to create volumes in Storage Spaces Direct using PowerShell or Failover Cluster Manager.

提示

如果您尚未開始,請先查看規劃儲存空間直接存取中的磁碟區If you haven't already, check out Planning volumes in Storage Spaces Direct first.

使用 PowerShell 建立磁碟區Create volumes using PowerShell

我們建議使用 New-Volume cmdlet 建立儲存空間直接存取的磁碟區。We recommend using the New-Volume cmdlet to create volumes for Storage Spaces Direct. 它提供最快速與最簡單的體驗。It provides the fastest and most straightforward experience. 這個單一 cmdlet 會自動建立虛擬磁碟、磁碟分割以及格式化,以相符名稱建立磁碟區,並將其加入至叢集共用磁碟區 – 全在一個簡易步驟中。This single cmdlet automatically creates the virtual disk, partitions and formats it, creates the volume with matching name, and adds it to cluster shared volumes – all in one easy step.

New-Volume cmdlet 有四個您永遠需要提供的參數:The New-Volume cmdlet has four parameters you'll always need to provide:

  • FriendlyName:任何您想要的字串,例如 "Volume1"FriendlyName: Any string you want, for example "Volume1"
  • FileSystemCSVFS_ReFS (建議選項) 或 CSVFS_NTFSFileSystem: Either CSVFS_ReFS (recommended) or CSVFS_NTFS
  • StoragePoolFriendlyName:儲存集區的名稱,例如 "S2D on ClusterName"StoragePoolFriendlyName: The name of your storage pool, for example "S2D on ClusterName"
  • Size:磁碟區大小,例如 "10TB"Size: The size of the volume, for example "10TB"

    注意

    Windows,包括 PowerShell,使用二進位 (以 2 為底數) 數字計算,而磁碟機通常使用十進位 (以 10 為底數) 數字標示。Windows, including PowerShell, counts using binary (base-2) numbers, whereas drives are often labeled using decimal (base-10) numbers. 這解釋 "1 TB" 磁碟機,定義為 1,000,000,000,000 位元組,為何在 Windows 中顯示為約 "909 GB"。This explains why a "one terabyte" drive, defined as 1,000,000,000,000 bytes, appears in Windows as about "909 GB". 此為預期性行為。This is expected. 在使用 New-Volume 建立磁碟區時,您應該以二進位 (以 2 為底數) 數字指定 Size 參數。When creating volumes using New-Volume, you should specify the Size parameter in binary (base-2) numbers. 例如,指定 "909GB" 或 "0.909495TB" 會建立大約 1,000,000,000,000 位元組的磁碟區。For example, specifying "909GB" or "0.909495TB" will create a volume of approximately 1,000,000,000,000 bytes.

範例:使用 2 或 3 部伺服器Example: With 2 or 3 servers

為了簡化,如果您的部署只有兩部伺服器,儲存空間直接存取會自動使用雙向鏡像復原類型。To make things easier, if your deployment has only two servers, Storage Spaces Direct will automatically use two-way mirroring for resiliency. 如果您的部署只有三部伺服器,它就會自動使用三向鏡像。If your deployment has only three servers, it will automatically use three-way mirroring.

New-Volume -FriendlyName "Volume1" -FileSystem CSVFS_ReFS -StoragePoolFriendlyName S2D* -Size 1TB

範例:使用 4 部以上伺服器Example: With 4+ servers

如果您有四部以上的伺服器,您可以使用選擇性的 ResiliencySettingName 參數選擇您的復原類型。If you have four or more servers, you can use the optional ResiliencySettingName parameter to choose your resiliency type.

  • ResiliencySettingNameMirrorParityResiliencySettingName: Either Mirror or Parity.

在下列範例,"Volume2" 使用三向鏡像,而 "Volume3" 使用雙同位(通常稱為「清除編碼」)。In the following example, "Volume2" uses three-way mirroring and "Volume3" uses dual parity (often called "erasure coding").

New-Volume -FriendlyName "Volume2" -FileSystem CSVFS_ReFS -StoragePoolFriendlyName S2D* -Size 1TB -ResiliencySettingName Mirror
New-Volume -FriendlyName "Volume3" -FileSystem CSVFS_ReFS -StoragePoolFriendlyName S2D* -Size 1TB -ResiliencySettingName Parity

範例:使用儲存層Example: Using storage tiers

在具有全部三種磁碟機類型的部署,一個磁碟區可以跨 SSD 和 HDD 層,部分存放在每個層。In deployments with three types of drives, one volume can span the SSD and HDD tiers to reside partially on each. 同樣地,在具有四個以上伺服器的部署,一個磁碟區可以混合鏡像和雙同位,分別部分存放。Likewise, in deployments with four or more servers, one volume can mix mirroring and dual parity to reside partially on each.

為了協助您建立這類磁碟區,儲存空間直接存取提供稱為 PerformanceCapacity 的預設分層範本。To help you create such volumes, Storage Spaces Direct provides default tier templates called Performance and Capacity. 它們在較快的容量磁碟機(如果有的話)封裝三向鏡像的定義,在較慢的容量磁碟機(如果有的話)封裝雙同位的定義。They encapsulate definitions for three-way mirroring on the faster capacity drives (if applicable), and dual parity on the slower capacity drives (if applicable).

您可以執行 Get-StorageTier cmdlet 看到這些選項。You can see them by running the Get-StorageTier cmdlet.

Get-StorageTier | Select FriendlyName, ResiliencySettingName, PhysicalDiskRedundancy

儲存層 PowerShell 螢幕擷取畫面

若要建立分層磁碟區,請使用 New-Volume cmdlet 的 StorageTierFriendlyNamesStorageTierSizes 參數參考這些分層範本。To create tiered volumes, reference these tier templates using the StorageTierFriendlyNames and StorageTierSizes parameters of the New-Volume cmdlet. 例如,下列 cmdlet 建立一個依 30:70 比例混合三向鏡像和雙同位的磁碟區。For example, the following cmdlet creates one volume which mixes three-way mirroring and dual parity in 30:70 proportions.

New-Volume -FriendlyName "Volume4" -FileSystem CSVFS_ReFS -StoragePoolFriendlyName S2D* -StorageTierFriendlyNames Performance, Capacity -StorageTierSizes 300GB, 700GB

使用容錯移轉叢集管理員建立磁碟區Create volumes using Failover Cluster Manager

您也可以使用新增虛擬硬碟精靈 (儲存空間直接存取),後面接著容錯移轉叢集管理員的新增磁碟區精靈,來建立磁碟區,不過這個工作流程有更多手動步驟而且不建議。You can also create volumes using the New Virtual Disk Wizard (Storage Spaces Direct) followed by the New Volume Wizard from Failover Cluster Manager, although this workflow has many more manual steps and is not recommended.

有三個主要步驟:There are three major steps:

步驟 1:建立虛擬磁碟Step 1: Create virtual disk

新增虛擬硬碟

  1. 在 [容錯移轉叢集管理員] 中,瀏覽至 [儲存] -> [集區]In Failover Cluster Manager, navigate to Storage -> Pools.
  2. 從右側 [執行] 窗格選取 [新增虛擬硬碟],或以滑鼠右鍵按一下集區,然後選取 [新增虛擬硬碟]Select New Virtual Disk from the Actions pane on the right, or right-click the pool and select New Virtual Disk.
  3. 選取儲存集區然後按一下 [確定]Select the storage pool and click OK. [新增虛擬硬碟精靈 (儲存空間直接存取)] 隨即開啟。The New Virtual Disk Wizard (Storage Spaces Direct) will open.
  4. 使用精靈為虛擬硬碟命名,並指定其大小。Use the wizard to name the virtual disk and specify its size.
  5. 檢視您的選項,然後按一下 [建立]Review your selections and click Create.
  6. 關閉前,確定標記 [當此精靈關閉時建立磁碟區] 核取方塊已選取。Be sure to check the box marked Create a volume when this wizard closes before closing.

步驟 2:建立磁碟區Step 2: Create volume

此時會開啟 [新增磁碟區精靈]The New Volume Wizard will open.

  1. 選擇您剛建立的虛擬磁碟,然後按一下 [下一步]Select the virtual disk you just created and click Next.
  2. 指定磁碟區大小 (預設:與虛擬磁碟大小相同),按一下 [下一步]Specify the volume's size (default: the same size as the virtual disk) and click Next.
  3. 指定磁碟區的磁碟機代號,或選擇 [不指派成磁碟機代號或資料夾],按一下 [下一步]Assign the volume to a drive letter or choose Don't assign to a drive letter and click Next.
  4. 指定要使用的檔案系統,將配置單位大小保留為 [預設],命名磁碟區,並按一下 [下一步]Specify the filesystem to use, leave the allocation unit size as Default, name the volume, and click Next.
  5. 檢視您的選項,然後按一下 [建立],然後按一下 [關閉]Review your selections and click Create, then Close.

步驟 3:新增至叢集共用磁碟區Step 3: Add to cluster shared volumes

新增至叢集共用磁碟區

  1. 在 [容錯移轉叢集管理員] 中,瀏覽至 [儲存] -> [磁碟]In Failover Cluster Manager, navigate to Storage -> Disks.
  2. 選擇您剛建立的虛擬磁碟,然後從右側 [執行] 窗格選取 [新增至叢集共用磁碟區] 或以滑鼠右鍵按一下虛擬磁碟,然後選取 [新增至叢集共用磁碟區]Select the virtual disk you just created and select Add to Cluster Shared Volumes from the Actions pane on the right, or right-click the virtual disk and select Add to Cluster Shared Volumes.

大功告成!You're done! 視需要重複以建立一個以上的磁碟區。Repeat as needed to create more than one volume.

請參閱See also