gfs_edit(8)

NAME
gfs_edit - Display or edit GFS internal structures.

SYNOPSIS
gfs_edit [OPTION]... DEVICE

DESCRIPTION
The gfs_edit command is a tool used to examine, edit or display internal data structures of a GFS filesystem. Use at your own risk.

OPTIONS

-V  Print program version information only.

INTERACTIVE MODE
There are three display modes: hex mode, structure mode and pointers mode. You use the m key to switch between the modes, as described below. The modes are as follows:

Hex mode (default)
    Display or edit blocks of the file system in hexadecimal and ascii. Lines at the top indicate the currently displayed block number in hex. If the block contains a GFS data structure, the name of that structure will appear in the upper right corner of the display. If the block is a well-known block, such as the superblock or rindex, there will be a line to indicate what it is. In hex mode, you can edit blocks by pressing <enter> and entering hexadecimal digits to replace the highlighted hex digits. Do NOT precede the numbers with "0x". For example, if you want to change the value at offset 0x60 from a 0x12 to 0xef, position your cursor to offset 0x60, so that the 12 is highlighted, then press <enter> and type in "ef". You will automatically be returned to display mode (Unlike gfs2_edit, you may only edit one byte at a time.) In hex mode, different colors indicate different things. For example, an inode will appear white, block offsets will be light blue, and actual data (anything after the gfs data structure) will be red.

Structure mode
    Decode the file system block into its GFS structure and display the values of that structure. This mode is most useful for jumping around the file system. For example, you can use the arrow keys to position down to a pointer and press J to jump to that block.

Pointers mode
    Display any additional information appearing on the block. For example, if an inode has block pointers, this will display them and allow you to scroll through them. You can also position to one of them and press J to jump to that block.

Interactive mode command keys:

q or <esc>
    The q or <escape> keys are used to exit gfs_edit.

<arrow/movement keys> up, down, right, left, pg-up, pg-down, home, end
    The arrow keys are used to highlight an area of the display. The J key may be used to jump to the block that is highlighted.

m - Mode switch
    The m key is used to switch between the three display modes. The initial mode is hex mode. Pressing the m key once switches to structure mode. Pressing it a second time switches from structure mode to pointers mode. Pressing it a third time takes you back to hex mode again.

j - Jump to block
    The j key jumps to the block number that is currently highlighted. In hex mode, hitting J will work when any byte of the pointer is highlighted.

g - Goto block
    The g key asks for a block number, then jumps there. Note that in many cases, you can also arrow up so that the current block number is highlighted, then press <enter> to enter a block number to jump to in hexadecimal, with no leading "0x".

h - Help display
    The h key causes the interactive help display to be shown.

f or <space> - Forward block
    The f key causes you to scroll forward one block.

b - Backward block
    The b key causes you to scroll backward one block.

<home> - Return to superblock
    The <home> key takes you back to the superblock.

<backspace>
    This takes you back to the block you were displaying previously. Unlike gfs2_edit, gfs_edit only remembers the one block you previously viewed.

EXAMPLES

gfs_edit /dev/vg0/lvol0
    This will display the superblock of the gfs file system located on /dev/vg0/lvol0 and allow you to edit.

KNOWN LIMITATIONS

Shortcomings compared to gfs2_edit
    Unlike gfs2_edit, gfs_edit cannot print data structures. There is no alternate color scheme. It does not remember multiple block jumps, and it can not parse the rindex file and other data structures. It only operates on file systems with the default 4K block size. It does not work with gfs2 file systems. Since this is primarily a debugging tool and since gfs2_edit can do more than gfs_edit can, we have no plans at this time to enhance gfs_edit.

SEE ALSO
gfs2_edit(8)