Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rate Thread Display Modes
Old 11-27-2012, 07:58 AM   #1
Hartie
Prospect
 
Join Date: May 2012
Posts: 17
Disk image band files

Disk Images uses 50mb band-files. If i write 1mb file to dmg, does it actually write entire 50mb file? I ask this because SSD-disks can write limited times and i consider moving some of my data out of dmg to limit writes.
Hartie is offline   Reply With Quote
Old 11-27-2012, 08:37 AM   #2
agentx
Hall of Famer
 
Join Date: Feb 2003
Location: Brighton, UK
Posts: 3,806
I think Apple sparse disk image files are 8MB "bands" so maybe use that.
agentx is offline   Reply With Quote
Old 11-27-2012, 11:46 AM   #3
DeltaMac
League Commissioner
 
Join Date: Jan 2002
Posts: 7,942
50mb (50MB)? Do you have a source for that particular value? I don't think I've ever seen any info about 'banding', except for sparse image files.
DeltaMac is online now   Reply With Quote
Old 11-27-2012, 01:52 PM   #4
chabig
Hall of Famer
 
Join Date: Jan 2002
Posts: 2,930
Quote:
Originally Posted by Hartie
I ask this because SSD-disks can write limited...

You will probably never wear out your SSD:

http://www.anandtech.com/show/2829/6
chabig is offline   Reply With Quote
Old 11-29-2012, 01:27 AM   #5
Hartie
Prospect
 
Join Date: May 2012
Posts: 17
Quote:
Originally Posted by DeltaMac
50mb (50MB)? Do you have a source for that particular value? I don't think I've ever seen any info about 'banding', except for sparse image files.

I used some utility in my Mac and it showed that my recently created dmg had 50mb bands. It might be sparse image file.

So if i write 1mb file to dmg, does it actually write entire 50mb file?

Thanks
Hartie is offline   Reply With Quote
Old 11-29-2012, 02:07 AM   #6
chabig
Hall of Famer
 
Join Date: Jan 2002
Posts: 2,930
Quote:
Originally Posted by DeltaMac
50mb (50MB)? Do you have a source for that particular value? I don't think I've ever seen any info about 'banding', except for sparse image files.

Sparce BUNDLES are banded. It's easy to see how large the bands are...just open the bundle in Finder and check. I have a Sparse Bundle that's 3.87GB and it's divided into 463 bands of 8MB each. I also have a small Sparse Bundle of 102MB and it's also divided into bands of 8MB (13 of them).
chabig is offline   Reply With Quote
Old 11-29-2012, 02:16 AM   #7
chabig
Hall of Famer
 
Join Date: Jan 2002
Posts: 2,930
It's 8MB bands by default. I found the reference in the hdiutil man page:

Quote:
-type UDIF|SPARSE|SPARSEBUNDLE
-type is particular to create and is used to specify the format of empty
read/write images. It is independent of -format which is used to specify the
final read-only image format when populating an image with pre-existing content.

UDIF is the default type. If specified, a UDRW of the specified size will be cre-
ated. SPARSE creates a UDSP: a read/write single-file image which expands as is
is filled with data. SPARSEBUNDLE creates a UDSB: a read/write image backed by a
directory bundle.

By default, UDSP images grow one megabyte at a time. Introduced in 10.5, UDSB
images use 8 MB band files which grow as they are written to. -imagekey
sparse-band-size=size can be used to specify the number of 512-byte sectors that
will be added each time the image grows. Valid values for SPARSEBUNDLE range from
2048 to 16777216 sectors (1 MB to 8 GB).

The maximum size of a SPARSE image is 128 petabytes; the maximum for SPARSEBUNDLE
is just under 8 exabytes (2^63 - 512 bytes minus 1 byte). The amount of data that
can be stored in either type of sparse image is additionally bounded by the
filesystem in the image and by any partition map. compact can reclaim unused
bands in sparse images backing HFS+ filesystems. resize will only change the vir-
tual size of a sparse image. See also USING PERSISTENT SPARSE IMAGES below.

chabig is offline   Reply With Quote
Old 11-29-2012, 09:03 AM   #8
acme.mail.order
League Commissioner
 
Join Date: Sep 2003
Location: Tokyo
Posts: 6,045
Quote:
Originally Posted by Hartie
Disk Images uses 50mb band-files. If i write 1mb file to dmg, does it actually write entire 50mb file?

It will write as much as it needs - if your addition crosses a band boundary by a single byte then another band gets created. The extra space won't necessarily get written to, but it will be allocated.
acme.mail.order is offline   Reply With Quote
Old 11-29-2012, 10:53 AM   #9
fracai
MVP
 
Join Date: May 2004
Posts: 2,012
To add a bit to this, I recently ran a batch of tests that seemed to indicate that SparseBundles are pretty intelligent about what data gets written. While I haven't written anything up, the basics are that I created bundles with varying sizes of bands and then wrote to those over a network. They pretty much all had the same performance, so I can see only two advantages to using different band sizes.

1) Smaller bands will provide more opportunity for reclaiming old space with "diskutil compact"
2) Larger bands will minimize the number of bands required to represent a volume. This could be important if you try to fill a 1TB bundle using 1MB bands and the system has trouble reading the bands directory.
__________________
i am jack's amusing sig file
fracai is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 10:36 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.