Using debugfs to check free inodes (list got from dumpe2fs), I observed that most of them have a bad type status, except for a few ones which are regular. I'd like to check them all to see how many and which of them have a different status.
Therefore I made a little python/pexpect program which starts debugfs and interactively sends stat <inode> requests for all those free inodes to find which or them have other that bad type status.
However, it appears that my program is going to need about 2 years to get all the requested information. What faster way could I use to get those inodes content ?
Optionally, I would be glad to get information about why free inodes can have a regular status
Since I didn't get any simple solution, I ended up patching debugfs by adding a new function
do_rstatbased ondo_statindebugfs/debugfs.c. Kind of like this :(However, I won't detail it here because it's quite specific to my needs, but I also replaced the
dump_inode(inode, inode_buf);call to get the output on one line with fixed width fields in order to remove the need for pattern matching in the calling program). In order to do that, I inspired myself from thedump_inodeanddump_inode_internalfunctions.and I also needed to add two functions in
debugfs/util.cI needed to add their prototypes in
debugfs/debugfs.hand i also added an entry for the new commant in
debug_commands.ct:and when I call it, i need to make sure the output is piped (like in
| cat), in order to deactivate the annoying pager.eg:
(Don't forget that /dev/sdXXX must not be mounted)