Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Linux limited size shared folder

Posted on 2009-07-04
3
Medium Priority
?
773 Views
Last Modified: 2012-05-07
How to specify shared folder size in linux for all users , I don't mean user quota I mean one folder with specific size limit for all user .
0
Comment
Question by:ahfaris
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Expert Comment

by:Buckmeister
ID: 24776712
Hi ahfaris,

what do mean with shared?
Is it shared over the network via NFS or SMB etc. or do multiple local users share this folder?

Kind Regards,
Buckmeister
0
 

Author Comment

by:ahfaris
ID: 24778982
Yes i use smb and want to set quota per folder not per user , so the folder will not exceed specified size no matter who access and save to it
0
 
LVL 21

Accepted Solution

by:
Daniel McAllister earned 2000 total points
ID: 24786209
Quotas are a function of the filesystem being used...
- If you format and mount the drive in FAT32, there is no quota option at all!
- If you format and mount the drive in EXT3, there is a quota system available SOLELY for the entire filesystem
   - NOTE: You could also create "virtual" filesystems within that environment -- lots of overhead, little value (IMHO)
- If you format and mount the drive in XFS, you can create quotas for any part of the "directory tree"
   - See http://linux.die.net/man/8/xfs_quota
      and scroll down to the "Directory Tree Quota" portion of the man page

This should give you what you want... however, to make it CLEANER, you'll also want to re-compile Samba with the Quota options on (so Samba will be able to properly report quota info to users, instead of just "failing" when they go over quota -- and you KNOW they will!)

See the output of "smbd -b | grep QUOTA" and you should get lines that read:
  HAVE_SYS_QUOTA_H             # this is for the system headers to access Quotas
  HAVE_LINUX_XFS_QUOTAS    # 1 of 2 XFS entries you need to see
  HAVE_QUOTACTL_LINUX        # which allows Samba Admins to adjust quotas
  HAVE_SYS_QUOTAS               # turns on Samba's Quota interface for EXT2 / ETX3
  HAVE_XFS_QUOTAS               # turns on Samba's Quota interface for XFS
  WITH_QUOTAS                       # shows how you turned on the above! :-)
 
If you don't have the HAVE_* lines above, then you'll need to re-compile Samba WITH them! (And that's a lot more work than I'm showing in this posting!)

Good luck!

Dan
IT4SOHO
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question