Sometimes, I have to give my external storage someone else. But, I am worry about files and folders which accidentally deleted, moved, changed etc… Therefore, it is enough that data on the disk can be readable. Writing support not desired.
1) I want to make the partition readonly to prevent deleting and/or writing anything by anyone else.
2) When I take back my disk, I will revert it to readable/writeable mode again.
Any utility or method to achieve these goals?
Edit: I read about some hardware-based solutions and others are valid only at local PC. I am searching for globally valid and software-based solutions.
A software-based solution exists for NTFS volumes. I wrote a PowerShell script to automate explained procedure:
Everett’s solution for NTFS volumes How to mount an NTFS partition read-only in Windows?
- Switch off “automount” by running
- Connect disk to Windows (do not mount the disk)
select volume X
(where X is the correct volume number from the previous command)
att vol set readonly
detail voland ensure the read-only bit is set
Now you can mount the volume and it will be read-only.
To re-enable automatic mounting of new volumes, run
To remove the read-only flag, select the volume in
diskpart and in step 3.3 enter
att vol clear readonly.
You haven’t specified your operating system, so I will assume Windows.
The normal solution is to create a user account, set it as the owner and only one permitted to modify, and giving Everyone the read permission.
This will not work across operating systems (Linux will ignore it), and the administrator on the target machine can always simply take ownership of the disk if he feels like it. So this solution assumes some good will on the part of the recipient.
Otherwise, you will require a hardware solution. Some external disks have write-protect jumpers, such as Seagate. You can find such disks in your local or online store.
Another solution you can consider is using an encryption wrapper like TrueCrypt. I use this utility to mount my storage wherever I want and you have (password-based) options to decide whether the partition mounted can be modified or read only. Of course it takse one more step and utility to do it, but it’s a 2 chicks with one bullet – you also get your info secure.