Hello Adrian,
It's a classic and frustrating Windows mystery. You're right, the presence of pagefile.sys on the D: drive is almost certainly the reason you can't delete or merge the partition. Windows actively uses this file as virtual memory, effectively "locking" the drive and preventing any major changes to it.
You didn't do anything wrong. Windows sometimes automatically manages the paging file and can place it on a secondary drive (like your D: drive) if it deems it to be faster or have more appropriate free space, especially during initial setup or after major updates.
The good news is that you can manually control this behavior and move the page file back to your C: drive.
How to Move the Paging File and Unlock Your D: Drive
Here is the step-by-step process to reconfigure the virtual memory settings, move the pagefile.sys to your C: drive, and then successfully delete the D: partition.
- Open Advanced System Settings:
- Press the Windows Key + R to open the "Run" dialog.
- Type
sysdm.cpland press Enter. This will open the "System Properties" window.
- Navigate to Performance Settings:
- Go to the Advanced tab.
- In the "Performance" section, click the Settings... button.
- Go to Virtual Memory Settings:
- In the "Performance Options" window, go to the Advanced tab again.
- In the "Virtual memory" section, click the Change... button.
- Manually Configure the Paging File:
- At the top of the "Virtual Memory" window, uncheck the box that says "Automatically manage paging file size for all drives." This is the crucial step that gives you manual control.
- Select your D: drive from the list.
- Select the "No paging file" radio button.
- IMPORTANT: Click the Set button to apply this change. The setting for D: should now show "None".
- Assign the Paging File to the C: Drive:
- Now, select your C: drive from the list.
- Select the "System managed size" radio button. This is the recommended setting for most users.
- Click the Set button again. The setting for C: should now show "System managed".
- Confirm and Restart:
- Click OK on the "Virtual Memory" window.
- You will likely see a message warning you that the changes require a restart. Click OK.
- Click OK on the "Performance Options" window, and OK again on the "System Properties" window.
- When prompted, restart your computer.
- Click OK on the "Performance Options" window, and OK again on the "System Properties" window.
- You will likely see a message warning you that the changes require a restart. Click OK.
- Click OK on the "Virtual Memory" window.
- Select the "System managed size" radio button. This is the recommended setting for most users.
- Now, select your C: drive from the list.
- Select the "No paging file" radio button.
- Select your D: drive from the list.
- At the top of the "Virtual Memory" window, uncheck the box that says "Automatically manage paging file size for all drives." This is the crucial step that gives you manual control.
- In the "Performance Options" window, go to the Advanced tab again.
- Go to the Advanced tab.
- Type
- Press the Windows Key + R to open the "Run" dialog.
After the Restart
Once your computer has rebooted, the pagefile.sys on the D: drive will be gone, and a new one will be active on your C: drive. The D: partition will no longer be locked by the system.
You should now be able to go back into Disk Management (you can open it by right-clicking the Start button) and successfully delete the D: volume or use diskpart to achieve your goal.