سؤال

I need to free space in '/dev/sda5' which is mounted in '/'. I have also some other devices that ar mounted (eg '/dev/sdb1' on '/home' , '/dev/sdc1' on 'var/log' ... ). I have tried du -sh * but it takes too much time to check each directory. This is a production machine running RHEL.

How can i get a list of the folders that belong to '/' (/dev/sda5) and not to other mounted devices to find where i can free space?

[root@myservername ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              27G   24G  2.4G  92% /
/dev/mapper/vg--log-root00
                       25G  3.4G   21G  14% /var/log
/dev/sda2              25G   11G   13G  45% /home
/dev/sda1              99M   12M   82M  13% /boot
tmpfs                  47G     0   47G   0% /dev/shm

Any other tip to free space will be appreciated.

هل كانت مفيدة؟

المحلول

If you are looking to count space on one file system only, the -x flag to du prevents du traversing between file systems.

نصائح أخرى

You can use:

find / -type d -xdev

From man find:

-xdev

Don't descend directories on other filesystems.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top