I am trying to compact a TimeMachine sparsebundle (to reclaim space) using
sudo hdiutil compact /Volumes/TimeMachine/MyMac.sparsebundle
and the error message that I receive is:
hdiutil: compact failed - internal error
When I look in the System Log, I see the following message:
diskimages-helper: cannot compact filesystem because it was not unmounted cleanly.
I am running on a MacBook Air (13-inch, early 2014) on Mavericks and the sparsebundle is located on an Iomega StorCenter ix2-dl NAS with 2TB running RAID 1.
When I look via Finder at my Iomega NAS share, I see that it is "mounted" (with that eject icon shown next to the share name). But if I eject the drive (to dismount it), then Terminal can no longer see the Time Machine volume when I use the hdiutil command.
UPDATE: I've tried the techniques on Garth Gillespie's blog and no issues were reported. I also used Disk Utility and it ran cleanly (no repairs).
Any help would be most appreciated.