1

I want to obtain, for every one of my system's users (or at least, every one with a home directory under /home), the amount of disk space their files use. I have root access, but - there are many users with lots and lots of files, and the directory is an nfs-mount. So, counting is kind of slow; and my machine may be rebooted in the process, so I need to be able to resume counting after the machine is up again.

What would be a decent way of achieving this?

I don't very much mind the output format.

Notes:

  • I can't set quotas. I mean, I have root access, but I don't get to do what I want.
15
  • How long does a du -sm /home/* take? Commented Dec 15, 2024 at 16:38
  • For every share mounted over the network, try calculating the sub-totals for it at the system that is providing the share if at all possible. Tallying up disk usage per-user is likely to be much faster locally than over the network. Commented Dec 15, 2024 at 17:04
  • 2
    Which file system does /home use? You might find it more effective to use quotas for this, even if you don’t enforce limits. Commented Dec 15, 2024 at 17:17
  • 2
    @einpoklum enabling quotas doesn’t mean setting them — at its most basic, it enables tracking of disk usage per user (and optionally, per group and per “project”), without enforcing any limits. Commented Dec 15, 2024 at 17:26
  • 1
    that has nothing to do with the problem you have! no_root_squash means that users can write their own suid binaries (something that otherwise only root can do), and I'm not sure which kind of access control you have, but allowing an NFS client to tell the NFS server that they are, in fact, requesting files on behalf of root, would basically allow any machine that users control to access all files, no matter who they belong to. Commented Dec 15, 2024 at 19:22

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.