One utile bone X characteristic is the power to make disc effigy . A disk range of a function is a exclusive file that , when twofold - cluck , appears like a typical backbreaking driving to the operating system . ( Most software you download comes on a disk image . ) Disk prototype a great way to store related files that you do n’t call for to habituate often , as they can be “ out of sight ” until you need them . They ’re also useful if you desire to lay in something securely , as you’re able to make inscribe disk images that ask a countersign to mount .
There are fundamentally two types of record effigy — a normal disc image and a thin disk image . With a normal disk image , the disk range will consume as much drive outer space as its size , even when empty — i.e. a 40 MB normal disk image requires 40 megabit of driving infinite , even if you ’ve never used it . Sparse phonograph record mental image , on the other mitt , are disk image files that require just as much blank as their contents take . So a 40 megabyte sparse disk ikon will only take 40 MB of drive quad if you ’ve save 40 MB of data onto it . The phonograph recording image will grow automatically as space is required .
However , while sparse disk images can grow mechanically as needed , they can not shrink automatically . So if you tally 40 MB of information to the image , then delete that same data , the sparse record image will still ask 40 megabit of drive quad . Using Terminal , you may shrink thin magnetic disc images to unfreeze up this waste space . Justcdto the directory stop the sparse image ( make trusted it ’s not mounted ) , and then issue this command :
But using Terminal is a spot of a pain . A much nicer solution is to use Automator to build a Finder plug - in , so you could squeeze your sparse image via the Finder ’s contextual menu . And it ’s a very simple Automator workflow that need to be built , lie in of only two steps .
commence by launch Automator , which you ’ll find in /Applications - > Utilities . In the Library tower , tap Finder , and then drag Get take Finder Items from the Action chromatography column into the vacuous work domain on the right . For the second step , press the Automator entry in Library , and then embroil Run Shell Script into the work area , below the survive command . In the work area for the Run Shell Script action , set the Shell pop - up to /bin / bash ( it should be that by default ) , and go down Pass Input to “ as arguments ” ( which is not the default ) . Where you see the existing script ( for f in … , etc . ) , wipe out all of it , and supplant it with this one stemma :
That ’s it — that ’s the entire workflow . Choose File - > Save as Plug - In , and in the new dialog that appears , name your workflow ( Compact sparse image , or whatever you want to see in the contextual menu ) , and ensure the Plug - in For pop - up is set to Finder ( the nonpayment ) . Click Save and you ’re done .
To use your workflow , take a sparseimage file in the Finder ( ensure the disk epitome is not mounted ) , control - press it , and then choose Automator - > Compact Sparse Image ( or whatever you named your work flow ) from the pour down - up menu . The workflow will run ( you ’ll see its advancement in the menu bar ) , and any spare space on your sparse disc icon will be released .