Skip to content

Instantly share code, notes, and snippets.

@Haraguroicha
Created April 7, 2017 17:38
Show Gist options
  • Save Haraguroicha/9e5e179d42a64481e33c9abadcf87565 to your computer and use it in GitHub Desktop.
Save Haraguroicha/9e5e179d42a64481e33c9abadcf87565 to your computer and use it in GitHub Desktop.
Convert sparsebundle bands size
#!/bin/bash
IFS=$'\n'
bMB=1024 # default is 8MB each size, I'm use 1GB each size, also recommend at lease 128MB each size
sbs=$(($bMB * 2 * 1024))
function hdc {
mv $1 temp.sparsebundle
hdiutil convert temp.sparsebundle -format UDSB -tgtimagekey sparse-band-size=$sbs -o $1
cp -a temp.sparsebundle/com.* $1/
}
if [ ! "$1" == "" ]; then
hdc $1
else
sb=`ls | grep .sparsebundle`
for b in $sb
do
hdc $b
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment