How to free up disk space?

Discussion in 'Linux VPS/Dedicated - cPanel' started by arowana, Apr 9, 2007.

  1. arowana

    arowana New Member

    In my Power Panel,i see that my disk usage is going up at an unusual rate.From a 6 gb + to 4.92 gb diskspace available now.Just wondering if this is normal or?Also,i just ran a du -h --max-depth=1 command and here's the results

    Any idea where the usage went to?Any more SSH commands to ran?
  2. Dan

    Dan Moderator

    Looks to me like you ran du in the root directory. After you log in do a cd / and then run it again.

    If you upgrade CPanel or even any software through WHM then there will be folders created in the /home folder that you can go ahead and get rid of assuming everything is running alright.

    Hope that helps,

  3. arowana

    arowana New Member

    Hi.Thanks for the reply.:) Here's what i got again after i ran du:
    /home folder?u mean delete everything in the tmp folder or?:confused:
  4. Dan

    Dan Moderator

    Hello arowana,

    I'm afraid you may have cut du off before it was finished running. I just ran it here and it pauses for quite a while at the same point you posted as it's sizing up some pretty large directories. You can try it again and be sure to let it finish running (your prompt will return). You can run it on your home directory all by it's self too du /home -h --max-depth=1. If you see folders there other than what you've created in the way of user accounts then they are most likely from cpanel/software updates. I always set cpanel updates to manual myself and then just run it every now and then. You can post the results here if you're unsure of course.
  5. arowana

    arowana New Member

    Here's the stats again.Can anyone tell me which and how to delete them off please?
  6. khiltd

    khiltd New Member

    You're going to have to go through asiarcom's home folder and do some housecleaning. There's nothing there that you can just flat out delete without further inspection unless asiarcom is no longer an active user.
  7. Dan

    Dan Moderator

    Hello arowana and khiltd,


    I always delete things like
    you do not think it's safe to do so? these are the downloaded files before those particular modules have been upgraded from what I have been able to ascertain.


    While I see over 300 meg there that I feel is safe to remove that does not account for the 1.1 gig difference that you're saying you've lost. was the 6 gig number you gave before you put your account (asiarcom) in as well? that would be a total of 800 meg anyways...

    I would change directories to the home directory before removal of those folders just to be safe so it would be
    cd /home
    rm -f -r dirname
    be very wary though as with the -f switch you get not prompt asking if you're sure
  8. arowana

    arowana New Member

    Thanks khiltd and Dan for your pointers.I'll try each method and see.You guys and KH are great! :) Thanks!
  9. khiltd

    khiltd New Member

    If you never intend to rebuild Apache or any of its associated modules it might make sense. Otherwise I'd leave those source trees where they lay.
  10. KH-Paul

    KH-Paul CTO Staff Member

    It is absolutely safe to remove /home/cpapachebuild directory after recompilation was completed. If you'll ever need to recompile Apache/PHP again cPanel will automatically download source tarballs and will re-create this directory using the latest source code. Keeping this directory in place doesn't do anything good but takes ~250MB of your disk space

  11. khiltd

    khiltd New Member

    It saves an awful lot of time and that can be good when you accidentally rebuild without a certain option that breaks entire sites and you have to do it all over again in a hurry.
  12. KH-Paul

    KH-Paul CTO Staff Member

    Sure, if mistake in options selection was made or some additional option is required then, sure, existing source code will help to correct such mistake a bit faster. Incorrect compilation usually gets detected within couple minutes and, as such, just keep the source code for couple hours and then kill the /home/cpapachebuild directory to free up some disk space.
    On the other hand I've seen more than single case when existing source code negatively affected Apache/PHP compilation process. As one of the examples - php upgrade from 4.x to 5.x can go completely wrong if you already have old source code left from previous PHP 4.x compilation and "Skip Apache Build if up to date" option wasn't checked.


Share This Page