Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / Windows Doesn’t Automatically Assign Drive Letters

June 19, 2023 Windows 10Windows 11

Windows Doesn’t Automatically Assign Drive Letters

Windows automatically assigns a drive letter to any connected HDD/SSD disk, USB flash drive, SD card if it recognizes the file system on its partitions. But sometimes it doesn’t work. For example, when connecting a drive, a message appears indicating that a new device is being installed, the disk appears in Device Manager, but is not displayed in File Explorer. How to manually assign a drive letter on Windows 10 and 11, or enable automatic assignment of a drive letter to new drives?

Contents:
  • How to Manually Assign a Permanent Drive Letter in Windows?
  • Changing Drive Letter via CMD or PowerShell
  • Windows Doesn’t Save an Assigned Drive Letter for Connected USB Drives

How to Manually Assign a Permanent Drive Letter in Windows?

If the drive doesn’t appear in Windows Explorer, it will have to manually assign a drive letter through the Disk Management snap-in (diskmgmt.msc). To do this, open the Computer Management console (via the Win + X menu) and go to the Storage section -> Disk management. In the list of drives, locate the connected removable USB drive. As you can see, the disk is online, it has one healthy partition with the NTFS, but it is not assigned a drive letter. To assign a drive letter to it, right-click on the partition and select “Change Drive Letter and Path“.

Computer Management Change Drive Letter and Path

In the window that appears, click the “Add” button, select “Assign the following drive letter”, select the letter you want to assign to the drive (for example, H: ) in the drop-down list, and click OK.

Assign the following drive letter to the usb flash drive

Make sure that Windows detects the partition (s) on the connected USB drive and the partition is formatted with the NTFS, FAT32, or exFAT file system. If the file system is detected as RAW, or the disk is not partitioned, most likely the USB flash drive is just a new one, or the partition table is damaged and you have to repair the file system first.

If the disk is new and no partitions have been created on it, it appears in the console as Not initialized with an Unallocated area. To initialize such a disk:

  1. Right-click on it and select Initialize Disk;initialize new disk in windows
  2. Select the partition table for your disk: MBR or GPT;
    You can convert MBR-disk to GPT without data loss.
  3. It remains to click on the unallocated space and create a partition (New Simple Volume) on it, select the file system, format, and assign a drive letter.create partition on disk

If the disk is offline, right-click on it and select Online.

make disk online on windows

If the disk goes offline every time you restart Windows, fix it using the guide “The disk is offline because of policy set by an administrator”.

Changing Drive Letter via CMD or PowerShell

You can assign or change a drive letter from the command prompt using the Diskpart tool or using PowerShell.

Open the elevated command prompt and run the command:

Diskpart

List the volumes on the disks:

List vol

In this example, the TestDisk volume is not assigned a drive letter (empty in the Ltr column)

Windows doesn’t automatically assign a drive letter to the hidden System Reserved partition and the boot EFI partition.

Select this volume (Volume 4 in our example):

Sel vol 4

Assign a drive letter Q: to this volume:

Assign letter=Q

DiskPart successfully assigned the drive letter or mount point.

End the diskpart session:

Exit

assigning drive letter using diskpart cmd

You can also change or assign a drive letter using the PowerShell cmdlets from the built-in Disk Management module.

List drives:

Get-Disk

List partitions on the specified disk:

get-disk 1|Get-Partition

Assign the letter Q: to partition 2 on disk 1:

Get-Partition -DiskNumber 1 -PartitionNumber 2 | Set-Partition -NewDriveLetter Q

using powershell to assign drive letter to the partition on the USB drive

After that, the connected USB disk appears in the File Explorer with the assigned drive letter.

Windows Doesn’t Save an Assigned Drive Letter for Connected USB Drives

Sometimes after disconnecting a USB device or restarting the computer, a drive letter is not automatically assigned to it. I have to assign the letter again manually through Disk Management, and that becomes annoying.

It seems that some feature of automatic detection and mounting of new partitions on the external storage devices is not working in Windows. How to solve this problem?

First of all, make sure that the Virtual Disk service is running. You can check the status of this service in the services management console (services.msc).

start virtual disk serviceAlso, you can check the service from the command prompt:
sc query vds

SERVICE_NAME: vds
TYPE               : 10  WIN32_OWN_PROCESS
STATE              : 1  STOPPED
WIN32_EXIT_CODE    : 0  (0x0)
SERVICE_EXIT_CODE  : 0  (0x0)
CHECKPOINT         : 0x0
WAIT_HINT          : 0x0

sc query vds

Or check the service state using PowerShell:

get-service vds

check virtual disk service running via powershell

If the service is stopped, start it from the graphical snap-in (Start button) or using the command:
net start vds
net start vds

