Last Update: Sep 04, 2024 | Published: Nov 30, 2014
In this easy Ask the Admin, I’ll show you how to quickly set up a Storage Spaces mirrored volume on Windows Server 2012 R2 with the help of PowerShell.
Storage Spaces debuted in Windows Server 2012, and provides storage virtualization capabilities offering flexibility, durability, and scalability once only available in expensive hardware-based storage solutions. While previous versions of Windows Server included software RAID, it was considered inferior to enterprise-grade hardware alternatives.
In contrast, Storage Spaces utilizes advances in Windows Server to provide software RAID that can in many configurations match the performance of hardware RAID, assuming the disks and connecting interfaces are up to the job. If performance isn’t a key consideration, Just a Bunch of Disks (JBOD) can be used to provide fault-tolerant storage.
Storage Spaces doesn’t just do resiliency, but also tiered storage and continuous availability among other things. But in this article, we’ll look at how to mirror a pair of locally attached disks, and create a volume accessible to Windows. For more information on Storage Spaces, see Windows Server 2012: Is Storage Spaces the Killer Feature? and New Features in Windows Server 2012 R2 Storage Spaces on the Petri IT Knowledgebase.
I’m going to use an Azure virtual machine for this demonstration. You can easily perform the following instructions on a server in your home or office lab. Start by attaching two disks to your server. To attach a disk in Azure:
Now that we have two disks attached to the server, we can configure a mirrored volume using Storage Spaces. Log on to the server and open a PowerShell console with administrative privileges.
First we’ll scan the system for disks that are available for use in a storage pool, and write the array to the $PhysicalDisks variable. Disks available for use in a storage pool belong to what Windows Server calls the primordial storage pool by default. In principal, we could omit the get-storagesubsystem cmdlet here, as it’s likely that Storage Spaces will be the only storage subsystem present on your server.
Now we’ll create a new storage pool (StoragePool1) and add the available disks ($PhysicalDisks).
Because everything in Storage Spaces is software defined, we need to create a virtual disk. The disks I attached to the server are 50GB each in size, but thin provisioning allows me to specify a larger capacity, and add extra disk space later as needed.
The new-virtualdisk cmdlet creates a mirrored pair by default. To create a simple volume with no fault tolerance, add –ResiliencySettingName Simple to the above command. Finally, initialize the disk, create a new volume and format it.