1

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
2
  • Please provide the output of mount Apr 14, 2019 at 5:53
  • I edited post & added the information for mount.
    – user708503
    Apr 14, 2019 at 23:43

2 Answers 2

2

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.

1

Apart from Xen2050s good answer there is more you can do.

First, you can use the -x parameter of du to stay on one filesystem. Running du -hsx /usr will show how much is really mounted on that volume, without volumes mounted below it.

Second, you are using LVM and can resize your logical volumes to rebalance your free space. You didn't share the rest of df, so I can only give you some ideas. Check the space on all you logical volumes. For example, you have a logical volume for /opt, which usually doesn't need much space as long as you don't install third party applications there. If you have lots of free space there, and don't expect to need more there in the future, you can move the free space to your /usr logical volume:

  1. boot from a rescue medium (you can't do this on a live system)
  2. backup your system!
  3. resize the filesystem on /dev/mapper/vg00-lv_opt with resize2fs and free up as much space as you want
  4. run lvreduce on /dev/mapper/vg00-lv_opt
  5. run lvextend on /dev/mapper/vg00-lv_usr
  6. extend the filesystem on /dev/mapper/vg00-lv_usr with resize2fs
  7. reboot into your system

You should now have enough free space on /usr.

1
  • 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
    – user708503
    Apr 26, 2019 at 16:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .