Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to make a HD read only to prevent any real changes(except turning off read only). The reason is the hard drive seems to get corrupt for no reason because I never write to it except in rare cases. It is a HD used for storage and all the data is generally read only.

What happens. I believe, is that the sata cable has problems and when booting up windows either thinks the MFT is bad because the cable gives errors, or at some point wrote data that was corrupt because of the bad cable(or possible SATA controller).

In any case, the drive shouldn't be written to when I'm not writing data... but if I had some way to prevent data from being written when I don't want it to then I could determine if it's the drive or not(since eventually it will become corrupt) and potentially prevent having to copy all the data back to the drive.

The drive's MFT becomes corrupt as far as I can tell, not the files. So, standard file security settings won't work. Is there any way to mark a partition or drive as read only in windows to really prevent writing? (but of course change the flag to write when writing is required)

share|improve this question
    
You could run attrib +r /s /d but I've never tried it and couldn't promise that it would have a good outcome. You should probably replace the SATA cable if you think that's the problem, maybe even the drive. –  Mark Allen Mar 3 '13 at 6:52
    
@MarkAllen I've tried changing the cable and the port it is on. attrib won't solve the MFT problem. I've replaced the drive once and the same problem occurs. It is rare but when it happens it is a PITA. The drive always works well with no bad sectors after a format and SMAART returns only CRC errors in the comm(no bad sectors). I would hope surely there is a way to make the OS not write to the HD, which would help me diagnose the problem and potentially solve it. –  Archival Mar 3 '13 at 7:05
    
A similar question: How to make read-only a partition on external storage? And revert to normal? It has no answer, and I guess there's no universal software-based solution to this. –  Alexey Ivanov Mar 3 '13 at 17:55
3  
Try the other answer then. FWIW I'd never do any of this - this isn't how one troubleshoots a hard drive. (Back up your data so that it no longer matters, then start actually troubleshooting the problem.) –  Mark Allen Mar 3 '13 at 19:01
    
Always happy to help such a gracious and reasonable person such as yourself. Not sure what I did to anger you, my apologies. –  Mark Allen Mar 3 '13 at 22:07
add comment

1 Answer

First of all, I'd suggest replacing your SATA cable with a new one. It's a robust solution even though you'll make your partition read-only.

This solution by Everett from another question may work for you:

  • Switch off "automount" by running mountvol.exe /N
  • Connect disk to Windows (do not mount the disk)
  • Run diskpart
    • Enter list volume
    • Enter select volume X (where X is the correct volume number from the previous command)
    • Enter att vol set readonly
    • Enter detail vol and ensure the read-only bit is set

Now you can mount the volume, the volume will be read-only.

To re-enable automatic mounting of new volumes use mountvol.exe /E.
To remove the read-only flag, select the volume in diskpart (use the commands above) and enter att vol clear readonly.

share|improve this answer
    
These seems like it should work. I am in the process of copying the data to the drive and will try it when done. –  Archival Mar 3 '13 at 21:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.