Your NameNode directory, if it still exists, should have a previous.checkpoint/ directory under it where you can extract its previous checkpoint's files and replace the original with that? Ensure its not too old and that things are fine before you eject NN out of safemode finally.
What you say is possible; if you can reconstruct files and their allocated block IDs (along with generation stamps) and thereby form proper INode entries of them to append/recreate your fsimage. They are merely serialized operation entries, understandable if you go over its format in depth. Provided you have all of the exact data required and the skills to browse, understand and modify the code and reconstruct the entries and store them in proper order, this is certainly doable. It is usually simpler to just roll back to the previous checkpoint to save some of the blocks. On Thu, Dec 20, 2012 at 11:56 AM, ishan chhabra <ishan.chha...@gmail.com> wrote: > Hi all, > I accidentally issued a rmr on my home directory, but killed the NameNode > as soon as i realized it. Currently I am in a situation where my DataNodes > have a good percentage of blocks on them, but the NameNode fsImage and > editlog don't have a mention of any file or file to block to mappings in > that directory. I also don't have any previous checkpoints of fsImage. > > Fortunately, what I do have is namenode logs for the past few days that > have NameSystem changes recorded. Is there a way to reconstruct my old > fsImage from the logs so that it recognizes the blocks that are there on > the datanodes? Has anybody tried something like this before? > > -- > Thanks. > > Regards, > Ishan Chhabra -- Harsh J