DragonFly BSD
DragonFly commits List (threaded) for 2010-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: HAMMER Utility - Add catastrophic recovery feature


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 16 Aug 2010 23:55:44 -0700 (PDT)

commit b9107f58ed117184a899e7d65ffd8038f2f6ee52
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Mon Aug 16 23:49:16 2010 -0700

    HAMMER Utility - Add catastrophic recovery feature
    
    * hammer -f <devices> recover <empty_target_dir>
    
    * Add a catastrophic recovery feature.  A HAMMER filesystem image is
      scanned (using the -f <blockdevs> specification).  Any buffer which
      looks like a B-Tree node is then sub-scanned for inode, directory, and
      data records and the filesystem is reconstructed in the specified
      target directory.
    
    * The files and directories are initially named after the object id
      and are renamed and moved as directory entries are found to resolve
      the fragmentory information.
    
    * File writes strip trailing 0's (data records are not limited to the
      file EOF), but will properly truncate the file if/when the related
      inode record is found.
    
    * Currently no attempt is made to restore owner, group, file modes,
      softlinks, or hardlinks (only one link will be restored).
    
    TODO: Currently a valid volume header is required, but the only thing
          we actually need from it is the vol_buf_beg field.  This field
          could be guessed or passed in on the command line in a future
          update to the recovery code.

Summary of changes:
 sbin/hammer/Makefile            |    2 +-
 sbin/hammer/blockmap.c          |   73 +++++-
 sbin/hammer/cmd_recover.c       |  552 +++++++++++++++++++++++++++++++++++++++
 sbin/hammer/cmd_show.c          |   14 +-
 sbin/hammer/hammer.8            |   15 +
 sbin/hammer/hammer.c            |    8 +
 sbin/hammer/hammer.h            |    1 +
 sbin/hammer/hammer_util.h       |    1 +
 sbin/hammer/ondisk.c            |   19 ++-
 sys/vfs/hammer/hammer.h         |    1 +
 sys/vfs/hammer/hammer_cursor.c  |   17 ++
 sys/vfs/hammer/hammer_reblock.c |    7 +-
 12 files changed, 690 insertions(+), 20 deletions(-)
 create mode 100644 sbin/hammer/cmd_recover.c

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b9107f58ed117184a899e7d65ffd8038f2f6ee52


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]