Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I just did some data recovery on a failing hard drive. I have a 1.5 TiB DMG image of the hard drive. I don't have enough free space to simply copy the files elsewhere, and I would like to extract them in place.

How can I move the files out of the image? I just moved some files with Finder but the size of the DMG file doesn't seem to have changed. Can I shrink a the partition inside the DMG file in order to reclaim some space?

share|improve this question
    
you could create a 7z archive of the DMG image. That would likely shrink down the file size provided it is not encrypted or something. –  kush Dec 11 '12 at 18:58
    
@kush have you tested that ? I just tested on a small image I created, but the blocks are still there after a deletion, hence compression has no effect. –  Antoine Lecaille Dec 12 '12 at 9:27
    
This question suggests you are correct. –  kush Dec 12 '12 at 10:05
add comment

2 Answers

In general, you can't shrink images once they're created. It's also exceedingly difficult to grow them (disk images). The best way to save space is to try to compress the image, but that may make extraction more difficult.

share|improve this answer
add comment

When you create a DMG image you can create it using a compressed format. Once it exists however, then you either have to create a new one & transfer all the data to it, or simply compress it another way eg by turning it into a zip file.

share|improve this answer
add comment

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.