LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mount --bind with vsftpd, du -h sums multiple copies of the same files (https://www.linuxquestions.org/questions/linux-software-2/mount-bind-with-vsftpd-du-h-sums-multiple-copies-of-the-same-files-776085/)

stodge 12-16-2009 08:59 AM

mount --bind with vsftpd, du -h sums multiple copies of the same files
 
I'm jailing virtual users in vsftpd, but I'm giving them access to project directories using mount --bind. However, when I do du -h to check project disk usage, I'm seeing 28Gb used instead of 350Mb (approx numbers from memory). The disk usage command is summing one copy of the files in one directory for every time the project directory is mounted. Is this a valid side effect of using mount --bind or do I have something mis-configured?

For example, my project root is:

/srv/download/projects

e.g.

/srv/download/projects/one

Users are all stored under:

/srv/download/users

So I am jailed to:

/srv/download/users/mike

A project directory is mounted using --bind for each user on that project:

/srv/download/users/mike/projects/one

So if I upload a 1MB file to

/srv/download/users/mike/projects/one/one_meg_file.dat

and if the 'one' project has 20 members, the following shows 21Mb instead of just 1Mb:

cd /srv/download && du -h

Is this expected?

Thanks

unSpawn 12-17-2009 10:28 AM

Quote:

Originally Posted by stodge (Post 3793739)
Is this expected?

Yes, you're making the same directory structure available in different places and 'du' only sees those directory structures. While not applicable symlinking would be treated differently (as in "-P").


All times are GMT -5. The time now is 03:32 PM.