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

4 Answers 4

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
    
What doy you suggest to remove rights the best possible way? ALC? sudo chmod? Ideally not even Spotlight should touch the volume. –  Rivera Apr 3 at 13:23
    
Just write-protect the volume in Finder. But I would go with option 1 anyway :-) –  patrix Apr 3 at 13:31

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... –  user62615 Nov 16 '13 at 14:29

Seems like editing the fstab file would be the best solution as you don't need to unmount/manually mount the volume each time. It sounds very low level solution, so not even the system/root/spotlight would modify the drive.

http://www.macissues.com/2014/09/02/how-to-make-secondary-boot-partitions-read-only-in-os-x/


  1. Open Disk Utility in the Applications > Utilities folder, and then select the volume in the device list on the left-hand side of the window. Now press Command-i to get information on the volume. In the window that pops up, locate the “Universal Unique Identifier” (UUID) string, which is a series of letters and numbers separated by dashes. Select the entire UUID and press Command-c to copy it.

  2. Open the Terminal utility

  3. Run the following command:
    sudo pico /etc/fstab

  4. Add the following line to the fstab file, and change the UUID from all zeros as shown here, to the value of the copied UUID from Disk Utility:
    UUID=00000000-0000-0000-0000-000000000000 none hfs ro

  5. Press Control-o to write the file changes, and then Control-x to exit the editor.

share|improve this answer
    
Note: the keyboard shortcuts given here for editing fstab are for emacs and may/will differ depending on your text editor of choice. –  indivisible Jul 6 at 6:52

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

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.