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'd like the following setup:

  • A DMG file sits on my HD, taking up only the space of the contents, or perhaps only the space of the contents compressed.
  • If I double-click on it, I need to give a password for it to open
  • Once opened, I can drag files in and out, as long as I don't fill it up. The theoretical maximum should be the 4.6 or 8.3 GB DVD option from Disk Utility
  • Once I've added (or removed) files from it, I can eject / unmount it
  • When unmounted, it returns to the size of the contents and is again password protected.

Is this possible with disk images (DMGs)? What is the best way to set this up?

share|improve this question
    
you can also use truecrypt. –  Am1rr3zA Dec 31 '10 at 21:45
add comment

2 Answers 2

up vote 9 down vote accepted

This is exactly what a dmg does.

To create one use Disk Utility and hit the New Image icon. Then choose the size, encryption and choose the image format as one of the sparse images. Even if you choose a large size it will only take up space according to what you save in it.

share|improve this answer
1  
The OP specifically asks for compression, but I can't see any indication that sparse images are compressed. –  drfrogsplat Feb 16 '11 at 8:25
    
Although Disk utility uses .sparseimage as the extension for sparse disk images, you can rename it to .dmg as it's exactly that. (worth mentioning? hope so) –  Petruza Apr 15 '11 at 22:11
add comment

You can not write to a disk image where the format is compressed

… files in and out …

The compressed formats do not allow addition, edition or removal.

You can use existing files to create an image with a compressed format. Write once.

If you create a new blank disk image that is compressed — with or without encryption — it will be relatively useless:

New blank image dialogue, image format: sparse bundle disk image

image format: compressed (write-once)

Compressed — write once. The one write occurs when you create the image — not afterwards. The resulting volume is read only:

the resulting volume is read only

You can use Disk Utility to convert a compressed image to a format that allows writing. At http://www.wuala.com/%23%23Apple-support/members/grahamperrin/2011/08/04/a/?mode=gallery I posted a five-minute movie showing two conversions.

share|improve this answer
add comment

Your Answer

 
discard

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