The command is:
$ hdiutil create -size 150g -fs HFS+J -nospotlight -imagekey sparse-band-size=131072 -volname “hostname-backup” /tmp/HOSTNAME_MACADDRESSWITHOUTCOLONS.sparsebundle
- the maximal size of the bundle in gigabytes (created image will be initially smaller though - about 250MB)
- -fs HFS+J
- the filesystem - using HFS is the main reason for preparing image anyway. TimeMachine depends on some HFS magic.
- prevents Mac OS from indexing this image
- -imagekey sparse-band-size=131072
- some sources on the Internet claim this is the best choice in terms of performance
When the image is ready, it should be moved to the network share where backup will be stored. Choosing the new location in TimeMachine preferences is the last step.