I'm trying to list all inodes and blocks in certain file system which are available and unused for unprivileged user. I tried stat -f but from what I've read it list nodes and block available for all user in the system.

  • 1
    Just......why ? – steve Mar 26 '16 at 17:10

You won't be able to get such a list, at least not without low-level tools that are specific to each filesystem type and which are normally intended as debug or emergency repair tools.

Filesystems simply don't have any API for querying or listing free/unused inodes. Many filesystem types don't even have the concept of a fixed number of extant inodes on the filesystem, but rather create them on demand.

The best you will get is df -i, which produces a count of how many inodes are available (if that makes sense for the filesystem type), but you cannot enumerate them.

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.