ThisCalculator

Everyday

Pagefile Volume Error: Fix & Causes

Updated · Standard formula, shown below

Average pace 5.00 min/km
Average speed
12.00 km/h
Result
Finish time
50 min
You entered
Distance
10 km
You entered

Pagefile Volume Error: Fix & Causes

This article explains the Windows error “Operation not allowed on disk containing pagefile volume,” which occurs when you try to delete, shrink, or format the drive that holds the system page file. The fix is to disable or move the page file to another drive, then retry the operation. Below we cover what the page file is, why Windows protects it, and the exact steps to resolve the error safely.

What the Page File Is and Why It Matters

The page file (pagefile.sys) is a hidden system file on Windows that acts as virtual memory. When physical RAM is full, Windows moves less-used data from RAM to this file on disk, freeing memory for active programs. The page file is essential for system stability, especially on machines with limited RAM or when running memory-heavy applications like video editors or virtual machines. Because the system may need to write to the page file at any moment, Windows locks the volume containing it, preventing most disk management operations such as deletion, shrinking, or formatting. This lock is what triggers the error message.

Why the Error Appears

The error typically appears in Disk Management, Diskpart, or third-party partitioning tools when you attempt to:

  • Delete the partition or volume that contains pagefile.sys.
  • Shrink the volume to create unallocated space.
  • Format the volume.
  • Convert the disk to a different partition style (e.g., MBR to GPT).

Windows displays the message because the page file is in active use by the kernel. Even if you have plenty of RAM, Windows may still use a small page file for crash dumps or memory management. The system will not allow you to modify the volume while the file is in use, as doing so could cause a system crash or data corruption.

How to Fix the Error: Move or Disable the Page File

To resolve the error, you must relocate or disable the page file on the affected drive. Here are the steps for Windows 10 and 11:

  1. Press Win + R, type sysdm.cpl, and press Enter.
  2. Go to the Advanced tab, then under Performance, click Settings.
  3. In the Performance Options window, switch to the Advanced tab and click Change under Virtual Memory.
  4. Uncheck Automatically manage paging file size for all drives.
  5. Select the drive that shows the error, choose No paging file, and click Set. Windows will warn you about potential issues; confirm if you plan to move the file.
  6. If you want to keep a page file (recommended), select another drive (e.g., D:), choose System managed size or Custom size, and click Set.
  7. Click OK and restart your computer. After reboot, the original drive is no longer locked, and you can perform the disk operation.

If you only need to shrink the volume, you can often use the built-in Shrink Volume feature in Disk Management without moving the page file, as long as the shrink size is smaller than the free space. However, if the error persists, move the page file first.

What If You Can’t Access Windows Normally?

If the error occurs while trying to modify a drive from within Windows, but you cannot boot normally, you can use the Windows Recovery Environment (WinRE). Boot from a Windows installation USB, select Repair your computer, then go to Troubleshoot > Advanced options > Command Prompt. From there, you can use Diskpart to clean the disk, but note that this will delete all data on it. Alternatively, you can use a third-party live Linux USB to delete partitions, but that bypasses Windows protection and may cause issues if the page file is still referenced. Always back up important data before attempting such operations.

Common Mistakes and Misconceptions

One common mistake is trying to delete the page file manually by deleting the file in File Explorer. This fails because the file is locked and hidden. Another misconception is that disabling the page file improves performance; in most cases, it does not, and it can cause problems for applications that rely on virtual memory. Also, some users think the error only appears when the page file is on the C: drive, but it can occur on any drive where the page file is set. Finally, using third-party partition tools may bypass the error, but this is risky and can corrupt the system if the page file is still in use.

Alternatives to Moving the Page File

If you want to avoid moving the page file, you can:

  • Use the Shrink Volume feature instead of deleting the whole volume.
  • Use a different disk for the operation (e.g., if you want to format D:, but the page file is on C:, you can format D: without issue).
  • Increase the size of the page file to avoid frequent resizing, which may reduce the need to modify the volume.
  • If you have enough RAM (e.g., 32 GB or more), you can set the page file to a small fixed size on a different drive, but keep it enabled for stability.

Frequently Asked Questions

Why does Windows need a page file even with lots of RAM?

Windows uses the page file for crash dumps (memory dumps) and for moving less-frequently accessed pages out of RAM. Even with plenty of RAM, some applications or system processes may request memory in a way that benefits from a page file. Also, certain drivers may require the page file to be present. Disabling it entirely can cause issues with large memory allocations or system stability.

Can I delete pagefile.sys manually?

No, you cannot delete pagefile.sys while Windows is running because it is locked by the system. You can only remove it by disabling the page file via the Virtual Memory settings, as described above. After disabling, the file is removed automatically after a restart.

Is it safe to disable the page file to fix this error?

Disabling the page file is safe temporarily, but it is not recommended as a permanent solution. Without a page file, Windows cannot create crash dumps, and some applications may crash if they exhaust physical RAM. If you disable it, enable it on another drive or re-enable it after performing the disk operation.

Will moving the page file to another drive slow down my computer?

Moving the page file to a different drive can affect performance, especially if the new drive is slower (e.g., a hard drive vs. an SSD). If you have multiple drives, place the page file on the fastest drive, preferably an SSD. In most cases, the performance impact is minimal, especially if you have enough RAM.

Can I format the drive if the page file is on it?

No, you cannot format a drive that contains the page file while Windows is running. You must first move or disable the page file, then format the drive. Alternatively, you can boot from a Windows installation media and format the drive from there, but that will also delete the page file and any other data.

What if the error appears when using Diskpart?

Diskpart will show the same error if the volume is locked by the page file. Follow the same steps to move the page file, then retry the Diskpart command. If you are trying to clean the entire disk, you may need to use the clean command after moving the page file, but be aware that this erases all partitions and data.

Related

Formula used
in t | Finish time | min | 50 | 0
in d | Distance | km | 10 | 0
out pace | Average pace | min/km | t / d | 2
out speed | Average speed | km/h | d / (t / 60) | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.