Ray's Weblog
Just another WordPress.com weblog

Resize a Sparse Bundle Image using Terminal

A Sparse Bundle Image will increase in size automatically but will not shrink automatically. Before shrinking the sparse bundle, mount it and empty the trash to get rid of any deleted items from the image.

Unmount the image and follow the commands below.

To compact (image size stays the same):
hdiutil compact ~/Documents/filename.sparsebundle
hdiutil compact -help (for a list of options)

To increase the image size (eg., 20G to 30G)
hdiutil resize -size 30g ~/Documents/filename.sparsebundle
hdiutil resize -help (for a list of options)

Mount the image then do a Get Info on the Volume to see the new size.

18 Responses to “Resize a Sparse Bundle Image using Terminal”

  1. Thanks for posting this. Google found it first and I didn’t have to go look it up myself. Thanks!

  2. Thanks for the helpful tip! I just ran out of room on my disk image and couldn’t figure out how to resize from disk utility. This worked like a charm.

  3. This does not seem to work with a FileVault’s sparsebundle.

    hdiutil: compact failed

    User is logged out, sparsebundle owned by user2

  4. Is it possible to resize a volume while it is mounted?

  5. I don’t think you can resize it while mounted. I’m not a guru at this stuff but I think I tried to research this as well, it’s been a while.

  6. According to https://discussions.apple.com/thread/1933761?threadID=1933761 you can resize with…

    hdiutil resize -size 250g

    I haven’t tried it yet, but others reports that it works.

  7. You may find the information and examples available from the following URL helpful with regards using the terminal to resize a disk image using the ‘hdiutil’ command :


  8. thanks! so simple now that i read this. glad it came up first on google so i could find it. wasted so much time trying with disk utility. thanks!

  9. I thought sparse bundles were supposed to automatically get bigger, but I kept getting “not enough free space” when copying 20 GB to a 16 GB image. I couldn’t make it bigger than 16 GB with Disk Utility either! I finally got it up to 32 GB with this command, so thanks!

  10. […] Resize a Sparse Bundle Image using Terminal « Ray’s Weblog. Share this:TwitterFacebookLike this:Mi piaceBe the first to like this.   […]

  11. Thank you, this really helped me!

  12. Worked perfectly, thank you!

  13. […] July 20, 2012 (Original from Ray’s Weblog) […]

  14. anyone else noticed a limit in the size you can resize? Increasing 500GB works, 1000G won’t. There’ no documentation in the man pages

  15. […] Source https://ep1curus.wordpress.com/2008/12/16/resize-a-sparse-bundle-image-using-terminal/ […]

  16. If a sparsebundle will increase in size automatically, why would you use a “hdiutil resize” command on it? Seems unnecessary. Am I missing something?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: