
Sometime our C:\Drive fills up and we need to get free space. We can use free tools like Wiztree to scan the drive and discover unneeded files and remove them. Of course, we don’t want to forget to empty the recycling bin for it to be removed from the C:\Drive completely. So what do we do if there is nothing that can be removed, then what?
I encourage you to read the entire tutorial as you may miss and important step. But for the sake of a revisit to this page I am providing the sections link.
Expanding the C:\Drive For Use
Here’s The Technical Work Around
Expanding The Disk Successfully
Depending on our situation we may have options, such as if the server or PC is a Virtual Machine or VM. In this case we can add more space to the drive. If it is a physical server or PC then we will have to have unallocated space already available on the physical hard drive that contains the C:\Drive. Without one of these two options we will have to make tough decisions by deleting files or starting over with a larger physical hard drive.
If it is a VM such as VMWare we can add space in vCenter by clicking “ACTIONS” and then “Edit Settings”.
Here we will add 21GB to the existing 100GB to give us 121GB total space. Keep in mind that the odd number of 121 is because we will need 1GB remaining for later use this tutorial.
Now let’s login to the VM and look at what has changed. Here at the Desktop we can right click the start icon to find administrative options. (These options have been around since, I believe, Window 7.) Then click “Disk Management”.
Under the “Volume” category we can see all four partitions of “Disk 0” which includes C:\Drive and three other partitions. “Disk 0” represents our only hard drive on the VM. If your computer has more than one hard drive installed on a physical or VM then you will see a “Disk 1” and so on for each hard drive. Below the partitions are:
- EFI System Partition is used by computers with UEFI firmware to store boot loaders, applications, and drivers necessary for booting the operating system.
- C:\Drive that holds the Windows Operating System or OS.
- Recovery Partition is used to restore the system to factory settings in the event of system issues.
- Unallocated is extra space of the hard drive (Disk 0) that is not currently being used. In this case it is the 21GB we recently added to the hard drive.
If we were to add up the first three partitions 1, 2, and 3 they would equal 100GB. We can see below that in “This PC” we only have 99.3, as partition 1 and 3 are taking the .7GB or the 100GB total.
Expanding The C:\Drive For Use
Normally we should be able to right click the C: Partition and click “Extend Volume…”, but as we can see this option is grayed out.
We can see that there is a partition that is in between the C: partition that we want to add space to and our newly added space in the Unallocated partition. This is preventing us from being able to extend the C: partition.
Microsoft has put this here preventing us from extending the drive. I have read that this makes it easier to recover, but for whatever the reason is we need to get around it! Microsoft suggest using third part software. This means you have to install to a already full C:\Drive and you may not want to add unknown software to your system.
As a primary example of this, our system in this example, is a Server 2022 Data Center OS, that is on a company network. The server network is cutoff from the internet so prevent security vulnerabilities. We do not want to risk unknown malware potentially coming in on unsecure third party software or exposing our servers to the internet.
Here’s The Technical Work Around
In the search bar type “cmd” ,without the quotations, and right click the result and click “Run as administrator”.
Shortcut – You can type “cmd” then on your keyboard press Ctrl + Shift + Enter and it will elevate you to “Administrator”
In the Command Prompt as Administrator type:
reagentc /disable
And hit enter. You should get “Operation Successful.”
One time, on a production system, I ran this command and I received error. If you receive an error just continue forward.
Now leave the Command Prompt open as we will use it later. Go back to the search bar and type “diskpart” (again, without the quotation marks) and elevate to Administrator.
WARNING!!!!! Diskpart is a very powerful tool. It is very important that you follow this carefully as your output will look slightly different from mine. Once you have removed a partition it is permanently gone and can not be retrieved. Because your C:\Drive contains your OS, be very sure that you do not accidentally remove this partition. There is no coming back from this. In VMWare you can take a snapshot of the VM before you proceed with a production system. Always use caution while using Diskpart!
With the WARNING out of the way, let me say that the next few commands are not “action” commands, but are instead output commands. This means that we are navigating but we are not making any changes yet. I will let you know before this happens.
We are going to list our disks so we can see how many hard drives we have.
list disk
We need to select the disk, which in this example there is only one disk to select, disk 0. Now if you have multiple hard drive, either physical or virtual, you need to select the disk that we were looking at previously with the OS.
Select disk 0
Now that our disk is selected we need to list the partitions
list partition
Here is the word of caution again. We need to select the correct partition. Looking back at our “Disk Management” we want to select the partition that is preventing us from extending the OS drive we need to add space to. That partition is the “Recovery Partition” and we can see that it is 570MB in size. We can also see that it is the only partition that size.
In the “list partition” command output we see that the only partition that size is partition 4.
select partition 4
Now we will delete this partition. If you are wonder, yes it is perfectly safe to delete this partition without effecting the system. Later we will build back a new “Recovery Partition” so not to worry.
delete partition override
If we go back into “Disk Management” we will see that the “Recovery Partition” has been removed.
Expanding The Disk Successfully
In “Disk Management” we can now right click the C: partition and as we can see, we can now click on “Expand Volume…”
Now before you go rogue and moving ahead without me, let me remind you that we need to leave unallocated space for later use.
As we can see that the “Maximum available space in MB” is 22074. But we don’t need to use all of it. We need to save at least 1GB out as a round number. 1GB is actually 1024MB so we will do the math by taking 22074 and subtracting 1024 and we get 21050. Don’t believe me you can see below.
Now we can put in this amount in the “Select the amount of space in MB” 21050 and click “Next”.
And “Finish”
We can see that the C:\Drive has expanded to add the 20GB of extra storage and that we have a remaining 1.00GB remaining unallocated.
Now we need to rebuild the deleted “Recovery Partition” in case our system becomes unstable and we will do that on the NEXT PAGE.