Wednesday, August 24, 2022

Create sparsebundle image manually to speed up Time Machine Backup process

Just found Time Machine backup is getting slower and revised what can be done on sparse image format. Here we come with the manual method to create sparsebundle image faster enough for Time Machine backup on network shared drive.

Here's the syntax:

$ hdiutil create -size 1024GB -type SPARSEBUNDLE -encryption AES-128 -nospotlight -fs "Journaled HFS+" -imagekey sparse-band-size=262144 -verbose -volname "Backup_X" Backup_X.sparsebundle

Note:
-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). 
sparse-band-size represents the size of the ‘chunks’ that make up the sparseimage (they aren’t just one single file). Normally, the images are made in 8M chunks but those perform quite poorly over the network. The value provided above represents 128M chunks (2 * 128 * 1024 512-Byte-Blocks = 262144 = 128MB) which is a good size for a hard disk backup.

Ref:
https://github.com/0xdevalias/devalias.net/issues/89
https://mike.peay.us/blog/archives/248
https://eclecticlight.co/2020/06/18/selecting-sizes-for-sparse-bundles/
https://ss64.com/osx/hdiutil.html

No comments:

Post a Comment