/usr/ full up!

Discussion in 'Site & Server Administration' started by terryuk, Aug 24, 2006.

  1. #1
    My cpanel server has been e-mailing me about the /usr/ partition was running out of space but i neglected it. Now one of my websites has run out of bandwidth, and i need to change it but it says;

    'The /usr, /, or /var partition on this server is running out of disk space. This WHM operation has been temporarily suspended to prevent something bad from happening. Please ask your system admin to remove any files not in use on that partition.'

    The 'df' command says;


    'Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/hda6 8064304 7639928 14720 100% /usr'

    Any ideas how to resolve this so i can change my websites bandwidth limit?

    Help appreciated! :)
     
    terryuk, Aug 24, 2006 IP
  2. hextraordinary

    hextraordinary Well-Known Member

    Messages:
    2,171
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    105
    #2
    Delete some files from this partition.

    Some systems will keep logs on there too, so FTP them somewhere else and delete them or find anything else you can delete.
     
    hextraordinary, Aug 24, 2006 IP
  3. terryuk

    terryuk Notable Member

    Messages:
    3,962
    Likes Received:
    319
    Best Answers:
    0
    Trophy Points:
    255
    #3
    thanks for reply, but i don't know which files are going to be the big ones to delete, and what not to delete :\
     
    terryuk, Aug 24, 2006 IP
  4. Cryogenius

    Cryogenius Peon

    Messages:
    1,280
    Likes Received:
    118
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Log files are usually stored in /var, so I'm surprised that /usr is full. Look to see where /usr/tmp is stored: use ls -ld /usr/tmp, and if it's a link to /var/tmp then you need to look elsewhere. If /usr/tmp really is on /usr/, then look inside that directory for large (or many) files that are older than a day. Here are some command that may help:

    > cd /usr/tmp
    > du -s * | sort -n
    Code (markup):
    Where is your actuall web site stored? On /usr or /home? Perhaps that's got too big...?

    Cryo.
     
    Cryogenius, Aug 24, 2006 IP
  5. terryuk

    terryuk Notable Member

    Messages:
    3,962
    Likes Received:
    319
    Best Answers:
    0
    Trophy Points:
    255
    #5
    The tmp dir is in /var/tmp, but it seems like /usr/ is too big
     
    terryuk, Aug 24, 2006 IP
  6. hextraordinary

    hextraordinary Well-Known Member

    Messages:
    2,171
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    105
    #6
    Do what Cryogenius suggested in /usr/ and see what takes up all the space.
     
    hextraordinary, Aug 24, 2006 IP
  7. terryuk

    terryuk Notable Member

    Messages:
    3,962
    Likes Received:
    319
    Best Answers:
    0
    Trophy Points:
    255
    #7
    Yes, it came up with;

    root@serv [/usr]# du -s * | sort
    0 tmp
    12 aquota.user
    1320 kerberos
    20 quota.user
    24916 sbin
    32648 X11R6
    32 doc
    32 man
    4 games
    4 lost+found
    52 src
    536844 share
    555716 lib
    57348 include
    620616 local
    8368 libexec
    8 etc
    95408 bin

    I'm geussing i have to clear up about 300mb but i dont know what to delete..
     
    terryuk, Aug 24, 2006 IP
  8. theblight

    theblight Peon

    Messages:
    246
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #8
    try running the command again inside the

    /usr/local

    maybe you can find the culprit there..
     
    theblight, Aug 24, 2006 IP
  9. terryuk

    terryuk Notable Member

    Messages:
    3,962
    Likes Received:
    319
    Best Answers:
    0
    Trophy Points:
    255
    #9
    It brought up;

    108 bandmin
    14564 apache
    1892 include
    2676 gd-2.0.33
    31672 frontpage
    36 man
    43928 lib
    4 games
    4 libexec
    4 sbin
    4 src
    507344 cpanel
    52 share
    588 download
    8292 bin
    8 etc
    9436 tt2

    but i dont think i can delete lib/ or cpanel/ can i? ;\
     
    terryuk, Aug 24, 2006 IP
  10. Cryogenius

    Cryogenius Peon

    Messages:
    1,280
    Likes Received:
    118
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I made a mistake. The command should have been | sort -n (sort by number).

    What's in /usr/share, /usr/local/apache and /usr/local/frontpage?
     
    Cryogenius, Aug 24, 2006 IP
  11. terryuk

    terryuk Notable Member

    Messages:
    3,962
    Likes Received:
    319
    Best Answers:
    0
    Trophy Points:
    255
    #11
    share/ looks like it holds files for the actual server as if it were a PC, e.g;
    anaconda/ java-1.4.0/ system-config-date/
    application-registry/ java-1.4.1/ system-config-httpd/
    applications/ java-1.4.2/ system-config-keyboard/
    apps/ java-1.5.0/ system-config-language/
    aspell/ javadoc/ system-config-lvm/

    apache/ holds all apache config files etc, probably important

    I don't know whether /usr/share is needed on a server.....
     
    terryuk, Aug 24, 2006 IP
  12. Cryogenius

    Cryogenius Peon

    Messages:
    1,280
    Likes Received:
    118
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Should probably keep /usr/share. Do you have access to the package management utility? Can you uninstall any packages that you know you don't need? For example, Documentation packages are safe to get rid of (though not terribly large).

    Is this server owned by you, or some other admin?

    Cryo.

    PS: The cPanel directory is very big at 500 Mb - is this usual?

    PPS: If you want to see the directory sizes in Kb or Mb, use du -sh *. This can't be sorted, though.
     
    Cryogenius, Aug 24, 2006 IP
  13. terryuk

    terryuk Notable Member

    Messages:
    3,962
    Likes Received:
    319
    Best Answers:
    0
    Trophy Points:
    255
    #13
    Most likely, i have full root access, i just lease the server.
     
    terryuk, Aug 24, 2006 IP
  14. hextraordinary

    hextraordinary Well-Known Member

    Messages:
    2,171
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    105
    #14
    With all that I've seen so far, I still can't track where all the 8Gb of the partition went.

    You might have a problematic code that write to the disk but never closes the file, so the space is taken, but it doesn't show. you may want to restart a few services or reboot the server all together to see if this is the case.
     
    hextraordinary, Aug 24, 2006 IP
    terryuk likes this.
  15. theblight

    theblight Peon

    Messages:
    246
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #15
    the apache is important and it might also include the logs of the server..plus also look on the the logs of the cpanel...
     
    theblight, Aug 24, 2006 IP
  16. Cryogenius

    Cryogenius Peon

    Messages:
    1,280
    Likes Received:
    118
    Best Answers:
    0
    Trophy Points:
    0
    #16
    hextraordinary make a very good point. Adding up all the bytes listed in post #7 for all of /usr, I get a total of 1.84 Gb. terryuk's original post shows that /dev/hda6 is a 7.68 Gb partition. (Tip: df -h is more readable).

    Something fishy here. Have you tried a reboot as hextraordinary suggested?

    Cryo.
     
    Cryogenius, Aug 24, 2006 IP
    terryuk likes this.
  17. terryuk

    terryuk Notable Member

    Messages:
    3,962
    Likes Received:
    319
    Best Answers:
    0
    Trophy Points:
    255
    #17
    Ah thanks for the help! Restarting the server fixed it
     
    terryuk, Aug 24, 2006 IP
  18. hextraordinary

    hextraordinary Well-Known Member

    Messages:
    2,171
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    105
    #18
    Follow it closely the next few weeks, if you notice your disk space getting eaten up, that must be an application or script that writes into a file but never closes it.

    It might have been something you ran once a while ago but only now got your attention once it's eaten up your entire partition.
     
    hextraordinary, Aug 24, 2006 IP