2 Replies Latest reply: Oct 13, 2012 1:14 AM by Kevin Neal
Kevin Neal Level 2 Level 2 (480 points)

Doing a get info on my server boot drive shows its using 53Gb of space which seemed very high to me considering what is on there


So I ran the command


sudo du -chxd 1 /


it reported that /Volumes was using 39Gb


Obviously I don't just want to remove what is in there as it is all the mounted volumes and I don't want to risk deleting data on them


how can I clear out this phantom data?

  • 1. Re: /Volumes using lots of disk space
    John Lockwood Level 5 Level 5 (5,370 points)

    /Volumes contains entries for every mounted volume on your computer, so if you have any external hard disks, CDs, DVDs, or additional partitions they are show up in /Volumes and will therefore be included in that figure. What's more the actual boot drive itself also shows up in /Volumes. However normally this should not be an issue because the du (diskspace usage) command is clever enough to know the difference between files on one drive/volume/partition or another.


    What I have seen happen however on a server providing network home directories is a crash to upset entries in the /Volumes directory. What happens is that normally you have an additional volume mounted on your server, lets say it is called Users this will therefore show up in /Volumes as /Volumes/Users this is then shared by the server and network login accounts store their home directories in this. Lets say there is then a crash on the server, because there has been a crash the normal shutdown process has not occurred and as a result the normal steps that 'unmount' this volume have not occurred. Therefore when the server is rebooted the folder /Volumes/Users still exists. What can happen then is that the auto-mount process will 'mount' the volume against a new entry called /Volumes/Users-1 even though it still shows in the Finder as just having the name Users. In fact if you connected two volumes at the same time with the same name the same thing happens.


    At this point we now have two entries in /Volumes one called /Volumes/Users which is a left over from before the crash, and the new live entry which is called /Volumes/Users-1 the problem is that Open Directory is telling the users to access and store their network home directories in /Volumes/Users and that left over folder is being automatically shared by the server. Therefore when a user logs in they start automatically putting files in that leftover folder which is actually on the boot drive and no longer corresponds to the second volume.


    Potentially several Gigabytes of data could end up in their incorrect entry.


    You need to see what stuff in /Volumes is actually making up your disk space use. You can do this by the following command


    sudo du -achx /Volumes


    This should list all files/folders on the boot drive that are in /Volumes but exclude files stored on mounted drives.

  • 2. Re: /Volumes using lots of disk space
    Kevin Neal Level 2 Level 2 (480 points)

    Thanks for the reply, you are correct, I have moved my Service Data from the startup disk to its own partition on a separate drive called Server Service Data, so that if the server has a problem we can reboot from a different drive and it can still access the service data.


    However I'm seeing Server Service Data as a in-acessable folder in /Volumes as well as drive with the same name.


    In Disk Utilities my service data deive is mounting as Server Service Data-1 and this is causing all the services (profile manager, wiki, web,messages) to fail because its looking for the data in the folder not the drive.


    If I stop all the services and restart the the drive mounts at its correct path and I can turn all the services back on.


    But worringly I have tryied restarting several times and sometimes it goes back to being a folder in /Volumes


    I guess the Server Services Data drive isn't monting early enough sometimes and so this folder is automatically being created. Any Ideas what I can do, or is this just the risk of moving the service data to a separate drive?