/usr directory full, how to clean up?

6,790

First, /usr/local and /usr/openv are mounts from a different source device as the rest of /usr, from these lines in mount (with a little space formatting):

/dev/mapper/vg00-lv_usr       on /usr       type ext4 (rw)
/dev/mapper/vg00-lv_usr_local on /usr/local type ext4 (rw)
/dev/mapper/vg00-lv_usr_openv on /usr/openv type ext4 (rw)

In general, if you still want to free some space from /usr, then it looks like you'll just have to remove some packages / software. My Debian keeps a little over 80% of all it's files in /usr (not counting /home).

If you're using a Debian-based OS and find a particularly large file, you could use this command to see which package the file belongs to:

dpkg -S [/usr/path/file]

Other distributions should have a similar search ability, but I'd search the web or OS's help to find it.

Share:
6,790

Related videos on Youtube

user708503
Author by

user708503

Updated on September 18, 2022

Comments

  • user708503
    user708503 over 1 year

    So my /usr directory is full

    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/vg00-lv_usr  5.8G  5.0G  543M  91% /usr
    

    and when i go into /user I find files larger than the partition allowd. /usr is only 5.8G in size yet there are directories 8.3G in size. How is that possible? How do I clean this up? I haven't intentionally put any files in this location. All personal accounts are locate in /home/

    Storage Space

    [root@ridl001 usr]# pwd
    /usr
    [root@ridl001 usr]# du -sh *
    246M    bin
    4.0K    etc
    4.0K    games
    40M     include
    492M    java
    956K    kerberos
    560M    lib
    1.6G    lib64
    65M     libexec
    475M    local
    16K     lost+found
    24K     man
    67M     NX
    8.3G    openv
    49M     sbin
    1.8G    share
    191M    src
    0       tmp
    
    

    "mount" command output:

    /dev/mapper/vg00-lv_root on / type ext4 (rw)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    devpts on /dev/pts type devpts (rw,gid=5,mode=620)
    tmpfs on /dev/shm type tmpfs (rw)
    /dev/sda1 on /boot type ext4 (rw)
    /dev/mapper/vg00-lv_home on /home type ext4 (rw)
    /dev/mapper/vg00-lv_opt on /opt type ext4 (rw)
    /dev/mapper/vg00-lv_tmp on /tmp type ext4 (rw)
    /dev/mapper/vg00-lv_usr on /usr type ext4 (rw)
    /dev/mapper/vg00-lv_usr_local on /usr/local type ext4 (rw)
    /dev/mapper/vg00-lv_usr_openv on /usr/openv type ext4 (rw)
    /dev/mapper/vg00-lv_var on /var type ext4 (rw)
    /dev/mapper/vg00-lv_crash on /var/crash type ext4 (rw)
    /dev/mapper/vg_data-lv_data1 on /data1 type ext4 (rw)
    /dev/mapper/vg_data-lv_data2 on /data2 type ext4 (rw)
    /dev/mapper/vg_data-lv_data3 on /data3 type ext4 (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
    rnunsis01.nut.roche.com:/ifs/data/FMIX0117 on /var/sequsupport type nfs (rw,soft,bg,addr=151.120.13.21)
    nodev on /sys/kernel/debug type debugfs (rw)
    

    list of files by size

    This command, when executed inside /usr, gets a bunch of permission denied and then a list of files larger than the usr directory.

    du -ah . | grep -v "/$" | sort -rh | head -n 40
    14G     .
    8.3G    ./openv
    3.2G    ./openv/netbackup
    2.3G    ./openv/netbackup/client/Linux
    2.3G    ./openv/netbackup/client
    2.1G    ./openv/pack
    1.8G    ./share
    1.8G    ./openv/pack/NB_CLT_7.7.3/save/NB_CLT_7.7.3Linux.122717_141252.tar.gz
    1.8G    ./openv/pack/NB_CLT_7.7.3/save
    1.8G    ./openv/pack/NB_CLT_7.7.3
    1.8G    ./openv/pack.7.6.0.4/NB_CLT_7.6.0.4/save/NB_CLT_7.6.0.4Linux.012816_081208.tar.gz
    1.8G    ./openv/pack.7.6.0.4/NB_CLT_7.6.0.4/save
    1.8G    ./openv/pack.7.6.0.4/NB_CLT_7.6.0.4
    1.8G    ./openv/pack.7.6.0.4
    1.6G    ./lib64
    756M    ./openv/netbackup/bin
    661M    ./openv/netbackup/client/Linux/Debian2.6.18
    634M    ./openv/netbackup/client/Linux/RedHat2.6.18
    560M    ./lib
    558M    ./openv/netbackup/client/Linux/SuSE3.0.76
    515M    ./openv/java
    500M    ./openv/lib
    492M    ./java
    475M    ./local
    387M    ./openv/netbackup/client/Linux/RedHat2.6.18/VRTSnbjava.rpm
    386M    ./openv/netbackup/client/Linux/Debian2.6.18/NB-Java.tar.gz
    381M    ./openv/netbackup/client/Linux/SuSE3.0.76/VRTSnbjava.rpm
    338M    ./lib64/libreoffice
    302M    ./lib64/firefox
    286M    ./openv/pack/NB_7.7.3/save/NB_7.7.3.122717_141252.tar.gz
    286M    ./openv/pack/NB_7.7.3/save
    286M    ./openv/pack/NB_7.7.3
    285M    ./java/jdk1.7.0_67-cloudera
    279M    ./share/icons
    270M    ./share/locale
    250M    ./share/doc
    246M    ./bin
    238M    ./lib64/libreoffice/program
    222M    ./lib/jvm
    219M    ./openv/java/vrts/nbvsm_l10n
    
    • dortegaoh
      dortegaoh about 5 years
      Please provide the output of mount
    • user708503
      user708503 about 5 years
      I edited post & added the information for mount.
  • user708503
    user708503 almost 5 years
    Thank you for the response. This says kernel versions 2.6 and up allow for on-line resizing for mounted filesystems. Looks like that's what my sysadmin did. In corporate and their response time isn't the quickest. Linux is a bit of an oddity around here... linux.die.net/man/8/resize2fs