Tip. In some cases, for the Virtual Disk service to work correctly, you need to change its startup type to Automatic (otherwise you will get the “Unable to connect to the Virtual Disk service” error).

Check if the problem persists. If it does, make sure that the automatic mounting of new volumes is enabled.

Note. When the automount is enabled, Windows automatically mounts the file systems of new drives connected to the computer and assigns drive letters to the partitions. If the automount is disabled, Windows detects new drives but doesn’t automatically mount them or assign drive letters to the new volumes.

Open the command prompt as administrator and run the following commands:
diskpart
Within diskpart, make sure that the automatic mounting of new volumes is enabled:
DISKPART> automount

Automatic mounting of new volumes disabled.

As you can see, the auto-mounting is disabled. Let’s enable it:
DISKPART> automount enable

Automatic mounting of new volumes enabled.

Exit diskpart
DISKPART> exit

Enable automount with diskpart

You can also enable automatic mounting of new partitions using the command:

MOUNTVOL /E

Make sure the NoAutoMount DWORD parameter (with a value of 1) is not created under the reg key HKLM\SYSTEM\CurrentControlSet\Services\mountmgr. If this registry parameter is created, Windows doesn’t assign drive letters to newly connected devices.

Note. By the way, the automount is also responsible for making Windows remember the drive letters assigned to the removable drives. The automount feature will assign the same drive letters the next time the USB drive is connected to your computer (of course, if these letters are not busy). A list of saved drive letters assigned to partitions is stored under the registry key HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices.

list of saved drive letters assigned to disk in windows registry

To clear the saved associations of partitions with drive letters, use the command DISKPART>automount scrub or mountvol /r.

Restart your computer and verify if the drive letters are assigned to the external USB devices.

If not, check if the “hidden” and “do not assign a drive letter” attributes are set for the partition on the USB drive. Run the Diskpart command prompt and enter the following commands:

  1. List the disks: list disk
  2. Find the disk number assigned to your USB flash drive (in this example 1) and select it: select disk 1
  3. List the partitions on the disk: list part
  4. Select the desired partition: select partition 2
  5. Check the partition attributes: attributes volume
  6. As you can see, the “Hidden” and “No Default Drive Letter” attributes are enabled for this volume;volume attributes
  7. Disable these attributes with commands:
    attributes volume clear NoDefaultDriveLetter
    attributes volume clear hidden
    Volume attributes cleared successfullyclear volume attributes NoDefaultDriveLetter and hidden
  8. End the diskpart session by typing: exit

After that, this partition on the USB flash drive should be automatically assigned a drive letter on any computer.

Please note that the old Windows versions only see the first partition on USB sticks with multiple partitions. The ability to create multiple partitions on removable USB drives appeared only starting from Windows 10 build 1703. Previously, in order to make second and subsequent partitions on the USB flash drive were accessible in Windows, you had to use a trick to make Windows detect removable USB flash drive as an HDD.

If your USB flash drive doesn’t appear in the Disk Management console, try using a different USB port or cable. Try to connect the USB flash drive directly to the computer (without the USB hub), check whether the power is on and whether it is detected on other computers.

26 comments
18
Facebook Twitter Google + Pinterest
previous post
IdFix: Preparing On-Prem Active Directory Sync with Azure
next post
Install and Configure a Read-Only Domain Controller (RODC) on Windows Server 2019/2022

Related Reading

Installing Language Pack in Windows 10/11 with PowerShell

September 15, 2023

How to View and Change BIOS (UEFI) Settings...

September 13, 2023

How to Create UEFI Bootable USB Drive to...

September 11, 2023

Redirect HTTP to HTTPS in IIS (Windows Server)

September 7, 2023

How to Install an SSL Certificate on IIS...

September 5, 2023

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023
  • How to Create UEFI Bootable USB Drive to Install Windows

    September 11, 2023
  • Redirect HTTP to HTTPS in IIS (Windows Server)

    September 7, 2023
  • Add an Additional Domain Controller to an Existing AD Domain

    September 6, 2023
  • How to Install an SSL Certificate on IIS (Windows Server)

    September 5, 2023
  • Managing Windows Firewall Rules with PowerShell

    August 31, 2023
  • Fixing ‘The Network Path Was Not Found’ 0x80070035 Error Code on Windows

    August 30, 2023
  • Disable Welcome Message for Microsoft 365 Groups

    August 28, 2023

Follow us

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Repair EFI/GPT Bootloader on Windows 10 or 11
  • How to Restore Deleted EFI System Partition in Windows
  • Network Computers are not Showing Up in Windows 10/11
  • Updating List of Trusted Root Certificates in Windows
  • How to Create a Wi-Fi Hotspot on your Windows PC
  • How to Sign an Unsigned Device Driver in Windows
  • How to Download APPX File from Microsoft Store for Offline Installation?
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top