Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have a USB drive with some archive data on it that I'd like to access from a Mac running Snow Leopard. However, I want to ensure that the data on the drive is preserved and no modifications are made to the drive. The drive is FAT32 formatted and does not have a write-protect switch on it. How can I make the drive read-only or otherwise write-protect it by the OS so that I can ensure nothing is modified on the drive?

share|improve this question
add comment

3 Answers 3

Option 1: Mount drive read-only

You can mount the USB drive read-only by using Diskutil.

  • First, insert/mount the drive once, run diskutil list from Terminal.app and take note of the device representing the drive (should be something like /dev/diskN with N being any number).
  • Eject the disk by running diskutil unmountDisk /dev/diskN replacing N by the number noted in the first step
  • Mount the disk read-only by running diskutil mountDisk readOnly /dev/diskN

This of course requires that you actively run these commands every time you want to use the archive stick. For an automated solution, have a look at MarcoPolo or write a launchd command (see e.g. here for inspiration).

Option 2: Use access control on the drive

Does the drive really need to be formatted in FAT32 or do you only access it from a Mac OSX system anyway? In the later case, you can save the drive content on another drive, reformat it as a Mac OSX drive, move/copy the content back and take away any write rights from anybody.

share|improve this answer
add comment

If you leave the USB drive formatted as FAT32, you can't. I would propose a different solution: use Disk Utility to create an ISO9660 ("DVD/CD Master") disk image with your data and write it to the USB drive. Unfortunately, Disk Utility doesn't seem to be able to write an ISO9660 image to a USB drive. so you'll have to do it below:

  • First, insert/mount the drive once, run diskutil list from Terminal.app and take note of the device representing the drive (should be something like /dev/diskN with N being any number).

  • Eject the disk by running diskutil unmountDisk /dev/diskN replacing N by the number noted in the first step

  • Finally input sudo dd if=/path/to/your/image.cdr of=/dev/diskN

Just wait and done.

share|improve this answer
    
I tried this with an OS X ESD, and while it boots (!), I can still write to it. Clever thinking though. –  zigg Aug 6 '13 at 20:44
    
for final input "sudo dd..." can you explain the path and where we download image.cdr command doesnt recognize... –  Neil Nov 16 '13 at 14:29
add comment

If it were my data, and I really needed to not write on it, I'd put a master copy in a safe place and only ever mount a copy of that master.

share|improve this answer
    
I've actually done that, but given the large amount of data I'm talking about, a simple write-protection safeguard would go a long way to prevent having to make another copy. –  g . Oct 5 '11 at 9:00
    
It sounds like you need HDD with a hardware write-protect switch. Or, will a read-only CD or DVD do?. If you think software solution will be adequate, look at ReadOnlyMounter ( macupdate.com/app/mac/29779/readonlymounter ). "This System Preference pane is a driver and a loader to mount USB flash memory, USB HDD and FireWire HDD as read-only device. ", according to MacUpdate.com. –  JRobert Oct 5 '11 at 13:56
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.