4

I figured out how to set block quotas in ZFS from the documentation on oracle's site.

I didn't see if / how to setup a quota on how many inodes a user gets, though. I realize that there may not be restrictions on how many inodes a ZFS filesystem has, but when my users create a directory tree 10,000 directories deep each with 300 files, it is kind of a pain in the butt to deal with.

Bonus points if you can set it in the oracle storage appliance...

5

Short Answer

No

Long Answer

Quoting from "Chapter 1 Oracle Solaris ZFS File System (Introduction)":

All metadata is allocated dynamically, so no need exists to preallocate inodes or otherwise limit the scalability of the file system when it is first created.

...no limit exists on the number of file systems or the number of files that can be contained within a file system.

There was also a discussion of this same issue back in 2009 on the zfs-discuss mailing list.

Re: [zfs-discuss] ZFS directory and file quota

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.

Here's another good quote from mailing list in August 2010:

Re: [zfs-discuss] File system ownership details of ZFS file system.

ZFS does not have a fixed number of inodes, so there is no way to calculate a limit, per se. ZFS uses space for metadata, so as long as you have available space, you can use it for metadata.

In another thread in 2010 there was a discussion on how to calculate the number of inodes for a ZFS filesystem based on the total space (there's also a helpful script provided).

Quoting one of the replies:

In ZFS, you will run out of inodes at the same time as you run out of space.

Possible Solution

You can, however, enforce user-level inode quotas by using UFS filesystems on ZFS zvols.

  • That's too bad. I work in an environment with hundreds of thousands of users each with unique UIDs and simply running find ~homedir | wc -l would take a couple months. If I had quotas it would be simpler to track these users down. As it is, I just wait until a user with 20gajillion files causes trouble for some of our other systems (malware scanning, backups, etc). Thanks! – chris Jun 17 '13 at 12:57
  • This is an interesting (and old) question. It makes me curious whether metadata usage counts toward quotas. If it does, that could give an implicit inode max for a user. – Styne666 May 20 at 10:03
  • I just noticed in ZoL 0.7.13 manual there is a userobjused property and userobjquota which might be the kind of thing @chris is looking for. Obviously this is a different ZFS implementation but might be worth revisiting what Solaris ZFS / Oracle Linux ZFS does. – Styne666 May 20 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.