|
|
Is dmg the best format for archiving?
|
|
|
|
Mac Enthusiast
Join Date: Oct 2004
Status:
Offline
|
|
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?
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
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!
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Oct 2004
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Nov 1999
Status:
Offline
|
|
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!
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jan 2000
Location: Seattle, WA, King
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Dec 2000
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Oct 2004
Status:
Offline
|
|
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?
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Oct 2004
Status:
Offline
|
|
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?
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jul 2002
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Dec 2000
Status:
Offline
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|