Created
April 7, 2017 17:38
-
-
Save Haraguroicha/9e5e179d42a64481e33c9abadcf87565 to your computer and use it in GitHub Desktop.
Convert sparsebundle bands size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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