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.
-
11Is there a problem in using windows permissions to achieve this ? – Rohit Gupta Sep 14 '22 at 21:36
-
1Please 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
-
4Could 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
-
4Does this answer your question? How to mount an NTFS partition read-only in Windows? – phuclv Sep 25 '22 at 09:25
-
1duplicates: Is there a way to mount an NTFS partition read-only on Windows without Diskpart?, How can I mount a hard drive as read-only on Windows XP?, How to mount an NTFS partition read-only in Windows?, Making an external hard drive "write protected" – phuclv Sep 25 '22 at 09:27
2 Answers
Since the drive is probably being used, you need to open windows in command-prompt mode:
- While holding down the Shift key, click the restart button in the Start menu.
- Click Troubleshoot.
- Select Advanced Options
- Select Command Prompt
Now we will unmount Volume(drive) D, turn it to read-only, and remount:
- Enter
mountvolto 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.
- Enter
mountvol D: /pwhich will unmount D. - Enter
diskpart - Enter
list volumeand note volume D's index in the###column. Let's say it's1. - Enter
sel vol 1to select volume D. - Enter
att vol set readonlyyo make D read only. - Enter
det volto see the volume's info and confirm that D is now read only. - Enter
exitto go back to the command prompt. - 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 inmountvol. - 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!
- 4,967
- 453
-
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
-
10This 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
-
3@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
If your Drive D volume is in a separate storage media (e.g. hard drive, SSD, USB flash drive etc.) (in diskpart: called disk) then probably OK for you to set read-only the whole storage media. (Obviously, if there are multiple volumes on this storage media, they will also be read-only.) The method is easy:
In Windows Taskbar Search Box type
diskpartand press Enter, then wait a few seconds.In diskpart enter
list diskthen you get the list of storage medias in your system, something like:
Disk ### Status Size Free Dyn Gpt
Disk 0 Online 238 GB 0 B *
Disk 1 Online 59 GB 15 MB
In this list your drive C is for example disk 0, and your drive D is for example disk 1. (You can not read drive letters in this list but you can identify your drive D about its size (capacity).)
Enter
select disk 1Enter
att disk set readonly
That's all.
To set not read-only again, enter att disk clear readonly
- 11
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. – Community Sep 03 '23 at 13:25
-