Network and Storage Protocols

How to traverse a list of inodes

himanshuashwani
4,696 Views

Hi,

I would like to traverse the inode list for a given cifs/nfs share on a netapp filer. I would like to extract file/directory metadata and associated ACLs. If I have a list of inode list I could save myself travesring the directory tree structure.

Kindly let me know if there is way by which I can get a handle on the inode list using NetApp SDK or any other mechanism.

Thanks

-Himanshu

3 REPLIES 3

chriskranz
4,696 Views

Not sure what you are trying to achieve by getting a full listing of the inode tables, and I don't think it'll give you the information you are after.

You can have a look at "inodepath", which is a "priv set advanced" command, and as such, not supported. But it does have some functionality for querying inodes.

"fsecurity" can output some good details on what ACL's are set, but they aren't easily traversed, and I'm not sure it'll traverse all the sub-directories easily.

But what information are you looking for?

himanshuashwani
4,696 Views

Thanks Chirs for the prompt reply.

Basically I want to traverse the directory tree, for a given share, and get all metadata for files and directories including ACL information. Now I can do this by writing depth-first or breadth-first search code to traverse the tree. I want to avoid writing these recrusive procedures since the depth and breadth of the tree is unknown.

But if I have a list of all inodes, I can traverse the list and get the full pathnames of objects corresponding to those inodes. I could then use the pathnames to query for metadata and ACL information.

Hope this clarifies. I've looked at fsecurity which I may use once I have the object path name.So my question is would I be able to get a list of inodes?

Can you share more information on inodepath? I don't know how to use 'priv set advanced'.

Thanks for your help.

-Himanshu

chriskranz
4,696 Views

I think you may be best using host-based scanning tools to get a full directory listings. I have in the past written many snippets of code that would traverse an infinitely deep directory tree, it's not too tricky.

On the command line, use "priv set advanced" to go into advanced mode, then use "inodepath help" to get a full listing of the command options. To be honest, I've not used inodepath for anything before, but it may be the right thing to help you out, I'm not sure.

You can also use "ls" in advanced mode, but again this is just single volume levels.

There is a way of getting a full directory listing, but I must warn you that this is very unsupported, and so I won't post it on the forums.

Public