My disk is out of space all of a sudden and I found out that a directory in /Users/.harith/harith.sparsebundle is using 178 gigs of space. What is this directory? How/Why is my mac using it. Is it safe if I remove the directory?
/Users/.harith/harith.sparsebundle is the encrypted contents of your home directory. When you are logged in (as user
harith), then the unecrypted contents of that same directory are visible under
/Users/harith, that is, your home directory.
So what you're seeing is, your hard disk is full. And your home directory is taking up 178 GiB of space.
IT IS NOT SAFE TO DELETE
/Users/.harith/harith.sparsebundle!!!!! This is your home directory's files, and deleting this will delete or corrupt your home directory!!!
What you will want to do is look for large files within your home directory, and move those to an external drive. As @lemonginger mentioned, movies and music are good places to look, but not so they're not being decrypted as he said, that's irrelevant. And don't just move them anywhere, you need to move them to a different hard drive otherwise you won't solve the problem.
If you don't have a second hard drive, consider moving files to a cloud-based storage system, such as Apple's iCloud service or Amazon's Cloud Drive. This can be either a permanent solution, or a temporary storage space until you can expand your local disk storage. Amazon may be a good choice because they offer 5 GB at no cost, and I believe you can get up to 20GB free if you purchase any MP3 from them.
In order to reduce the size of your home directory's encrypted sparsebundle, you need to log out. After you log out, if you have deleted files from within your FileVault home directory, you will see a dialog appear with a progress indicator which states "Reclaiming unused space in home directory". What this is actually doing is removing the parts of
/Users/.harith/harith.sparsebundle which are no longer in use (because you have deleted files).
A side note:
/Users/.harith/harith.sparsebundle is only when you are logged in. When you log out,
/Users/.harith/harith.sparsebundle is moved to
/Users/harith/harith.sparsebundle, and it's moved back when you next log in.
It sounds like you are running File Vault and that is your Home directory. A useful tip if you are using older versions of File Vault is to store a lot of your music and movies outside of your home folder, so that they aren't being encrypted and decrypted all the time. Or upgrade to lion, which handles encryption completely differently (and much better IMHO)