Missing disk space after deleting user

I was cleaning up a Powerbook G4 that had worked fine for two years, before giving it to a friend. Using 10.5.2 I deleted two accounts that had 20Gb of home folders and did not use the option to keep a copy of the data. I also did not take the erase option. Just deleted the accounts and added another.

When I logged into the new account the Finder said there is only 40GB of space available on an 80GB disk, i.e. 39GB in use. The System, Library, User and Applications folders add up to about 18GB, so I'm trying to find the missing (approximately) 20GB. I understand about quickstart cache, and the Spotlight cache, but they don't add up to the missing amount.

I have tried Disk Utility Erase Deleted Space, I have used D.U. to make a dmg file and it says it is 39GB. I've looked at the invisible files, etc. Everything adds up to about 18GB, while the files system says 39GB is in use.

Shareware disk utilities (TechTool Pro, etc.) don't seem to want to optimize journaled drives (??). I did rebuild the directory structures, no effect. Only one called Baseline seem to recognize that there is only 18GB of files on the drive, but it shows data, it doesn't optimize it.

Any ideas to get the OS to recalculate the available space?

MacBook Pro Duo, 2GB; 2*PB15 G4; iMac 17 G4; iPhone 8G, Mac OS X (10.4.8), LaCie 180GB FW/USB 2.0; HP OJet 7410

Posted on Feb 18, 2008 9:04 AM

Reply
11 replies

Feb 19, 2008 2:02 AM in response to digitalFlack

digitalFlack wrote:
I also did not take the erase option. Just deleted the accounts and added another.


Sorry for asking the obvious(?), but what exactly do you mean by that? If you don't choose to erase the user account OS X will create a folder called "Deleted Users" in /Users which contains disk images (.dmg) of the deleted user. These need to be deleted manually!

Björn

Feb 19, 2008 2:26 AM in response to digitalFlack

digitalFlack wrote:
When I logged into the new account the Finder said there is only 40GB of space available on an 80GB disk, i.e. 39GB in use. The System, Library, User and Applications folders add up to about 18GB, so I'm trying to find the missing (approximately) 20GB.


In addition to the various caches & other temporary files, OS X installs includes a number of hidden folders like private/ & files like mach_kernel, all of which use disk space that won't be included by summing up the System, Library, User, and Applications folder contributions. However, they should not use more than a few extra GB, so it would seem you do have something amiss.

I'm not sure what you mean about "rebuilding directory structures," but if it doesn't mean that you have used Disk Utility's Repair Disk function, you should make that your first step in fixing things. Also note that you should not under any circumstances use a disk utility that is not specifically designed for Leopard to repair or otherwise alter a Leopard volume's file system -- they will not understand the changes Leopard has made & will most likely make things worse rather than better.

Feb 19, 2008 3:08 AM in response to digitalFlack

I've never had occasion to delete a user, so not really sure how that works, is supposed work, and what can go wrong. However, I outlined a procedure for finding missing drive space that all other things miss in this article:

http://www.pinkmutant.com/articles/TigerMisc.html

The somewhat tedious Terminal method described hasn't failed yet.
Francine

User uploaded file
Francine
Schwieder

Feb 19, 2008 9:02 AM in response to Francine Schwieder

Francine Schwieder wrote:
I've never had occasion to delete a user, so not really sure how that works, is supposed work, and what can go wrong.


When you delete a user account via the Accounts system preference, as an administrator you are given three choices:

1. Save the account's home folder as a disk image, which is moved to a deleted users folder in /Users/
2. Do not change the home folder, in effect making it owned by no user account
3. Delete the home folder completely

Choices 1 & 2 obviously don't free up the disk space used by the deleted account's home folder & the folder or its image remain in /Users/. For choice 1, the space used by the dmg file is obvious; for choice 2, the same restrictions on showing size info for other accounts apply -- you can not see the space used for folders you do not have access to, although you can see that the folders exist.

