[Ocfs2-users] debugfs.ocfs2: How to use subcommands - 'dx_dump' and 'extent'

Zhen Ren zren at suse.com
Mon Jul 27 02:44:27 PDT 2015


Hi all,

I'm very confused by how to use subcommands of debugfs - 'dx_dump' and 'extent'.

Quote from man page about debugfs.ocfs2:
...
 dx_dump filespec
              Display the indexed directory information for the given directory.
 extent <block#>
              Display the contents of the extent structure at block#.
...

1. dx_dump
I am on a well-worked 3 nodes cluster. 
Step 1: move ocfs2-tools source (it has directory tree) to /mnt/shared(shared disk mount point);
Step 2: ls -R - in case it needs to generate indexed directory struct in memory. I don't know much about indexed directory;
Step 3: debugfs.ocfs2  -> open device -> 'dx_dump /ocfs2-tools' or 'dx_dump <139801>', it show nothing, but "lines ?-?/? (END)
" 

And 'stats' show that "indexed-dirs" feature is on.


2.extent
Step 1: created a 5G large file by 'fallocate -l 7G 7g-file.img' in /mnt/shared/;
Step 2: stat /7g-file.img, the output is:

        Inode: 193645   Mode: 0644   Generation: 745361378 (0x2c6d4fe2)
        FS Generation: 3527657941 (0xd243c9d5)
        CRC32: 00000000   ECC: 0000
        Type: Regular   Attr: 0x0   Flags: Valid 
        Dynamic Features: (0x0) 
        User: 0 (root)   Group: 0 (root)   Size: 7516192768
        Links: 1   Clusters: 1835008
        ctime: 0x55b5f1a9 0x2f571f34 -- Mon Jul 27 16:54:01.794238772 2015
        atime: 0x55b5f1a9 0x26fee434 -- Mon Jul 27 16:54:01.654238772 2015
        mtime: 0x55b5f1a9 0x2f571f34 -- Mon Jul 27 16:54:01.794238772 2015
        dtime: 0x0 -- Thu Jan  1 08:00:00 1970
        Refcount Block: 0
        Last Extblk: 0   Orphan Slot: 0
        Sub Alloc Slot: 0   Sub Alloc Bit: 108
        Tree Depth: 0   Count: 243   Next Free Rec: 57
        ## Offset        Clusters       Block#          Flags
        0  0             32255          225793          0x1 Unwritten
        1  32255         32255          290305          0x1 Unwritten
        2  64510         32255          322561          0x1 Unwritten
        3  96765         32255          354817          0x1 Unwritten
        4  129020        32255          387073          0x1 Unwritten
        5  161275        32255          419329          0x1 Unwritten
...
         52 1677260       32255          1967617         0x1 Unwritten
        53 1709515       32255          1999873         0x1 Unwritten
        54 1741770       32255          2032129         0x1 Unwritten
        55 1774025       32255          2064385         0x1 Unwritten
        56 1806280       28728          2096641         0x1 Unwritten



Step 3: extent <2096641>, and other blockno in filed Block#, but it always shows:

debugfs: extent <2096641>
extent: Bad magic number in extent block while reading extent block 2096641

And I also notice this info - "  Last Extblk: 0 ".
Why the Last Exblk is 0, even for 7G large file?  

I don't know much about extent block mechanism.  Please correct me with your experience;-)

 



--
Eric, Ren





More information about the Ocfs2-users mailing list