LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-20-2017, 06:09 AM   #1
dendeX3
LQ Newbie
 
Registered: May 2017
Posts: 3

Rep: Reputation: Disabled
File deletion out of aufs mount do not free up disk space


Hi there,

I'm trying to merge some users shared folders with read only permission, to allow each user to only see/copy/download shared files of other users.
If I understand well aufs "whiteout", I don't want it. I just want users to not be able to delete anything through aufs, without "hiding" files they tried to delete.

So I tried this :

Code:
mount -t aufs -o br=/home/user2/sub/SharedFolder=ro:/home/user3/sub/SharedFolder=ro:/home/user4/sub/SharedFolder=ro,udba=reval none /home/user1/sub/OtherUsers
mount -t aufs -o br=/home/user1/sub/SharedFolder=ro:/home/user3/sub/SharedFolder=ro:/home/user4/sub/SharedFolder=ro,udba=reval none /home/user2/sub/OtherUsers
mount -t aufs -o br=/home/user1/sub/SharedFolder=ro:/home/user2/sub/SharedFolder=ro:/home/user4/sub/SharedFolder=ro,udba=reval none /home/user3/sub/OtherUsers
mount -t aufs -o br=/home/user1/sub/SharedFolder=ro:/home/user2/sub/SharedFolder=ro:/home/user3/sub/SharedFolder=ro,udba=reval none /home/user4/sub/OtherUsers
Each user has 2 folders in his /home/user/sub/ : "SharedFolder" and "OtherUsers" (read only access to the merged SharedFolder of other users).
*Note : each user's home is mounted on a different LV (LVM)

At first it seems to work nicely. But sometimes when a user deletes one of his file in /home/user/SharedFolder the file seems to be deleted from his LV and disappears from all aufs mounts, but the LV space of the user who deleted the file is not free up... It seems to be random, maybe older files are more problematic than recent ones but idk.
When I dismount all aufs mount the LV disk space is freed instantly.

What am I doing wrong ? Is there any other way than aufs to do this ?
Many thanks in advance!

Last edited by dendeX3; 05-21-2017 at 06:23 AM.
 
Old 05-20-2017, 01:43 PM   #2
redfox2807
Member
 
Registered: Jul 2012
Distribution: Debian testing/stable, Gentoo, CentOS 7, Sailfish OS, Android
Posts: 167

Rep: Reputation: 31
So the folders are at the same PC as I can see. Why are you using autofs at all? You can simply add all users to a group 'users'. Then recursively change the group of users home folders and its contents to 'users' and recursively set the content permissions to read-only for the group. Finally make symlinks in each user's home directory to other user's home folders.
 
Old 05-21-2017, 03:25 AM   #3
dendeX3
LQ Newbie
 
Registered: May 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
I thought an union file system would be better in my case cause I need my users to be able to access a merged shared folders via ftp, sftp and a web file manager app. Plus, when users and apps add files to their shared folder the ownerships/permissions are set by default.
And I also thought 1 symlink was not able to point multiple folders exactly like they were merged (that's what I read). But idk I'm a newbie... I tried to use them at the beginning, but rapidly abandon them for bind mounts.

Bind mounts work perfectly and are very easy for that : no need to manage permissions/ownership or anything else in my case. Users can directly read only other users files via ftp/sftp/web apps, any modification on one side is immediately reflected on the other side. But each user needs 1 mount point for each other user.
So I would need something that acts exactly like a bind mount but with the capability to display the contents of several directories (like they were merged) from only 1 mount point. That's why I thought an union file system would be the easiest way to achieve this.

Edit :
I forgot that my own user (lets say user1) had a bind mount to another user's home sub-folder :
Code:
mount --bind /home/user2/sub/ /home/user1/sub/user2Sub
I'm wondering if a bind mount pointing the parent folder of an aufs mount could cause the problem ?
I'll dismount the mount bind, then remount all aufs ones to see if the problem still occurs in the next days/weeks.

Last edited by dendeX3; 05-21-2017 at 07:24 AM.
 
Old 05-21-2017, 06:33 AM   #4
redfox2807
Member
 
Registered: Jul 2012
Distribution: Debian testing/stable, Gentoo, CentOS 7, Sailfish OS, Android
Posts: 167

Rep: Reputation: 31
It's feasible using symlinks, though if you absolutely want to create a merged folder it will require more work. A possible approach can be found there
Just think about is it really necessary to have a merged folder? Wouldn't it be more usefull to have different subfolders for each user inside a folder?
 
Old 05-21-2017, 07:05 AM   #5
dendeX3
LQ Newbie
 
Registered: May 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks redfox, I'll first see if the problem persists (see my edit). I may also try mergerFS I heard of, but if it fails too, then I'll look to the approach with symlinks.

And yes it's necessary for me, cause users can already list all the shared files in a web app library, but are unable to know the ownership (or real locations) of each file. So without merged folders, they would have to manually try every user's shared folder to find a specific file through the web file-manager/ftp.

Last edited by dendeX3; 05-21-2017 at 07:20 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
There is not enough disk to save the file.Please free some disc space and try. Mikibelavista Linux - Software 3 08-04-2015 04:14 AM
File deletion not recovering the space on the disk. jojanmpaul Linux - Newbie 5 12-23-2013 08:33 AM
how to free the disk space for root file system in rhel4 bhaskar1967 Linux - Newbie 2 09-01-2013 01:41 PM
My / is full. How to create 400MB free space without deletion .?? kadhiravan.r Linux - Newbie 7 12-08-2005 02:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration