Hi all, I can not find any instructions on how to set the file quota (i.e. maximum number of files per filesystem/directory) or directory quota (maximum size that files in particular directory can consume) in ZFS. I understand ZFS has no support for this. Am I right? If I am, are there any plans to include this in the next releases of OpenSolaris/Solaris? Thank you. -- Jozef Hamar _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `- I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration. I will face my fear. I will permit it to pass over me and through me. And when it has gone past I will turn the inner eye to see its path. Where the fear has gone there will be nothing. Only I will remain. _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Jozef Hamar wrote:> Hi all, > > I can not find any instructions on how to set the file quota (i.e. maximum > number of files per filesystem/directory) or directory quota (maximum size that > files in particular directory can consume) in ZFS.That is because it doesn''t exist.> I understand ZFS has no support for this. Am I right? If I am, are there any > plans to include this in the next releases of OpenSolaris/Solaris?Why would you want to do that rather than set a maximum amount of space a filesystem, user or group can consume? What is the real problem you are trying to solve by restricting the number of files that can be created ? -- Darren J Moffat
Darren J Moffat wrote:> Jozef Hamar wrote: >> Hi all, >> >> I can not find any instructions on how to set the file quota (i.e. >> maximum number of files per filesystem/directory) or directory quota >> (maximum size that files in particular directory can consume) in ZFS. > > That is because it doesn''t exist. > >> I understand ZFS has no support for this. Am I right? If I am, are >> there any plans to include this in the next releases of >> OpenSolaris/Solaris? > > Why would you want to do that rather than set a maximum amount of space > a filesystem, user or group can consume?Last I checked NetApp had a ''directory quota'' concept, but I don''t know if it could be used on just any directory, or only on upper level directories. Granted, with ZFS you can just make any directory at any level a new FS, and get the same effect, but that can be heavywieght, and have undesired side effects.> > What is the real problem you are trying to solve by restricting > the number of files that can be created ? >I imagine it''s one thta was previously solved with older unix/ufs file quotas. Though I can''t imagine a use for that now that lack of inodes is not likely to be a problem any time soon. -Kyle
Hi Darren, thanks for reply. E.g., I have mail quota implemented as per-directory quota. I know this can be solved in another way, but still, I would have to change many things in my system in order to make it work. And this is quite easy implementation of mail quota. Now I''m using UFS and ufs quota support. Agree, creating ZFS per account would solve my problems, but I can''t use nfsv4 , nor automounter, so I can''t export thousand of filesystems right now. Thanks. Jozef Hamar _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `- I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration. I will face my fear. I will permit it to pass over me and through me. And when it has gone past I will turn the inner eye to see its path. Where the fear has gone there will be nothing. Only I will remain. Darren J Moffat wrote: Jozef Hamar wrote: Hi all, I can not find any instructions on how to set the file quota (i.e. maximum number of files per filesystem/directory) or directory quota (maximum size that files in particular directory can consume) in ZFS. That is because it doesn''t exist. I understand ZFS has no support for this. Am I right? If I am, are there any plans to include this in the next releases of OpenSolaris/Solaris? Why would you want to do that rather than set a maximum amount of space a filesystem, user or group can consume? What is the real problem you are trying to solve by restricting the number of files that can be created ? _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Jozef Hamar wrote:> Hi Darren, > > thanks for reply. > > E.g., I have mail quota implemented as per-directory quota. I know this can be > solved in another way, but still, I would have to change many things in my > system in order to make it work. And this is quite easy implementation of mail > quota. Now I''m using UFS and ufs quota support.That sounds like you want a quota per user for a given directory. If that is what you need then ZFS provides for this by making the mail directory a ZFS filesystem then using userquota. That way you still only have one ZFS filesystem not one per user account.> Agree, creating ZFS per account would solve my problems, but I can''t use nfsv4 , > nor automounter, so I can''t export thousand of filesystems right now.Or using per userquotas, eg: # zfs set userquota at bob=1G rpool/mail # zfs set userquota at jane=2G rpool/mail ... -- Darren J Moffat
Darren J Moffat wrote:> Jozef Hamar wrote: >> Hi Darren, >> >> thanks for reply. >> >> E.g., I have mail quota implemented as per-directory quota. I know >> this can be solved in another way, but still, I would have to change >> many things in my system in order to make it work. And this is quite >> easy implementation of mail quota. Now I''m using UFS and ufs quota >> support. > > That sounds like you want a quota per user for a given directory. > > If that is what you need then ZFS provides for this by making the mail > directory a ZFS filesystem then using userquota. That way you > still only have one ZFS filesystem not one per user account. > >> Agree, creating ZFS per account would solve my problems, but I can''t >> use nfsv4 , nor automounter, so I can''t export thousand of >> filesystems right now. > > Or using per userquotas, eg: > > # zfs set userquota at bob=1G rpool/mail > # zfs set userquota at jane=2G rpool/mailYes, this idea is good, but I wanted to prevent this. :-) In that case instead of rewriting the part of my code which handles quota creation/updating/checking, I would need to completely rewrite the quota logic. :-( But thanks anyway, I''ll try to survive until NFSv4 deployment would by possible here and finally make use of everything ZFS offers. Jozef Hamar> > ... >
Jozef Hamar wrote:> Darren J Moffat wrote: >> Jozef Hamar wrote: >>> Hi Darren, >>> >>> thanks for reply. >>> >>> E.g., I have mail quota implemented as per-directory quota. I know >>> this can be solved in another way, but still, I would have to change >>> many things in my system in order to make it work. And this is quite >>> easy implementation of mail quota. Now I''m using UFS and ufs quota >>> support. >> >> That sounds like you want a quota per user for a given directory. >> >> If that is what you need then ZFS provides for this by making the mail >> directory a ZFS filesystem then using userquota. That way you >> still only have one ZFS filesystem not one per user account. >> >>> Agree, creating ZFS per account would solve my problems, but I can''t >>> use nfsv4 , nor automounter, so I can''t export thousand of >>> filesystems right now. >> >> Or using per userquotas, eg: >> >> # zfs set userquota at bob=1G rpool/mail >> # zfs set userquota at jane=2G rpool/mail > Yes, this idea is good, but I wanted to prevent this. :-) > > In that case instead of rewriting the part of my code which handles > quota creation/updating/checking, I would need to completely rewrite the > quota logic. :-(So what do you do just now with UFS ? Is it a separate filesystem for the mail directory ? If so it really shouldn''t be that big of a deal to rewrite to run ''zfs set userquota@'' instead of updating the UFS quota file. -- Darren J Moffat
Consider using a modern mail system. The mail system can handle quotas much better than a file system. http://blogs.sun.com/relling/entry/on_var_mail_and_quotas -- richard On Nov 18, 2009, at 6:18 AM, Jozef Hamar wrote:> Hi Darren, > > thanks for reply. > > E.g., I have mail quota implemented as per-directory quota. I know > this can be solved in another way, but still, I would have to change > many things in my system in order to make it work. And this is quite > easy implementation of mail quota. Now I''m using UFS and ufs quota > support. > > Agree, creating ZFS per account would solve my problems, but I can''t > use nfsv4 , nor automounter, so I can''t export thousand of > filesystems right now. > > Thanks. > > Jozef Hamar > > > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' `-'' > `- > I must not fear. Fear is the mind-killer. Fear is the little-death > that > brings total obliteration. I will face my fear. I will permit it to > pass > over me and through me. And when it has gone past I will turn the > inner > eye to see its path. Where the fear has gone there will be nothing. > Only > I will remain. > > > Darren J Moffat wrote: >> >> Jozef Hamar wrote: >>> Hi all, >>> >>> I can not find any instructions on how to set the file quota (i.e. >>> maximum number of files per filesystem/directory) or directory >>> quota (maximum size that files in particular directory can >>> consume) in ZFS. >> >> That is because it doesn''t exist. >> >>> I understand ZFS has no support for this. Am I right? If I am, are >>> there any plans to include this in the next releases of >>> OpenSolaris/Solaris? >> >> Why would you want to do that rather than set a maximum amount of >> space >> a filesystem, user or group can consume? >> >> What is the real problem you are trying to solve by restricting >> the number of files that can be created ? >> > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
>> In that case instead of rewriting the part of my code which handles >> quota creation/updating/checking, I would need to completely rewrite >> the quota logic. :-( > > So what do you do just now with UFS ? Is it a separate filesystem for > the mail directory ? If so it really shouldn''t be that big of a deal to > rewrite to run ''zfs set userquota@'' instead of updating the UFS quota file. >Certainly we changed the provisioning from using edquota to ''zfs set userquota'' without issue. All the read-only code uses rquota / quotas-command to look up quota, and work exactly the same with ZFS userquotas, and did not need any changes. -- Jorgen Lundman | <lundman at lundman.net> Unix Administrator | +81 (0)3 -5456-2687 ext 1017 (work) Shibuya-ku, Tokyo | +81 (0)90-5578-8500 (cell) Japan | +81 (0)3 -3375-1767 (home)