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.

About these ads

13 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 :

    http://www.lbackup.org/manipulate_disk_images_with_hdiutil

  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. Yahoo Answers are loved by Google and many of the Yahoo Answers are sitting on high ranking especially for some highly competitive keywords. You can’t even imagine what effect can Yahoo Answers provide to the traffic of your site. Don’t wait and learn more about this at http://yanswertraffic.com/


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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: