advertisement
Forums

The Forum is sponsored by 
 

AAPL stock: Click Here

You are currently viewing the Tips and Deals forum
About sparse disk images...?
Posted by: RAMd®d
Date: December 17, 2021 07:07PM
Ok, I know how to create a sparse disk image, or thought I did.

I go through the steps, and I get a 100MB sdi that I can't add anything to unless it's less then 97MB.

The idea of an sdi is that it expands as content is added.

But that's not happening.

I've found one mention online that said one makes an sdi and decides on a maximum size, say 20G.

Then any file smaller than 20G can be added, and the only space used on an HDD/SSD is that equal to the files placed in the sdi.

Is that correct, the sdi itself doesn't expand, but it's the disk space used on the HDD/SDD that does?

Was this always the case, because I've been under the impression it was the sdi itself that expanded.

I've never thought to make an sdi so this is all news to me.

So I made a test sdi of 100MB and tried to but 200MB on it, no joy, and hair pulling ensued.

I've seen references of using Disk Utility to change sized of an sdi, but I thought this was automatically done.

And apparently if I use all the space on one then dump half the files later, I don't get any of that HDD/SDD space back, without manually resizing the sdi.






I am that Masked Man.

Your boos mean nothing to me, I've seen what you cheer for.

Insisting on your rights without acknowledging your responsibilities isn’t freedom, it’s adolescence.

I've been to the edge of the map, and there be monsters.

We are a government of laws, not men.

Everybody counts or nobody counts.

When a good man is hurt,
all who would be called good
must suffer with him.

You and I have memories longer than the road that stretches out ahead.

There is no safety for honest men except
by believing all possible evil of evil men.

We don’t do focus groups. They just ensure that you don’t offend anyone, and produce bland inoffensive products. —Sir Jonathan Ive

An armed society is a polite society.
And hope is a lousy defense.

You make me pull, I'll put you down.

I *love* SIGs. It's Glocks I hate.
Options:  Reply • Quote
Re: About sparse disk images...?
Posted by: Sarcany
Date: December 17, 2021 07:27PM
This empty sparse image was 10.5MB when saved. (There's some overhead always added to the size of a sparse image file.):



The 100MB size in the original definition of the file is the maximum capacity of the image.

The correlation between the size of the image file and the size of the files added to it is not perfect. I added a 16.8MB file to the mounted image. The image file grew to 26.2MB.

I deleted the 16.8MB file and the image-size remained at 26.2MB. Sparse images grow up to their maximum capacity when you add files but do not reduce in size when you delete files.

...There are Terminal commands that you can use to change the maximum capacity of a sparse image file or to reduce the actual size of the image file after you delete some of its contents.



Options:  Reply • Quote
Re: About sparse disk images...?
Posted by: GGD
Date: December 17, 2021 07:33PM
I think you're misunderstanding how a Sparse Disk Image/Bundle works.

The benefit it that the amount of actual disk space he image file takes is about equal to the "used" space of the contents of the disk image.

BUT you need to initially create the Sparse Disk with a volume size of the maximum you'll ever want to store on it.

What you found with an example of creating it with 20G is correct. It will have a maximum capacity of 20G but initially it will use a very small amount of physical disk space because there are no files stored on it. As you add files to it, the space the image file needs will grow.

BTW: Spare Bundles are the preferred format, they came after Spare Images.
Options:  Reply • Quote
Re: About sparse disk images...?
Posted by: RAMd®d
Date: December 17, 2021 08:31PM
I think you're misunderstanding how a Sparse Disk Image/Bundle works.


I did, initially, but in my example it seemed to make sense, but in Apple's example, they didn't make it clear.

So I'll do it again, but use sparse bundle because it's newer (10.5?) and improved.






I am that Masked Man.

Your boos mean nothing to me, I've seen what you cheer for.

Insisting on your rights without acknowledging your responsibilities isn’t freedom, it’s adolescence.

I've been to the edge of the map, and there be monsters.

We are a government of laws, not men.

Everybody counts or nobody counts.

When a good man is hurt,
all who would be called good
must suffer with him.

You and I have memories longer than the road that stretches out ahead.

There is no safety for honest men except
by believing all possible evil of evil men.

We don’t do focus groups. They just ensure that you don’t offend anyone, and produce bland inoffensive products. —Sir Jonathan Ive

An armed society is a polite society.
And hope is a lousy defense.

You make me pull, I'll put you down.

I *love* SIGs. It's Glocks I hate.
Options:  Reply • Quote
Re: About sparse disk images...?
Posted by: Sarcany
Date: December 17, 2021 09:22PM
Quote
RAMd®d
I think you're misunderstanding how a Sparse Disk Image/Bundle works.


I did, initially, but in my example it seemed to make sense, but in Apple's example, they didn't make it clear.

So I'll do it again, but use sparse bundle because it's newer (10.5?) and improved.

Sparse bundles are not single files.

A bundle is a folder that appears to the user in the GUI to be a file, but inside the folder is a collection of files.

In the sparse bundle will be a collection of "bands." Each band contains a small chunk of data. As you fill the sparse bundle, the number of bands will grow.

This offers a few advantages, namely that when you're running an incremental backup only the changed/new bands need to get copied to your backup drive. And "Shrinking" a regular sparse image file to recover the unused capacity after you delete some of the contents can take a very long time and is computationally-intensive, but shrinking a sparse bundle involves just deleting the unused bands so it can go very quickly.



Options:  Reply • Quote
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 92
Record Number of Users: 186 on February 20, 2020
Record Number of Guests: 5122 on October 03, 2020