0

Is there a way to have a list of all the files owned by a certain user in a filesystem, and their sizes? I mean, not by traversing the directory tree with find or similar tools, because I did already that and it seems that there are hidden files that are not found by those tools. I want a tool that directly iterates on the inodes of the filesystem.

CONTEXT: I have a problem with my quota in a CentOS 7.9 server. I have a given quota of 1100GB on a certain filesystem /share/storage and my used space is growing permanently at a rate of 100MB per minute (approx), even if I am not logged in the server, neither there are processes owned by me. So I have now almost all the space exhausted. But, if I do a $ du /share/storage/user, it reports just 556GB.

I know that there may files that are owned by me but they may live in other directories (for instance /tmp or other directories in other users accounts). I checked all that, and I didn't find anything.

I have checked for open files being written with lsof and I didn't find anything neither.

So my idea is to have the list of inodes and the sizes of those files, and then compare it with the list after a certain time.

NOTES: I have root access to the server.

The server is the frontend for a HPC cluster, so the computing nodes may be writing via NFS on the filesystem. However, I checked that there are not currently processes in the computing nodes.

4
  • What filesystem? Do you have quotacheck on your system?
    – icarus
    Mar 15 at 21:39
  • The FS is ext4. We do have quotacheck, but I am somewhat reluctant to use it, because I should have to stop the cluster (I'm not completely sure of this). Second, the drift between the "du" and the "quota" values is constantly growing. So it is not a fact that there is some mismatch that can be fixed running quotacheck. Mar 15 at 22:42
  • Is the amount of disk space reported by df going down by roughly 100MB a minute or not?
    – icarus
    Mar 16 at 3:52
  • @icarus I can't tell because it is a server used as frontend in a HPC cluster and it is constantly being used by other people, so the disk usage fluctuates a lot. I will try to check again that. Tanks! Mar 16 at 13:04
0

We have found the problem. There was a process running in a computing node that kept writing to a file (it reached >500GB of size). The directory corresponding to that file was deleted in the frontend, and for some reason the process kept writing to the file from the computing node. Once the process was killed the space of the file was released.

So, I recommend in this cases to look for stale processes in the computing node.

EDIT: Regarding the question that I posted (traversing all the inodes without traversing the filesystem itself with find for instance), I didn't tried but it seems that you can get the number of inodes of the filesystem with df:

[mstorti@seshat ~]$ df -i /share/storage/
Filesystem       Inodes    IUsed    IFree IUse% Mounted on
/dev/sdb1      45753856 26022211 19731645   57% /share/storage

Then I guess that you can loop over all the possible inodes (from 1 to 45753856) and then for each inode check for each inode if it is allocated or not (from the shell you can use debugfs) and then store all the current inodes and their sizes in a file. Then at a later time, you do the same thing and compare, and luckyly you can find the file that is consuming space.

However, as I sead before I think it's better to use lsof, but remember to do that in all the computing nodes in the cluster.

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.