With either choice, you can later move the "orphaned" home folder or image file to the trash by authenticating as an admin user when requested. Once the trash is emptied, the space used should be freed up just as if choice 3 was used.

To this extent, no significant disk space used by a deleted account should be hidden -- everything in /Users/ should be visible with the exception of the normal invisible housekeeping items like .ds_stores, if present.

Feb 19, 2008 11:44 AM in response to R C-R

I can see that a few of my comments have misled the discussion:

Currently the Finder reports:
Library Folder 7.38 GB
Applications 6.46 GB
System 3.83 GB
Users 147.4 MB
User A 147.2 MB
Shared 208 KB

Get info on the 80GB drive says:
34.38 GB on Disk (36,912,181,248 Bytes)
Available 40.03 GB

I some how lost 18GB of space after I chose the Delete home folder option when I deleted a user account. I also tried the "Erase Fee Space" option in Disk Utility, that did not recover the missing space.

I tried running the sudo du command in Terminal, running DiskSweeper, TechTool Pro, WhatSize, WhereIsMyData, a few others, and then made all files visible in the Finder; all confirmed the details shown above and listed the visible and invisible files that do not add up to there being 34.38 GB in use.

I used Disk Utility to create a .dmg file on an external drive (uncompressed) it was 35.88 GB in size. I ran the above disk utilities on that dmg, they found only 18GB of files.

"Back in the day" disk defragmentation software would reclaim tracks and sectors left over from deleted files and edited files, etc. I haven't kept up with disk technology but it seems to me that even optimization software like TechTool Pro does not optimize journalized disks.

I still have a dmg that says 35.88 Gb but only contains 18Gb of files

Looks like I need to do an erase and install after copying the files to an unjournaled partition somewhere.

Thanks for the inputs...

Flack

Feb 19, 2008 12:45 PM in response to digitalFlack

I don't believe your missing space issue has anything directly to do with disk fragmentation -- that only affects continuous chunks of available free space, not the overall amount of it available on the volume. Your files could be fragmented into thousands of discontinuous chunks across many different tracks & the only thing that would happen is that they would take longer to load. Free sectors are free sectors, no matter where they are, & their total is the available free space of the volume, period.

However, you still haven't explained what you meant about rebuilding the directory or how you did that. As before, I strongly suggest you run Disk Utility from the Leopard Utilities folder & check the drive's file structures with the "Verify Disk" First Aid function before doing anything else. It isn't impossible that you have cross-linked files or other problems that make files seem to use sectors they do not, some possibly caused by using a disk utility that isn't designed for Leopard's file system enhancements.

Also, it might help if you copied the du command you used & its output from Terminal to a post -- it should show quite a bit more than the folders & sizes you listed in your last post, so we would have a better idea of how much space actually is unaccounted for.

Feb 19, 2008 1:41 PM in response to digitalFlack

Too late to include in my last reply, I noticed your comment about needing to copy the files to an unjournaled partition somewhere. Journalling doesn't have any effect on file size or fragmentation -- it is essentially a method of recording pending file changes so that should that process be interrupted, the file system knows what files might be out-of-date without going through the entire file system.

