How can I mount a hard drive as read-only on Windows XP?

There is a built-in mehanism to mount a filesystem read-only in Windows, sort of. It's definitely not like a read-only mount on a *nix operating system.

This Superuser.com answer has details. The change you're making using diskpart to toggle a readonly attribute on the volume is making changes to the "read-only" disk. You're modifying the disk to prevent it from being modified. In particular, toggling this bit and forgetting to toggle it back off prevents Windows from booting when you return the disk back to the source system.

This is a suitable technique for troubleshooting but is not a suitable technique for forensic purposes. In that case you really either need to mount it in an operating system that does support read-only mounts, or, best of all, use a hardware-based write-blocker. For serious forensic work you should always use a hardware write-blocker in every step of the process (and you should always be working with images of the original drive after you image and create a signature for the original drive).

As an alternative method, I would consider imaging the source drive with a non-Windows operating system onto a new drive, and working with the new drive in Windows.

N.B. This does not work in XP, since the XP edition of diskpart does no include the "attrib" command that the answer relies on.


I'm answering quite late, but it might help someone else.

Everett's solution on superuser explains how to modify the volume attributes to make it read-only.


You can use WriteProt, a little command line tool that enables you to write protect a filesystem on Windows.


I've got this bookmarked from a while back, but I've never tried it: http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.windows.file_system&tid=4b1a14f7-6bd2-4c9f-ae64-df57c35712bf&cat=&lang=&cr=&sloc=&p=1

The 4th post (by Edwin) has the solution I am talking about.


Solution:

From: http://www.autorunremover.com/

"You can set the USB port status to Read only or Readable/Writable with Autorun Virus Remover ..."

Conclusion: if you place your hard drive in an external hard drive case with a USB cable, you can ensure that its mounted as read only.

According to Software Informer there is over 4,078 people with this utility installed on their computer as of 2009-07-07.

Note of caution: when this utility is installed for the very first time it scans external hard drives. Suggest a thorough test flight on another external USB drive before committing your life to it.