Is there a file system out there that supports custom file size limit ?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there a file system out there that supports custom file size limit ?
Hi,
I'm aware that EXT4 has a
Code:
max_dir_size_kb
mount option to set up the max size of each directory. It doesn't have a similar option to specify the max size of individual files, though.
Is somebody aware of another file system that could do this ? I checked XFS, ZFS and ReiserFS, but didn't find anything, though I'm no expert on those file systems.
To be more specific about what I try to achieve : I'd like to limit the size of individual files that can be stored on a Samba share (individual files, not global quota, e.g. prevent users from storing files exceeding a given size). Samba doesn't have an option for this, and the Linux /etc/security/limits.conf doesn't work either with Samba (see https://askubuntu.com/questions/1315...4-ubuntu-20-04, and the answer below : the Samba developers explained that file size limits set up in /etc/security/limits.conf are not enforced).
So my idea was to define that limit on the file system level, but it doesn't appear there is a file system supporting this feature.
mount option to set up the max size of each directory. It doesn't have a similar option to specify the max size of individual files, though.
Is somebody aware of another file system that could do this ? I checked XFS, ZFS and ReiserFS, but didn't find anything, though I'm no expert on those file systems.
To be more specific about what I try to achieve : I'd like to limit the size of individual files that can be stored on a Samba share (individual files, not global quota, e.g. prevent users from storing files exceeding a given size). Samba doesn't have an option for this, and the Linux /etc/security/limits.conf doesn't work either with Samba (see https://askubuntu.com/questions/1315...4-ubuntu-20-04, and the answer below : the Samba developers explained that file size limits set up in /etc/security/limits.conf are not enforced).
So my idea was to define that limit on the file system level, but it doesn't appear there is a file system supporting this feature.
Have you researched the QUOTA system? I have never attempted to apply it to a SAMBA share, but it may have application here.
Don't know about such filesystems but user file size restrictions can be set either via ulimit from shell or more restrictively via pam_limits in limits.conf. Hope that helps.
Maybe attack it from the other end - watch the mount-point and delete any big files (after the event). Definite kludge, but should work - doesn't help if you have real constraints in the network bandwidth or actual disk shortages.
Most file systems are made to get most out of it. Making it less is contrary to design. However as noted some controls could be in place for things like quota or size of share or such.
The question remains if one could modify a file system with source code to add in a specifed limit. I think so but you may have to do something like iscsi on nas. Samba will kill it otherwise. Might be possible to use NFS.
The problem is that a smart cookie could split up some large file and escape this restriction.
Best just to limit total quota. Let them beg for more.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.