Skip to content

Repository files navigation

resize-devdrive

Resize a Windows Dev Drive (VHDX-backed, ReFS) by recreating it with a larger size while preserving all data.

Problem

Dev Drive D: (50 GB) is full. git fetch and other operations fail with no space left.

Solution

This script:

  1. Backs up all data from D: to C:\DevDriveBackup\
  2. Dismounts and deletes the old 50 GB VHDX
  3. Creates a new 100 GB VHDX with identical config (ReFS Dev Drive, same drive letter, same junction)
  4. Restores all data
  5. Cleans up

Usage

The easiest path is the setup helper — give it the drive letter and target size; it auto-detects everything, writes the config, and can run the resize:

# Detect + write config only (safe, no admin needed):
C:\tools\resize-devdrive\Setup-Resize.ps1 D 200

# Detect, write config, and run the resize (elevated PowerShell required):
C:\tools\resize-devdrive\Setup-Resize.ps1 D 200 -Run

Or run the resize directly (close VS Code and anything using the drive first, elevated):

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
C:\tools\resize-devdrive\Resize-DevDrive.ps1 -DriveLetter D -NewSizeGB 200

Configuration (reusable)

Only which drive and the target size are required — everything else (the backing VHDX, the volume label, any junction pointing to the drive, and the backup/state/log locations) is auto-detected from the drive or defaulted. Settings come from parameters or a nested JSON config file. Precedence: command-line parameters > config file > auto/defaults.

{
  "drive": {
    "letter": "D",
    "targetSizeGB": 100
  }
}

That is the whole config for the normal case (resize-devdrive.config.json, git-ignored). A resize-devdrive.config.json next to the script is picked up automatically.

Recovery

If the script fails mid-way (defaults shown; <letter> is the drive letter):

  • State file: state\DevDriveResize-<letter>.json next to the script (shows last completed phase)
  • Backup: %TEMP%\DevDriveBackup-<letter>\ (complete copy of the old Dev Drive data)
  • Logs: logs\Resize-<letter>-Backup.log, logs\Resize-<letter>-Restore.log next to the script

Re-running the script resumes from the last completed phase. If a backup already exists at the target path, the script warns and lets you either recreate a fresh backup (recommended) or reuse the existing one.

Environment (as of 2026-08-07)

Item Value
VHDX C:\DevDrive.vhdx (49.41 GB, dynamic)
Volume D: 50 GB ReFS, Label "Development"
Junction C:\Development -> D:\
Windows Build 10.0.26100.0
C: free ~385 GB
Target size 100 GB

About

Safely resize a full Windows Dev Drive (VHDX/ReFS) — backup, recreate larger, restore. PowerShell, auto-detect, crash-safe.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages