Make Disk Or Partition Readonly in Windows 10

In one of the previous articles, I covered how to write-protect removable USB drives. Today, we'll see how to write protect a specific non-removable disk partition or the entire disk drive without using third-party tools.


There are many reasons to make a disk write-protected. It can be useful as an additional security option in some environments. Once you enable write protection for a drive or a partition, it will become read-only. Let's see how it can be done.

To make a disk readonly in Windows 10, do the following.

  1. Open an elevated command prompt.Elevated Command Prompt
  2. Type or copy-paste diskpart and press the Enter key. This will launch DiskPart. DiskPart is a text-mode command interpreter bundled with Windows 10. This tool enables you to manage objects (disks, partitions, or volumes) by using scripts or direct input at a command prompt.Run Diskpart
  3. In DiskPart, type the following command
    list disk

    In the output, see the disk which you are about to make read-only.Diskpart List Disk

  4. To continue with the required disk, you need to "select" it.
    In the following command use the disk number you got from the previous command.

    sele disk DISK_NUMBER

    For example, I need disk #1.Diskpart Sele Disk

  5. To make the whole disk read-only, type the following command:
    attributes disk set readonly

All partitions on the disk will be read-only.Windows 10 Make Disk Readonly

Windows 10 Disk Is Readonly

The undo command is

attributes disk clear readonly

Windows 10 Clear Disk Readonly State

To make a partition readonly in Windows 10, do the following.

  1. Open an elevated command prompt.Elevated Command Prompt
  2. Type or copy-paste diskpart and press the Enter key.
  3. To find a specific partition, type
    list volume

    Diskpart List Volume

  4. "Select" the required volume by typing the following command:
    select volume VOLUME_NUMBER

    Replace the volume number with a number you got from the previous command.Diskpart Select Volume

  5. Make it read-only using the following command
    attributes volume set readonly

    Windows Make Partition Readonly

The specified volume will be read-only.

Windows Readonly Partition

The undo command is:

attributes volume clear readonly

That's it.

Leave a Reply

Your email address will not be published. Required fields are marked *