Locking a hard disk partition in Windows 10 prevents unauthorized access to its contents, making it invisible in File Explorer or blocking write operations. This guide shows you several built-in methods—using Disk Management, Group Policy, and Command Prompt—so you can choose the one that fits your needs. No third-party software is required, but you will need an administrator account.
What You’ll Need
- A Windows 10 PC with an administrator account.
- The drive letter of the partition you want to lock (e.g., D:).
- For some methods, the volume GUID (you can get it from Disk Management).
Step-by-Step
Method 1: Hide a Partition Using Disk Management (Simplest)
- Press Win + X and select Disk Management from the menu.
- In the bottom pane, right-click the partition you want to lock (e.g., the D: drive) and choose Change Drive Letter and Paths.
- Select the drive letter (e.g., D:) and click Remove. Confirm if prompted.
- The partition is now hidden from File Explorer and most apps. To restore it later, right-click the same partition, choose Change Drive Letter and Paths, click Add, assign a letter, and click OK.
Method 2: Lock a Partition with Group Policy (Prevents Write Access)
- Press Win + R, type
gpedit.msc, and press Enter. (If you have Windows 10 Home, skip to Method 3.) - Navigate to Computer Configuration → Administrative Templates → System → Removable Storage Access.
- In the right pane, double-click All Removable Storage classes: Deny all access. (Note: This applies to removable drives, not internal partitions. For internal drives, use Method 1 or 3.)
- If you want to lock a specific internal partition, this policy won’t work. Instead, use Method 3 or the NTFS permissions approach in Method 4.
Method 3: Lock a Partition via Command Prompt (Using Diskpart)
- Press Win + X and select Command Prompt (Admin) or Windows PowerShell (Admin).
- Type
diskpartand press Enter. - Type
list volumeand press Enter. Note the volume number of the partition you want to lock (e.g., Volume 2). - Type
select volume 2(replace 2 with your volume number) and press Enter. - Type
remove letter=D(replace D with the actual drive letter) and press Enter. This removes the drive letter, hiding the partition. - Type
exitto close Diskpart. The partition is now locked. - To unlock, repeat the steps, but use
assign letter=Dinstead.
Method 4: Lock a Partition with NTFS Permissions (Prevents Read/Write)
- Open File Explorer and right-click the partition you want to lock (e.g., D:). Select Properties.
- Go to the Security tab and click Edit.
- Select the user or group you want to restrict (e.g., “Users”). Uncheck Read and Write under Allow. If you want to block everyone, you can remove the group entirely.
- Click Apply and OK. You may get a warning about permissions; confirm it.
- Now, that user or group cannot access the partition. To undo, re-add the permissions.
Common Mistakes
- Removing the wrong drive letter – Always double-check the volume number or drive letter in Disk Management before removing it. Removing the system drive (C:) can make Windows unbootable.
- Using Group Policy on internal drives – The Removable Storage policy only affects removable drives, not internal partitions. For internal drives, use Disk Management or NTFS permissions.
- Forgetting to unlock before reinstalling Windows – If you hide a partition and then reinstall Windows, the partition may remain hidden, and you might think it’s lost. You can unhide it using Diskpart or Disk Management.
- Not having administrator rights – All methods require admin privileges. If you’re not an admin, you’ll get an error.
Tips
- Before locking a partition, back up any important data. Removing a drive letter doesn’t delete data, but mistakes can happen.
- To lock a partition only for specific users, use NTFS permissions (Method 4) instead of hiding it globally.
- If you regularly need to lock/unlock, create a simple batch file with Diskpart commands to do it in one click.
- Remember that hiding a partition doesn’t encrypt it. Anyone with admin rights can still access it via Disk Management or Command Prompt.
Troubleshooting
- “Access Denied” when trying to remove drive letter – Make sure you’re running Disk Management or Command Prompt as administrator. Also, close any programs that might be using the drive (e.g., File Explorer open on that drive).
- Partition still visible after removing drive letter – Some apps (like disk utilities) may still show it. Also, if you have a mounted folder, remove that too. In Disk Management, check if there’s a mount point assigned.
- Cannot lock the system drive (C:) – Windows does not allow removing the drive letter of the system or boot partition. You cannot lock C: this way. Use BitLocker or third-party encryption for that.
- Group Policy changes not taking effect – Run
gpupdate /forcein Command Prompt to refresh policies immediately. - After locking, some programs fail to start – If a program was installed on that partition, it may not find its files. Unlock the partition before running such programs.
Frequently Asked Questions
Does locking a partition delete my files?
No. Removing a drive letter or changing NTFS permissions does not delete data. It only makes the partition inaccessible to users without admin rights.
Can I lock a partition but still allow some programs to access it?
Yes. Use NTFS permissions to allow specific user accounts or programs (by running them as that user) while blocking others. For example, you can deny access to “Users” but allow “Administrator”.
Is there a way to password-protect a partition without third-party software?
Windows 10 Pro and Enterprise have BitLocker, which encrypts the entire drive and requires a password or key to unlock. It’s the built-in way to protect data with a password. Home edition lacks BitLocker, but you can use EFS (Encrypting File System) for individual files.
Why can’t I remove the drive letter from C:?
Windows protects the system and boot partitions. Removing the drive letter from C: would make the system unbootable, so the option is greyed out. You can only lock non-system partitions this way.
Can I lock a partition using a simple command?
Yes, using Diskpart. Open Command Prompt as admin, type diskpart, then select volume X (replace X with the volume number), then remove letter=Y (replace Y with the drive letter). To unlock, use assign letter=Y.
Will locking a partition prevent malware from accessing it?
Not necessarily. Malware running with admin privileges can bypass these locks. For strong protection, use encryption like BitLocker and keep your system updated.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Fix 0x80070005 DISM Error & the 0x800070005 Typo
- Fix Access Denied Adding Shared Printer in Windows 10
- How to Play Minesweeper: Rules, Tips, and Winning Strategy
- Browser SQL Sandbox for Games: Build Guide
- Snapchat Face Swap: Step-by-Step Guide
- Fix a Computer Chair Height Adjuster: Step-by-Step