Reclaiming deleted disk space from file vault

I have my main user account encrypted with file vault.

After deleting some data (like 20 GB) my free space on the hard drive hasn't change (yes I emptied the trash, confirmed that the files are actually gone, etc,etc). I also tried "erasing free space" in the disk utility app.

I logged off, and rebooted and so far that space hasn't been reclaimed.

I'm assuming file vault or disk utility has some method of reclaiming but I can't find it.

Any ideas?


Solution 1:

This worked for me:

  1. Log out of your filevault account
  2. Log in as the Administrator (any other user account works, but it is always a good idea to have a separate admin account)
  3. in the Terminal: su - <yourusername> will ask for you password

Make sure your computer is plugged in or the next step will fail.

  1. hdiutil compact *.sparseimage will ask for your filevault (account) password
  2. Success, 33GB freed.

Solution 2:

Disclaimer: I've never used FileVault.

This came up on the Apple Discussion Boards about a year and a half ago. From what I understand, the issue is that while there is free space, the data is still spaced out along the whole FileVault image, and needs to be compacted before being able to free up the space.

What you need before you start:
1) Filevaulted user account ( user )
2) Drive Genius application by Prosoft
3) A second admin user ( user2 )
4) Three hours (depending on the Filevault‘s size)

What you need to do:
1) Log in as another admin user
2) Open „Terminal“.
3) Navigate to the user‘s folder:
cd /Users/ user
4) Change filevaulted folder‘s and subfolder‘s permissions:
sudo chown -R user.sparsebundle user2
5) Rename sparsebundle file:
mv user.sparsebundle user.dmg
6) Open user.dmg with Drive Genius.
7) Defrag mounted image.
This will take a while depending on the actual size of the sparseimage.
8) Close application and unmount image via Finder or mark mounted folder and press „cmd + E“.
9) Rename image:
mv user.dmg user.sparsebundle
10)Change permissions:
chmod -R user.sparsebundle user
11)Log out current user ( user2 ).
12)Log in user and log out to compact the Filevault‘s sparseimage.

I'm assuming you can use any utility you have to defrag the drive (e.g. iDefrag) in place of Drive Genius.

Solution 3:

I just had the same problem and for me a simple logout and log back in was sufficient.

Solution 4:

Had exactly the same issue ... stopped getting message "FileVault cleaning up free space" and did not have enough space to try the solution of turning off the Filevault and turning it back on.

Solution:

  1. Go to the Terminal Application (you find it under Applications / Utilities / Terminal)

  2. In the terminal window type the following 2 commands:

    sudo rm -R ~/.Trash
    sudo rm -R /.Trashes
    
  3. After you enter the first command, it will ask you for your password

  4. After you type the 2nd command, then you type "exit" to finish the terminal session

  5. Log out and log back in.