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 have several disk images in IMG format, which contain whole file system images presumably in ext2. I want to remove free sectors and therefore wasted space in the images. Is there any way in OS X/ Ubuntu / Windows to do this? Thank you for your reply in advance!

share|improve this question

migrated from stackoverflow.com Nov 23 '12 at 8:49

This question came from our site for professional and enthusiast programmers.

Why "presumably in ext2"? OSX doesn't use ext2, it uses hpfs+. –  Paul Tomblin Nov 23 '12 at 3:17
@PaulTomblin: think you mean HFS+ –  NSGod Nov 23 '12 at 3:32
You are correct. hpfs was in OS/2, wasn't it? –  Paul Tomblin Nov 23 '12 at 3:39
What's this got to do with programming? –  trojanfoe Nov 23 '12 at 7:37
@PaulTomblin: As disk images can contain whole file systems too, the disk image filesystem is ext2 and not HFS+/hpfs/NTFS/etc.. I would like to reduce the size of a disk image with a filesystem which may not be the default filesystem of the OS while maintaining its (the disk image's filesystem) boot abilities. trojanfoe: Sorry, this is for a programming project so I mixed up things in mind :) –  blacktea Nov 23 '12 at 15:28

Your Answer


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

Browse other questions tagged or ask your own question.