Error: The operation is not allowed a disk that contains a pagefile volume
There was one user who decided to use a 3 TB hard drive. At that time, his computer used the Legacy boot. He knew that he had to convert to a GPT disk to fully use 3 TB hard drive. When he used DiskPart.exe to convert MBR to GPT, he received an error message: "Virtual disk service error: The operation is not allowed on a disk that contains a pagefile volume."
He even disabled page files in Control Panel and deleted the file c:\pagefile.sys in File Explorer to no valid. But still unable to succeed, what is going on?
The truth is that DiskPart.exe can only convert an empty hard disk to GPT or MBR partition style. Therefore, if you ever need to convert a hard drive to MBR or GPT with DiskPart.exe, you need to use the “clean” command to delete all partitions on that disk before convert GPT.
Tip:Both MBR and GPT are disk partition styles. MBR is an old partition style that supports partitions up to 2 TB. While GPT is a new partition style, which supports partitions up to 9.4ZB. Therefore, in order to fully use the hard disk space, you need to set the partition style to GPT.
How to solve "The operation is not allowed on a disk that contains a pagefile volume"
As mentioned, this method will get everything on the disk deleted. So you’d better backup hard drive before applying the following steps. What'more, a Windows installation USB is required.
Next, we take the convert the system disk from MBR to GPT as an example:
1. Restart the computer, enter BIOS to enable UEFI boot mode and exit.
2. Boot your computer from a Windows installation USB.
3. At the screen to select where to install Windows, press Shift + F10 to open a Command Prompt window.
4. Type "diskpart" and press Enter first. Then, type the following commands and press Enter after inputting each command: ● list disk
● select disk X (X is the number of disk) ● clean ● convert gpt
5. When finished, type exit to exit the command prompt window. Reinstall Windows on the GPT disk.
Alternative to convert MBR to GPT without data loss
If you seek help from AOMEI Partition Assistant Professional, you can change Legacy mode to UEFI without reinstalling Windows. It allows you to convert a system disk from MBR to GPT without affecting OS. In other words, once the conversion is done, you can change BIOS to UEFI boot mode and then boot your Windows 11/10/8/7 without reinstallation. The most exciting thing is that the entire conversion process is very simple and only takes a few steps to complete.
Step 1. Install and run AOMEI Partition Assistant Professional on your PC. Right-click on the disk that not allowed you to convert because of pagefile volume, and then select the option “Convert to GPT”.
Step 2. Confirm that your motherboard supports EFI/UEFI boot. Then, click "Yes".
Step 3. Click the option “Apply” to apply this operation.
Situations like “the operation are not allowed on a disk that contains a pagefile volume” will never happen with AOMEI Partition Assistant Professional because the whole process does not interfere with pagefile and all the data remain intact.
Last but not least, if you plan to convert MBR to GPT in Windows Server, AOMEI Partition Assistant Server is your first choice. It can help you manage and solve various problems on the Server computer flexibly and in time.