<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Theodore Tso wrote:
<blockquote cite="mid:20080724161220.GE23279@mit.edu" type="cite">
  <pre wrap="">On Thu, Jul 24, 2008 at 11:47:16AM -0400, Charles Riley wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi,

What does the "expand_dir" command do in debugfs?
All the information I can find on it just says "Expand the directory  
filespec"
I googled the archives and can't find a post where someone actually used  
it to give me some context.
If I try it in debugfs (image opened ro) it seems to want to write to  
the image.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
It adds an extra (empty) directory block to a directory inode.  This
something like this is used to recreate a lost+found directory with
extra empty directory blocks so that e2fsck can reattach orphaned
inodes without needing to allocate blocks from the filesystem (which
might not be available if the filesystem is 100% full), for example.

It's not normally useful for most debugfs users.  (Heck, debugfs
wasn't intended to be useful for most ext3 users; it's really designed
for ext3 wizards that need to untangle badly corrupted filesystems,
and/or ext3/4 developers that are debugging new ext4 code, and/or
ext3/4 developers creating deliberately corrupted filesystems for
e2fsprogs's regression test suite.)

                                                - Ted
  </pre>
</blockquote>
Thanks!<br>
<br>
I've been playing with it quite a lot, in preparation for repairing the
1.5TB filesystem I posted about previously.  Just to be on the safe
side, I wanted to see what would happen using various methods of fixing
things.. So I recreated the directory structure (on a much smaller
scale) on a test image and used debugfs to duplicate the state of the
broken filesystem.  The more I learn about the lower level workings of
the filesystem, the more fascinated I become and the more I want to
learn.<br>
<br>
It just occurred to me that I have no life =)<br>
<br>
Charles<br>
<br>
<br>
</body>
</html>