DEV Community

Ruxo Zheng
Ruxo Zheng

Posted on

Dev Drive's shortcut guide

Dev Drive is a new type of storage volume introduced in Windows 11. It works with the Resilient File System (ReFS). One interesting feature I came across is that when copying a file, both the original and the copy might share the same disk space (though I haven't confirmed this yet). I'll look into it more in the future.

Anyway, here's a quick guide on working with Dev Drive, summarized from the Microsoft Document.

Creating a New Dev Drive

A Dev Drive is essentially a partition inside a Virtual Hard Disk (.vhd). Creating a Dev Drive involves creating a virtual disk, formatting it with ReFS, and then mounting it to a logical drive.

To create a Dev Drive, navigate to System > Storage > Advanced Storage Settings > Disks & volumes. Select Create Dev Drive.

Create a dev drive

If you want to disable antivirus for the Dev Drive, you can use the following command line with administrative privileges:

fsutil devdrv enable /disallowAv
Enter fullscreen mode Exit fullscreen mode

Resizing a Dev Drive

The Microsoft document provides a way to resize a Dev Drive. However, if you're like me, you might run into a problem where the resize utility doesn't detect your Dev Drive and instead shows irrelevant volumes. There's a PowerShell command called Resize-VHD, but it requires installing Hyper-V on your machine.

A better solution is to use diskpart:

  1. Take the VHD of the Dev Drive offline in the Disk & volumes setting.
    Detach button

  2. Open a terminal and run diskpart.

  3. Enter the following commands:

    select vdisk file="<Your VDH Path>"
    attach vdisk
    extend size=<size in MB>
    detach vdisk
    exit
    

The good news is that this method does not require Hyper-V.

Move a VHD across machines

The Microsoft documentation includes a recommendation:

When you create a Virtual Hard Disk (VHD) hosted on a fixed disk (HDD or SSD), it is not recommended to copy the VHD, move it to a different machine, and then continue using it as a Dev Drive.

No specific reason is provided, but from my research I believe it might relate to the security settings on the volume. When a VHD is moved to a new machine, it loses its security descriptor, and you need to "trust" the Dev Drive again. The procedure is detailed in the same document, but essentially it's just a command line (with administrator access):

fsutil devdrv trust <drive-letter>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)