21

I've found that OS X supports .img files which might be resized after it was created. Interesting thing is I can not resize more than 1 time :) is it real limitation or I'm doing something wrong ?

I've made an image file via Disk Utility, selected image format: sparse. And was able write on it up to the selected size, then I was able to increase it's size once (with Disk Utility), put files up to capacity and THEN I can't resize it anymore enter image description here

5
  • @grgarsiden I checked it, but Console.app keeps silent :( Jan 31, 2016 at 20:46
  • Same problem. Tried to use hdiutil resize also give silent result.
    – SwiftMango
    Nov 23, 2017 at 4:23
  • I also get this. It is not a very informative error dialog.
    – Bill
    Apr 17, 2018 at 1:04
  • If it's a spareseimage, it's not using up the space that makes up it's capacity, until you actually copy files to it. This when you make a sparseimage, you really can make it gigantic. Make it 100GB or 1000GB. It will still take up no space until you load it up.
    – l008com
    Apr 17, 2018 at 1:24
  • You say .img in first line. Did you mean .dmg?
    – Natsfan
    Aug 28, 2018 at 16:31

1 Answer 1

33

I have the same error message.

This worked for me in Terminal (thanks to Ray's Weblog):

hdiutil resize -size 1g ~/Documents/MyDiskImage.dmg
5
  • 1
    Funny that in my case I specified -size 150g but it resized to 160GB 🤷‍♂️. However it worked, thank you! +1 Apr 4, 2020 at 9:22
  • 1
    This also works on read/write disk image, thank you. Sep 12, 2020 at 4:05
  • When I typed hdiutil resize -size 35g ~/Volumes/Transcend\ SD\ Card/Backup.dmg, the Terminal said that “No such file or directory”. Did I type it wrong somehow?
    – ensbana
    Jul 2, 2021 at 11:11
  • @Kamafeather — In 150g, the g represents 1024^3, not 1000^3, so 150g works out to approximately 161*1000^3 bytes.
    – rtx13
    Dec 10, 2022 at 4:11
  • Thank you, it's always hard to figure out what unit each different utility uses. Some use Gigabits, others Gigabytes, and it's not clear what a g or G are meant to represent. Dec 14, 2022 at 20:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .