mpartel / bindfs

Mount a directory elsewhere with changed permissions.
https://bindfs.org/
GNU General Public License v2.0
442 stars 64 forks source link

Overall Share Size Increased After Implementing Bindfs - Normal ? #105

Closed marcoczen closed 3 years ago

marcoczen commented 3 years ago

Guys,

I just implemented a bindfs share few days ago.

Before activating bindfs ;

du -hs  /family_share
224 GB

After using bindfs, it gives 294GB. Thats about 70+GB. Is this normal ?

a. So whenever i mount folders using bindfs to other locations, the data is duplicated ? Or is the extra size ( 70GB ) just bindfs overhead ?
b. If its a bindfs overhead, will it roughly be of fixed size or will it go up as the overall share size increases ?

Note that I have implemented ChrootDirectory in /etc/ssh/sshd_config and therefore I mount the source folder into each relevant user's ChrootDirectory ? Is this wrong ? Am i supposed to just symlink ?

Thanks.

mpartel commented 3 years ago

bindfs does not duplicate the data.

I'm not sure what's happening here. It might be a bug in bindfs or FUSE that causes it to report incorrect sizes somehow, but that seems unlikely, since bindfs just passes the size information through. Do you maybe use hard links somewhere? Those might not be represented in a way that du can deduplicate them. Does anything change if you pass -l to du?

marcoczen commented 3 years ago

Hi.

bindfs does not duplicate the data.

Noted. So something is wrong with my box / my configuration ?

I'm not sure what's happening here. It might be a bug in bindfs or FUSE that causes it to report incorrect sizes somehow, but that seems unlikely, since bindfs just passes the size information through.

Versions :

bindfs ->  1.13.9-bp153.1.16
fuse  -> 2.9.7-3.3.1
kernel -> 5.3.18-59.10-default
OS -> openSUSE Leap 15.3

Do you maybe use hard links somewhere?

No.

Does anything change if you pass -l to du?

Without -l

du  -hs /files/family_share/
294G     

With -l

du  -lhs /files/family_share/
294G    

In my /etc/fstab, two ( i have about 20+ fuse.bindfs entries in my fstab file ) of the entries are;

/files/family_share/           /files/me/family_share           fuse.bindfs  perms=ug+rwD:o+rD,force-group=family,create-for-group=family
/files/family_share/           /files/wifey/family_share        fuse.bindfs  perms=ug+rwD:o+rD,force-group=family,create-for-group=family

Is the above how its done ? I mount /files/family_share in multiple locations ? This causes the data to duplicate/multiply as per the number of mounts ? So in this case the data will be x 3 ? Is there a better way ?

In etc/ssh/sshd_config, the sftp match block with ChrootDirectory is;

Subsystem   sftp  internal-sftp  -u 0002

Match User me

   ChrootDirectory /files/me/
   ForceCommand internal-sftp -u 0002 
   PasswordAuthentication yes

Match User wifey

   ChrootDirectory /files/wifey/
   ForceCommand internal-sftp -u 0002 
   PasswordAuthentication yes

Is my configuration wrong ?

Thanks.

p.s. I found a post about bindfs + duplicate content here; https://www.titanwolf.org/Network/q/7590a44d-e686-48e8-9f08-3b4136494c3b/x

mpartel commented 3 years ago

Ok, I see that I misunderstood the original question. I didn't realize it's the source directory that got larger.

I don't see anything wrong with that configuration, and no, bindfs doesn't copy the data to any internal storage - it just displays the source directory in a different location.

Depending on how the mounted directories are used, you might get some .fuse_hidden... files. See this explanation if you see a bunch of them taking up space.

If that doesn't explain it, can you try to figure out which files take the extra space? I don't have a convenient command for you, but if you have a graphical environment on that machine, maybe run filelight or baobab before and after mounting bindfs and compare the results.

marcoczen commented 3 years ago

Hi, replies below ...

Ok, I see that I misunderstood the original question. I didn't realize it's the source directory that got larger.

So the overall size increased becos the data is now in multiple locations ?

I don't see anything wrong with that configuration,

Ok. So my mounting method is correct. Good.

and no, bindfs doesn't copy the data to any internal storage - it just displays the source directory in a different location.

So with every mount point the data grows ? So total size will be original_folder + newly_mounted_folders ?

Depending on how the mounted directories are used, you might get some .fuse_hidden... files.

No .fuse_hidden files so far ...

can you try to figure out which files take the extra space

Will test and revert. In the mantime pls allow me to close this issue and refer to it later when i have more info time permitting.

Thanks x 3000.