How to Unallocate the free space in the virtual Disk created from the storage pool

Sharan Sai 1 Reputation point
2023-03-22T12:37:59.8633333+00:00

Say Our Initial Disk Size is 128GB. Assume Disk is Empty

now we have taken up a Storage pool of 256GB and Created VirtualDisk.

Start Mirroring.

say after 30 Minutes Mirroring is Done from Initial Disk to VirtualDisk.

Now, Remove the Initial Disk.

Although the Newly created Volume is empty, the VirtualDisk shows, the allocated size is 128GB(Size of initial Disk  - i.e was always showing minimum of initial Disk Size from where the mirroring is being done).

Can u please provide me the steps to unallocate the Free space.

Tried but wont work out
Defrag F: /U /V

Thanks in advance

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 14,185 Reputation points MVP
    2023-03-22T12:48:27.3466667+00:00

    It seems like you have created a mirrored virtual disk with storage spaces using an initial disk of 128GB and a storage pool of 256GB. After completing the mirroring process and removing the initial disk, the virtual disk still shows the allocated size as 128GB. To free up the unallocated space and adjust the virtual disk size, follow these steps:

    1. Open PowerShell as an administrator.
    2. Run the following command to get a list of storage pools:
    Get-StoragePool
    
    1. Identify the storage pool you want to modify (the one with a 256GB capacity). Note the "FriendlyName" of the storage pool.
    2. Run the following command to get a list of virtual disks within the storage pool:
    
    Get-VirtualDisk -StoragePoolFriendlyName <StoragePool_FriendlyName>
    

    Replace <StoragePool_FriendlyName> with the friendly name of your storage pool.

    1. Identify the virtual disk you want to modify (the one with a 128GB capacity). Note the "FriendlyName" of the virtual disk.
    2. Run the following command to resize the virtual disk to its maximum supported size:
    Resize-VirtualDisk -FriendlyName <VirtualDisk_FriendlyName> -Size (Get-VirtualDiskSupportedSize -FriendlyName <VirtualDisk_FriendlyName>).SizeMax
    

    Replace <VirtualDisk_FriendlyName> with the friendly name of your virtual disk.

    1. After resizing the virtual disk, you need to extend the volume to make use of the additional space. First, open Disk Management by pressing Win+X and selecting Disk Management.
    2. In Disk Management, locate the volume corresponding to your virtual disk. Right-click the volume and select Extend Volume.
    3. Follow the Extend Volume Wizard to allocate the unallocated space to the volume.

    After completing these steps, your virtual disk should reflect the correct size, and the unallocated space should be used by the volume.

    Note that defragmentation (Defrag F: /U /V) would not help in this situation, as it is used to optimize file storage within a volume, rather than adjusting the size of a virtual disk or volume.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.