Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Size of hidden folders under mount points

I am trying to guess the disk used on a linux system. The problem is that with commands like 'du -kxa / |sort -g' I see there is less space used than the filesystem reports (8Gb from a partition of 19Gb). I suspect that there are hidden files and folders under several mount points. I can't unmount the disks because is a production machine and it can't be stopped easily.

The question is:

On linux how can I get the folders and files hidden under a mount point? Is there any way to measure this space?

Linux version: Redhat enterprise linux server 5.3.

like image 419
wadjakman Avatar asked Jan 27 '26 15:01

wadjakman


1 Answers

This is one thing bind mounts are useful for. Assuming I have two separate file systems /usr, and /usr/local, you can do this to see if /usr/local is hiding anything:

mkdir /tmp/usr
mount --bind /usr /tmp/usr
ls /tmp/usr/local
# clean up if necessary
umount /tmp/usr
rmdir /tmp/usr
like image 75
twalberg Avatar answered Jan 30 '26 07:01

twalberg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!