Home » 2013 » October

Archive for October, 2013

Mac OS X Disk Images

Posted 2013/10/10 By mikep345678

Create sparsebundle:
hdiutil create -size $SIZE -fs HFS+J -Volname $VOLNAME -type SPARSEBUNDLE $VOLNAME_backup

Convert to compressed sparsebundle:
hdiutil convert $VOLNAME_backup.sparsebundle -format UDBZ -o $VOLNAME_backup_compressed.sparsebundle.dmg

Mount read-only sparsebundle with read-write Shadow:
hdiutil attach -owners on $VOLNAME_backup_compressed.sparsebundle.dmg -mount required -shadow

hdiutil detach $VOLNAME

Commit changes in Shadow (can’t be done in-place; have to create new file):
hdiutil convert -format UDBZ -o $VOLNAME_backup_compressed_merged.sparsebundle.dmg $VOLNAME_backup_compressed.sparsebundle.dmg -shadow