13

I want Drive(Volume) D to be read-only so people can view its content but no file would be altered/added/deleted. For example if a user selects a file and clicks "delete" nothing would happen.

theroyn
  • 403
  • 3
  • 11
  • 11
    Is there a problem in using windows permissions to achieve this ? – Rohit Gupta Sep 14 '22 at 21:36
  • 1
    Please clarify if the "users" are logging in to the same computer or if they are accessing the D: drive via a network share. Also clarify if "users" includes yourself. There are multiple possible answers depending on what exactly you need. – Tonny Sep 15 '22 at 12:34
  • 4
    Could you simply burn the data to some optical medium? e.g. CD-ROM, DVD-ROM or BD-ROM (depending on how much data we're talking about)? It does require that the computer be equipped with an appropriate drive, but it's one way to absolutely guarantee it can't be edited (unlike any permission changes, which can be reversed by someone savvy enough). – Darrel Hoffman Sep 15 '22 at 15:03
  • Are you sharing this drive out over network or is this to be read-only for local users? – Mastaxx Sep 16 '22 at 15:47
  • 3
    Does this answer your question? [How to mount an NTFS partition read-only in Windows?](https://superuser.com/questions/213005/how-to-mount-an-ntfs-partition-read-only-in-windows) – phuclv Sep 25 '22 at 09:25
  • duplicates: [Is there a way to mount an NTFS partition read-only on Windows without Diskpart?](https://superuser.com/q/1663756/241386), [How can I mount a hard drive as read-only on Windows XP?](https://serverfault.com/q/36385/343888), [How to mount an NTFS partition read-only in Windows?](https://superuser.com/q/213005/241386), [Making an external hard drive "write protected"](https://superuser.com/q/926588/241386) – phuclv Sep 25 '22 at 09:27

1 Answers1

20

Since the drive is probably being used, you need to open windows in command-prompt mode:

  1. While holding down the Shift key, click the restart button in the Start menu.
  2. Click Troubleshoot.
  3. Select Advanced Options
  4. Select Command Prompt

Now we will unmount Volume(drive) D, turn it to read-only, and remount:

  1. Enter mountvol to list all the volumes. D should look something like -
   \\?\Volume{b77a3ed1-0651-5gdf-90b1-d1a3672d96e4}\
        D:\

You should remember which one was D for later.

  1. Enter mountvol D: /p which will unmount D.
  2. Enter diskpart
  3. Enter list volume and note volume D's index in the ### column. Let's say it's 1.
  4. Enter sel vol 1 to select volume D.
  5. Enter att vol set readonly yo make D read only.
  6. Enter det vol to see the volume's info and confirm that D is now read only.
  7. Enter exit to go back to the command prompt.
  8. Enter mountvol D: \\?\Volume{b77a3ed1-0651-5gdf-90b1-d1a3672d96e4}\ to remount D. Of course, replace the gibberish address from this example with the one you have listed in mountvol.
  9. reboot.

Volume D should now be read-only! No one will be able to create new files or modify existing ones and you can see that the delete option is gone when right clicking files.

You can revert this by repeating the same process and only changing step 6 to att vol clear readonly.

Enjoy!

Toby Speight
  • 4,866
  • 1
  • 26
  • 36
theroyn
  • 403
  • 3
  • 11
  • The only problem would be that it would require a real effort to intentionally write to it again. – Rohit Gupta Sep 14 '22 at 21:35
  • 6
    @RohitGupta That's the point. – Deduplicator Sep 15 '22 at 09:34
  • 10
    This is already implied by the last line, but I just wanted to highlight that **this is not a security measure/protection against malicious users**. This will only discourage writing to the drive but sufficiently knowledgeable users will still be able to revert this easily. If the drive contains important data, back it up! – user9123 Sep 15 '22 at 11:42
  • 2
    @user9123 The question does seem to imply protection against negligence, not malicious attacks. No data is truly safe from deletion by anyone with a sufficiently large hammer. – Hermann Sep 15 '22 at 15:20