Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Is dmg the best format for archiving?

Is dmg the best format for archiving?
Thread Tools
osxrules
Mac Enthusiast
Join Date: Oct 2004
Status: Offline
Reply With Quote
Nov 20, 2004, 12:44 PM
 
I've been using dmgs for archiving everything but one thing that's annoying me is that it uses up double the amount of space to back up a file. For instance if I want to make an image from a folder that is 650MB, the disk utility uses up 1.3GB of my hard drive to back it up. If I was to zip it, it would only use the 650MB or less.

Also, disk images don't seem to save much space even with the compression turned on. That's why people do a .dmg.gz but surely that defeats the purpose of a dmg because if I burn a dmg.gz to a cd, I can't mount a dmg.gz without copying the file or decompressing to my hard drive.

Another issue is that disk utility is painfully slow.

What I want to know is, is there a program that makes encrypted disk images fast or other storage that I can mount instantly like a dmg from a cd and has good compression ratios?
     
Millennium
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Nov 20, 2004, 01:00 PM
 
You can get somewhat better compression if you use bzip2 rather than gzip on the dmg, but the compression process is slower.

Either way, dmg is an archive format, not a compression format. As archive formats go it's actually quite good, since it preserves not just the files but the filesystem (this is what lets it preserve resource forks, for example, which tar doesn't and zip does in a nonstandard way which has compatibility issues). But as you've noticed, it doesn't have great compression built in.

To be honest, your best bet really is to use bzip2 on the dmg files. It means you can't mount it directly (which is a pain; you'd think that since Apple includes these things with the OS that they'd offer a way to transparently decompress and mount), but you'll get the most bang for your buck.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
osxrules  (op)
Mac Enthusiast
Join Date: Oct 2004
Status: Offline
Reply With Quote
Nov 20, 2004, 01:16 PM
 
To be honest, your best bet really is to use bzip2 on the dmg files. It means you can't mount it directly (which is a pain; you'd think that since Apple includes these things with the OS that they'd offer a way to transparently decompress and mount), but you'll get the most bang for your buck. [/B]
Thanks for the quick response. I wish Apple had done a bzip implementation on the fly or something if it was possible. I think they use zlib for the compression. I guess I'll have to keep with the normal dmg method. Because I burn to cd, I can't do the .dmg.bz. Never mind. Like you said, dmg is a pretty good archiving format as it is.

I really just wish it was a little faster and used less disk space when compressing.
     
Millennium
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Nov 20, 2004, 02:38 PM
 
Originally posted by osxrules:
Thanks for the quick response. I wish Apple had done a bzip implementation on the fly or something if it was possible.
Actually, it should be possible right now, using the command line. I don't know the proper command lines for working with disk images, but it should be possible to use bunzip2 on the image, send it to standard output, and then pipe that straight into the DMG-handling utility. If someone could figure out the command line for this, it would be great.

This is the best and worst thing about Unix. You can do pretty much anything from the command line, even things the developers didn't think of. Unfortunately, this tends to lead to developers not thinking about neat stuff like this.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
bmedina
Mac Elite
Join Date: Jan 2000
Location: Seattle, WA, King
Status: Offline
Reply With Quote
Nov 20, 2004, 03:41 PM
 
Originally posted by osxrules:
Also, disk images don't seem to save much space even with the compression turned on. That's why people do a .dmg.gz....
Actually, most people do a .dmg.gz because they want to post them for download, and their webservers aren't configured to serve dmg as binary, rather than text.

If you're comfortable with the command line, you can do some cool scripting using hdiutil.
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Nov 20, 2004, 03:43 PM
 
Originally posted by Millennium:
Actually, it should be possible right now, using the command line. I don't know the proper command lines for working with disk images, but it should be possible to use bunzip2 on the image, send it to standard output, and then pipe that straight into the DMG-handling utility. If someone could figure out the command line for this, it would be great.
Don't think it's possible - hdiutil wants a file that it can leave open. It doesn't seem to have any facility to read disk images from standard input, I'm afraid.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
headbirth
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Nov 20, 2004, 06:10 PM
 
are you sure your making a compressed disk image? I actually get pretty good compression with disk images and like the fact that I can quickly mount them and don't have to decompress an entire archive to get at the files I need.

Apple should consider updating their compression algorithms with something like p7zip.
     
osxrules  (op)
Mac Enthusiast
Join Date: Oct 2004
Status: Offline
Reply With Quote
Nov 21, 2004, 05:22 PM
 
headbirth, yes I am using compression. I do save some space and on occasions a lot of space - if you compress the developer docs in the mac dev folder onto a disk image, you save about half a gig of space! - Apple should really have sent the docs out like that.

Normally though, I compress media files and it doesn't save all that much but it would if a better compression method like bzip was used like Millenium said instead of zlib. What puzzles me is that even when you do a compressed image, when you mount it, it doesn't say 0k left.

It says e.g. something like 20MB free (assuming a 650MB image or so). Is that because HFS volumes can get corrupted if you overwrite the last 5% or something of the drive space? I heard one of the developers of techtool pro say that over at macfixit.

Anyway, I guess I could live with the compression but disk utility still takes up double the disk space to make an image. Does hdiutils do a better job than disk utility and is there a gui front end?
     
osxrules  (op)
Mac Enthusiast
Join Date: Oct 2004
Status: Offline
Reply With Quote
Nov 21, 2004, 05:23 PM
 
headbirth, yes I am using compression. I do save some space and on occasions a lot of space - if you compress the developer docs in the mac dev folder onto a disk image, you save about half a gig of space! - Apple should really have sent the docs out like that.

Normally though, I compress media files and it doesn't save all that much but it would if a better compression method like bzip was used like Millenium said instead of zlib. What puzzles me is that even when you do a compressed image, when you mount it, it doesn't say 0k left.

It says e.g. something like 20MB free (assuming a 650MB image or so). Is that because HFS volumes can get corrupted if you overwrite the last 5% or something of the drive space? I heard one of the developers of techtool pro say that over at macfixit.

Anyway, I guess I could live with the compression but disk utility still takes up double the disk space to make an image and it can take down the system quite often if you cancel. Does hdiutils do a better job than disk utility and is there a gui front end?
     
arekkusu
Mac Enthusiast
Join Date: Jul 2002
Status: Offline
Reply With Quote
Nov 22, 2004, 10:24 AM
 
Actually, what Apple should do is allow on-the-fly (de)compression of arbitrary folders, like Windows has had for years.

I'd love to keep /Developer/Documentation etc compressed, but not in a .dmg.
     
headbirth
Mac Elite
Join Date: May 2002
Status: Offline
Reply With Quote
Dec 4, 2004, 01:41 PM
 
Wasn't there an app back in the OS 8-9 days that did that for your entire drive? Can't think of the name? it was a forrunner of stuffit.
     
TETENAL
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
Dec 4, 2004, 02:50 PM
 
Originally posted by osxrules:
Normally though, I compress media files and it doesn't save all that much but it would if a better compression method like bzip was used like Millenium said instead of zlib.
If you have mpegs or jpegs then they can not be compressed much no matter what compression algorithm you use. They are already compressed.

Compressed disk images never take double the space of the contained files.
     
CharlesS
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Dec 4, 2004, 03:04 PM
 
Originally posted by headbirth:
Wasn't there an app back in the OS 8-9 days that did that for your entire drive? Can't think of the name? it was a forrunner of stuffit.
DiskDoubler/AutoDoubler.

It was a pain, as every time you wanted to use something, you'd have to wait for it to decompress first.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 01:36 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,