sudo su -Make sure the mount point exists:
mkdir -p /Volumes/TMThen mount the afp share:
mount_afp 'afp://user:password@afp_server_address/share_name' /Volumes/TMNow use hdiutil to reclaim the available free space:
hdiutil compact /Volumes/TM/ComputerName.sparsebundle/unmont the share:
umount /Volumes/TM/If you get an error message saying:
hdiutil: compact failed - Resource temporarily unavailableYou must make sure you don't have the afp share mounted elsewhere, you can check your mounts with:
df -hIf the output contains a line with your afp server's address or with the string "Time Machine" you have to unmount them.
The following script will do all that for you:
SRV="afp_server_address"
SAVEIFS=$IFS
IFS=$'\n';
for v in $(df -h | grep -E "$SRV|Time\sMachine" | cut -d"%" -f3 | sed -e "s/ *\//\//"); do
umount "$v"
done
IFS=$SAVEIFS
mkdir -p /Volumes/TM
mount_afp "afp://user:password@$SRV/share" /Volumes/TM
hdiutil compact "/Volumes/TM/$(scutil --get ComputerName).sparsebundle"
umount /Volumes/TM/
No comments:
Post a Comment