More to the point, in a UNIX-based system like OS X, you cannot simply manually copy system-related directories from volume to volume on a piecemeal basis & expect to preserve the internal links they depend on for correct interoperation. (This is why you can't produce a bootable clone of an OS X installation with a Finder copy.) You can freely copy user files this way (assuming you preserve access permissions as required for your purposes) but not system files. You may or may not be successful copying applications this way, depending on the application & how it is installed.

If you are giving away or selling the computer, you also need to consider licensing issues: if you install Leopard or other licensed commercial software on the computer, you must generally also include the license to use it. So for instance, you should not install commercial applications on the computer if you wish to retain the license to use it on the computer you retain. This being the case, you might as well reinstall the OS & any apps from the disks you include with the computer, or just wipe its drive & let the new owner start from scratch.

Feb 22, 2008 6:11 PM in response to R C-R

Francine,

Following directions more carefully, I think I have found the problem but still need help.

On the first computer, I did an erase and install, space recovered. I now suspect I wasn't patient enough when running the sudo du -cxhd 1 / command

I just decided to clean a dead account off my daughters computer, also a three year old PB15 G4. It was running Tiger, I used the Preferences -> Account panel to delete a user without saving the data in another file. Once again the data (14+GB) was not recovered by the Finder.

With hindsight, I remember that a few years ago when I deleted a user it took twenty minutes for the system to go through the thousands of files and mark them deleted. In today's case the system just removed the account name from the account list and increased the available disk space by a GB or two.

Missing approx 15GB, I went back to the pinkmutant website and followed the instructions again. This time, after I typed the sudo du command I waited 15 minutes and whoa! up pops a 16G /.Trashes entry

Last problem for he solution:

I tried ls -alh /.Trashes it says permission denied
I did a cd /.Trashes it takes me into the directory, but ls -alh says permission denied again.

Any ideas on how to see the /.Trashes folder and delete what is in it?

Thanks for your attention and assistance.

John


PS: Thanks for the reminder on software, I'm ex Apple, Palm and Motorola so I'm pretty conscientious on software licensing. If I sell a system with software I include the original disks and licenses. My dillema, off topic for this thread, is that I bought Family Packs of Tiger and Leopard when I had five G4s. Now, I have bought two Intel MacBooks with Leopard on them. I'm reluctant to back out the updates and I'm not making copies of the OS disk. Fortunately one went to a relative, the other will sit around a while.

Feb 22, 2008 10:41 PM in response to digitalFlack

Afraid I keep my Trash always empty, but if the permission is denied, use a super user do command again. As I recall there may well be a sub-folder in the .Trashes with the account number. You may have more than one, if something is also in a sub-folder for your own account. You can check your account's number, since you'll be in the Terminal anyway, by typing the "id" command. You'll get something like this:

NoobiX:~ francine$ id
uid=501(francine) gid=20(staff) groups=20(staff),102(com.apple.sharepoint.group.2),98(_lpadmin),101 (com.apple.sharepoint.group.1),80(admin),501(francine)

The "uid=501" is my account number. You'll want to remove the stuff in the folder that has a number other than your own--that should be the trashed other account (presuming you only had two accounts on the computer).

So you would change directory into the .Trashes folder, do a sudo ls -alh on the directory you think is the trashed account, then remove things recursively:

NoobiX:~ francine$ cd /.Trashes
NoobiX:.Trashes francine$ sudo ls -al
Password:
d-wx-wx-wt@ 2 root _unknown 68B Feb 15 12:51 .
drwxrwxr-t@ 37 root admin 1.3K Feb 16 23:01 ..
drwx------@ 4 francine staff 136 Feb 22 22:17 501
drwx------@ 4 other staff 136 Feb 22 22:17 502
NoobiX:.Trashes francine$ cd 502
NoobiX:502 francine$ sudo ls -al
total 16
drwx------@ 4 other staff 136 Feb 22 22:17 .
d-wx-wx-wt@ 4 root admin 136 Feb 22 22:03 ..
-rw-------@ 1 other staff 6148 Feb 22 22:17 .DS_Store
drwxr-xr-x 2 other admin 68 Feb 22 22:09 folders
and so on (list of folders from the deleted account)

When you are sure that you are in the correct folder (in the case above it is /.Trashes/502) you can do a sudo remove. You can NOT undo a sudo remove so that is why I recommend doing the list command to be sure you are going to be removing the correct stuff. So put yourself back up into the .Trashes directory, cd /.Trashes will do it, then issue the remove recursively command:

NoobiX:.Trashes francine$ sudo rm -r 502

That should nuke the 502 folder and all that it contains. Again, this example may not be the exact number of your deleted account. Generally the first admin account is 501, the next account is 502, and so on. Your uid numbers may be different.
Francine

User uploaded file
Francine
Schwieder

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Missing disk space after deleting user

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.