|
|
A script to shrink and compress disk images easily
&& hdiutil resize -sectors `hdiutil resize \!:1.UDRW.dmg | awk \{print\ \$1\}` \!:1.UDRW.dmg \
This line can be made simpler:
&& hdiutil resize -sectors min \!:1.UDRW.dmg \Here's a size comparison: -rw------- 1 nicholas staff 458970 Mar 10 10:28 ICeCoffEE-1.3.2-awk.dmg -rw------- 1 nicholas staff 458974 Mar 10 10:25 ICeCoffEE-1.3.2-min.dmg -rw------- 1 nicholas staff 459134 Mar 10 10:21 ICeCoffEE-1.3.2-orig.dmg -rw------- 1 nicholas staff 458970 Mar 10 10:30 ICeCoffEE-1.3.2.dmgThe file named "-awk" uses the script as provided, "-min" uses "-size min" instead of "-sectors min", and "-orig" is just gzipped, not resized first. Interesting hint, thanks! hdiutil is very powerful, just hard to understand at times. Another useful space-saving hint is to create a partition map-less dmg, like this: hdiutil create "$DMG" -megabytes 5 -ov -layout NONE -fs 'HFS+' -volname "$VOL"You'll see it mount as /dev/disk#, instead of /dev/disk#s2. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|