Centos freeing up disk space

27,642

Run du -sh on /usr and /root to see if your /root is not filled with some useless files or if on /usr you can de-install some program you not use.

You can use gParted to expand your partition, it's safe normaly.

Share:
27,642

Related videos on Youtube

chris chaney
Author by

chris chaney

Updated on September 18, 2022

Comments

  • chris chaney
    chris chaney almost 2 years

    I have a CentOS server running Plesk and it's run out of space on the plesk partition. I have narrowed down where a lot of the disk space is being used, but I'm not sure how to move forward. Can I redirect the folder elsewhere or is it reasonably safe to resize the partition?

    Output of df -l

    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/sda5              4956284   4803960         0 100% /
    /dev/sda3              4956316   2861496   1838988  61% /var
    /dev/sda2            461065932  97508992 339758252  23% /home
    /dev/sda1                77749     17882     55853  25% /boot
    tmpfs                   978504         0    978504   0% /dev/shm
    tmpfs                   978504         0    978504   0% /usr/local/psa/handlers/before-local
    tmpfs                   978504         0    978504   0% /usr/local/psa/handlers/before-queue
    tmpfs                   978504         0    978504   0% /usr/local/psa/handlers/before-remote
    tmpfs                   978504      1900    976604   1% /usr/local/psa/handlers/info
    tmpfs                   978504         0    978504   0% /usr/local/psa/handlers/spool
    

    Output of du -sh * on the root

    12K     aquota.user
    7.8M    bin
    12M     boot
    168K    dev
    49M     etc
    93G     home
    222M    lib
    27M     lib64
    16K     lost+found
    8.0K    media
    0       misc
    8.0K    mnt
    0       net
    99M     opt
    0       proc
    96M     root
    35M     sbin
    8.0K    selinux
    8.0K    srv
    0       sys
    44K     tmp
    4.6G    usr
    2.7G    var
    
  • user
    user over 11 years
    /root contains 96MB, and /usr 4.6GB (which is not exactly lightweight, but hardly excessive either depending on what software is installed).
  • chris chaney
    chris chaney over 11 years
    Thank you for the quick response. I followed it down the rabbit hole and /usr/local/psa is using 3.2GB is it safe to remove anything within this?
  • GHugo
    GHugo over 11 years
    Apparently /usr/local/psa is the Plesk directory. Dig into it again. See if you can clear cache or something like with Plesk (don't know it really). Else you can move /usr/local/psa into /home but I think you need to do it from a live CD (without launching Plesk).
  • chris chaney
    chris chaney over 11 years
    Hello again Hugo, its split between mainly two folders, cgitory and apspkgarc though I am not familiar with the back end of Plesk to know what they are used for. Alternatively can you recommend a good walkthrough as to how to increase the partition size (and I am assuming shrinking SDA2 to cover the space requirements)? thanks again
  • GHugo
    GHugo over 11 years
    Frem GUI, use gParted as I said. You just have to drag bound to expand partition. But you need to do this without mounting the partition. So do it from a live cd. Or you can do it from command line like explained for ext3 here.
  • chris chaney
    chris chaney over 11 years
    Ah okay, that makes it a little more complicated. I am logged into it via SSH as its a virtualized machine at another location. What would you say is the best course of action? Thanks again.
  • GHugo
    GHugo over 11 years
    Make something like this (I'm not responsible if something goes wrong with Plesk, I don't know of it works really) : /etc/init.d/psa stop && mkdir ~/.psa && mv /usr/local/psa/* ~/.psa/ && rmdir /usr/local/psa && ln -s ~/.psa /usr/local/psa && /etc/init.d/psa start
  • chris chaney
    chris chaney over 11 years
    Thanks Hugo! I ended up removing backup.tar.gz, locale and documentation files but I will have to see about implementing your solution to stop it from happening again in future. Unfortunately I have given myself a bigger headache from this but I will post the problem in a new thread. Thanks again!
  • bu5hman
    bu5hman over 6 years
    While this is useful information it doesn't really address the question asked by OP about moving the mount or resizing.