This post is for my own reference, but if it helps you, all the better. My Mac is configured to backup to a share on my Windows Home Server. The sparsebundle became corrupted and this is how I was able to repair it. Instructions for setting up Time Machine Backups to a Network Share are here.

First, connect to the share using the account that you use to back up.

Next, attach the image without mounting it using hdiutil:

 Bash | 
 
 copy code |
?

1
hdiutil attach -nomount -readwrite /Volumes/OSX/MyBundleName.sparsebundle

Finally, run fsck_hfs on the main volume:

 Bash | 
 
 copy code |
?

1
fsck_hfs -rf /dev/disk1s2