Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Time Machine - Increase bands size + encryption
Based on:
http://endlessgeek.com/2014/03/improve-time-machine-performance-big-bands/
http://earthlingsoft.net/ssp/blog/2010/05/encrypted_time_machine_backups
The following will:
a) Convert the backup to use 128mb bands
b) Convert it to use AES-128 for encryption (the default according to https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/hdiutil.1.html)
computer-backup should be replaced with the name of the sparsebundle that was created by Time Machine.
Commands:
hdiutil convert computer-backup.sparsebundle -format UDSB -tgtimagekey sparse-band-size=262144 -encryption AES-128 -o temp.sparsebundle
cp -a computer-backup.sparsebundle/com.* temp.sparsebundle/
rm -rf computer-backup.sparsebundle
mv temp.sparsebundle computer-backup.sparsebundle
ls -la computer-backup.sparsebundle/bands
@bits01

This comment has been minimized.

Copy link

bits01 commented Oct 28, 2015

Have you noticed any performance issues with the 128MB encrypted bands? I ran some tests and backups go much faster with the default 8MB encrypted bands (though unencrypted 128MB bands are better). My theory is that if the TM client needs to update 1 byte in an encrypted band it has to move 128MB from the server to the client, decrypt it, update the byte, encrypt it, send 128MB back to the server. When it's unencrypted I suspect that you can simply update at a file offset via AFP so it's much more efficient.
It's a very tough call to make between encryption and performance for TM backups over network.
Ideally you'd want to use a server that can expose block storage which you'd encrypt on the server using LUKS and mount it as a drive from the client Mac using iSCSI, but there doesn't seem to be any decent iSCSI initiators for Mac.
Comments appreciated.

@xupefei

This comment has been minimized.

Copy link

xupefei commented Apr 22, 2019

@bits01, I just tried the command to the sparsebundle stored on my NAS (5GHz Wi-Fi connection) and didn't notice any slowdown. However, I am not using AFP, but SMB from Samba 4.8.
Also, I tried to monitor network traffic using iStats, and didn’t observe any large file movement regarding “move 128MB from the server to the client ... and send 128MB back”. The traffic seems normal (between 2 and 20MB/s), the same as using the 8MB band.

I’m not sure whether something has changed from AFP to SMB. Just write here my observation here and hope there is more evidence regarding the slowdown issue.

@zviratko

This comment has been minimized.

Copy link

zviratko commented Jun 5, 2019

Daemon tools for Mac contain a working iscsi initiator and I was easily able to backup to such a drive. The problem is how to use it when you need to restore the data? Do you make a physical image and connect it via USB? In my case I was foolish enough to force a 4k sector size over iscsi which seems to make sense and made the backups go faster but when I tried dumping it on a physical drive for restore it didn't work out at all as the partition table used different units as did the filesystem - I think that could have been corrected but since I had another backup I didn't bother to try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.