Anyone that has used Storage Spaces has probably seen that Storage Spaces does not redistribute files when a new disk is added to the space. Let's say you had a Storage Space with two 1 TB disks. If they filled up and you added a third 1 TB disk, you'd see Storage Spaces using close to 100% disk space on the first two disks and almost 0% on the new disk. The only way to fix this previously was to remove the files from the Storage Space to somewhere else, and put them back in, or hot-remove drives from two/three way mirrors and have them reintroduced. There is even a hefty discussion on the topic on SuperUser.
Not anymore. In Windows 10 and Windows Server 2016, Microsoft have added the
Optimize-StoragePool PowerShell command!
Here is how it works. I started out creating a Simple Storage Space (no resiliency) with one 5 GB disk, and added a few files to it, resulting in this.
So, I added a new 10GB disk, and saw the all too familiar uneven space distribution. I even added a few more files after that.
So, I simply fired up PowerShell in administrator mode and issued the
Optimize-StoragePool -FriendlyName "Storage pool" command and waited as the command progressed.
And behold, my Storage Space was now optimized/rebalanced! It intelligently rebalances files based on disk space, disk size and file size as far as I can tell, and it's certainly much better than not being able to do it at all.
And just for fun I added a third disk, 15GB in size to and rebalanced again to see what would happen. Here is after adding the third disk and before rebalancing.
And after rebalancing.
This was just a preliminary test of the new
Optimize-StoragePool command but so far it seems to work pretty well. I might even switch back to Storage Spaces for my home server once Windows Server 2016 is released. :)
Update - August 25th 2015
After responses from Microsoft employees in the comments below, here are some more details.
- If you set up your storage pool on an earlier Windows version than Windows 10 or Windows Server 2016, make sure you run
Update-StoragePool -FriendlyName "[NameOfYourStoragePool]"before you try running the rebalancing command. This command should upgrade the metadata for the storage pool to enable new features and functionality.
The rebalancing command only works on simple and mirrored spaces. It is currently not supported for parity spaces, although that functionality is being evaluated.
Update - June 26th 2018
A long overdue update, and most of you probably know by now, but rebalancing now works on parity spaces as well :)