fsdb(1M_VXFS) (VXFS) fsdb(1M_VXFS)
NAME
fsdb (vxfs) - vxfs file system debugger
SYNOPSIS
fsdb [-F vxfs] [generic_options] [-z inumber] special
DESCRIPTION
fsdb can be used to patch up a damaged vxfs file system.
generic_options are options supported by the generic fsdb
command.
fsdb has conversions to translate block and inumbers into
their corresponding disk addresses. Also included are
mnemonic offsets to access different parts of an inode. These
greatly simplify the process of correcting control block
entries or descending the file system tree.
The options are:
-F vxfs Specify the vxfs FSType.
-z inumber Clear the inode identified by inumber (non-
interactive). Multiple -z options accumulate.
NOTE: After using the fsdb -z command, a full
file system check should be performed (using
fsck -o full,nolog).
By default, numbers are considered decimal. Octal numbers
must be prefixed with a zero. Hexadecimal numbers must be
prefixed with 0x. When using hexadecimal numbers, it is
preferable to follow the number with a space, since a number
of commands are letters that are also hexadecimal digits. In
this document a pound sign (#) is used to indicate that a
number is to be specified.
fsdb reads a block at a time and works with raw and block I/O.
All I/O is unbuffered, so changes made to the file system are
immediate and changes made by other processes or by the kernel
are immediately seen by fsdb.
NOTE: Some aspects of fsdb apply to the vxfs Version 2 disk
layout only.
Copyright 1994 Novell, Inc. Page 1
fsdb(1M_VXFS) (VXFS) fsdb(1M_VXFS)
The following symbols are recognized by fsdb:
? h help Print command summary.
! Escape to shell.
q Quit.
"string" A character string. Inside a character string, a
NULL character may be specified with ``\0''; a
double quote may be specified with ``\"''; and a
backslash may be specified with ``\\''.
- + * / Add, subtract, multiply, and divide.
= Assignment
i An inode.
au An allocation unit.
b A block.
im The immediate data area of an inode. Small
directories and symbolic link files (96 bytes or
less) are stored directly in the inode itself, in
the area normally occupied by data block numbers
and extent sizes.
cdb Current directory block.
d A directory entry.
a An inode address entry.
B A byte.
H A half-word (2 bytes)
W A word (4 bytes)
D A double-word (8 bytes)
p General print facility
Copyright 1994 Novell, Inc. Page 2
fsdb(1M_VXFS) (VXFS) fsdb(1M_VXFS)
calc Simple calculator and base converter
find Find a matching pattern in the file system
The following symbols are recognized by fsdb for the Version 2
layout only:
fset A file set.
iau An inode allocation unit.
cut The current usage table.
olt The object location table.
The print facility recognizes the following print formats:
S Print as a super-block.
A Print as an allocation unit header.
L Print as intent log records.
I Print as inodes.
dent Print as directory entries.
db Print as a directory block.
dh Print as a directory header.
o Print as octal words.
oB oH oW oD Print as octal bytes, half-words, words, or
double-words.
x Print as hexadecimal words.
xB xH xW xD Print as hexadecimal bytes, half-words, words, or
double-words.
e Print as decimal words.
eB eH eW eD Print as decimal bytes, half-words, words, or
double-words.
Copyright 1994 Novell, Inc. Page 3
fsdb(1M_VXFS) (VXFS) fsdb(1M_VXFS)
c Print as characters.
The print facility recognizes the following print formats for
the Version 2 layout only:
F Print as fileset headers.
C Print as current usage table entries.
IA Print as an inode allocation unit header.
oltext Print as an object location table extent.
Changes to inode fields may be made symbolically. The
following symbols represent inode fields:
md Inode mode field
ln Inode link count field
uid Inode user ID Number field
gid Inode group ID Number field
sz Inode file size field
de # Inode direct extent data block numbers (0 - 9)
des # Inode direct extent sizes (0 - 9)
ie # Inode indirect extent data block numbers (0 - 1)
ies Inode indirect extent size
im Immediate data area. Small directories and
symbolic link files (96 bytes or less) are stored
directly in the inode itself, in the area
normally occupied by data block numbers and
extent sizes.
at Inode access time field.
ct Inode change time field.
Copyright 1994 Novell, Inc. Page 4
fsdb(1M_VXFS) (VXFS) fsdb(1M_VXFS)
mt Inode modification time field.
af Inode allocation flags field.
gen Inode generation count field.
org Inode mapping type field.
fe Inode fixed extent size field.
bl Inode blocks held field.
eopflg Inode extended operation flag field.
eopdat Inode extended operation data field.
maj If device, inode major number.
min If device, inode minor number.
pd If directory, inode parent directory.
res If regular file, inode reservation.
serhi Inode high order word of serial number.
serlo Inode low order word of serial number.
Changes to directory block fields may be made symbolically.
The following symbols represent directory block fields:
tfree Total free space (only if in a data block).
hash # Hash chain start (0 through 31, only if in a
data block).
d # Directory entry (variable number of entries).
nhash Number of hash chains.
Changes to directory entry fields may be made symbolically.
The following symbols represent directory entry fields:
ino Inode number
Copyright 1994 Novell, Inc. Page 5
fsdb(1M_VXFS) (VXFS) fsdb(1M_VXFS)
nm Entry name
nmlen Name length
reclen Record length (only if in a data block)
hnext Name hash next (only if in a data block)
It is preferable to separate each token on a command line with
a space. Although the command parser does not insist on space
separation, there is no ambiguity in the command language if
each token is separated with a space. For example, the
command 0x23b b sets the current position to block 0x23b
hexadecimal. The command 0x23bb is invalid, since the command
is parsed as simply a hexadecimal number. The command 23b
positions to block 23 decimal, since the command is not
ambiguous.
Commands are separated by new lines or multiple commands may
be placed on one line, separated by a period (.) or a
semicolon (;). When multiple commands are placed on one line,
generally only the last command displays results. This allows
positioning commands to be followed by printing commands or
change commands without intermediate printing.
The following commands are supported:
# B | H | W | D
Set current position in the file system to the
specified offset in bytes, half-words, words, or
double-words. If the last command on a line,
print the byte, half-word, word, or double-words
in hexadecimal.
+ | - # B | H | W | D
Set current position to specified relative offset
in bytes, half-words, words, or double-words. If
the last command on a line, print the byte,
half-word, word, or double-words in hexadecimal.
# b Set current position in the file system to the
specified offset in blocks. Set current block
position to the resulting offset. The block size
is the block size of the file system. If the
last command on a line, print the first word in
the block in hexadecimal.
Copyright 1994 Novell, Inc. Page 6
fsdb(1M_VXFS) (VXFS) fsdb(1M_VXFS)
+ | - # b Set current position to specified relative offset
in blocks. Set current block position to the
resulting offset. If the last command on a line,
print the first word in the block in hexadecimal.
b Set current position to current block position
(the block specified by the last [+|-] # b
operation). If the last command on a line, print
the first word in the block in hexadecimal.
# fset (vxfs Version 2 layout only.) Set current
position in the file system to the fileset header
entry for the specified fileset index. Set
current fileset position to the resulting offset.
If the last command on a line, print the
specified fileset header.
+ | - # fset
(vxfs Version 2 layout only.) Set current
position in the file system to the fileset header
entry for the specified relative fileset index.
Set current fileset position to resulting offset.
If the last command on a line, print the
specified fileset header.
fset (vxfs Version 2 layout only.) Set current
position in the file system to the current
fileset position. If the last command on a line,
print the fileset header for the current fileset.
# iau (vxfs Version 2 layout only.) Set current
position in the file system to the specified
inode allocation unit (iau) in a file set. Set
the current inode allocation unit position to the
resulting offset. If the last command on a line,
print the inode allocation unit header.
+ | - # iau
(vxfs Version 2 layout only.) Set the current
position in the file system to the specified
relative inode allocation unit (iau). Set the
current inode allocation unit position to the
resulting offset. If the last command on a line,
print the inode allocation unit header.
Copyright 1994 Novell, Inc. Page 7
fsdb(1M_VXFS) (VXFS) fsdb(1M_VXFS)
iau (vxfs Version 2 layout only.) Set the current
position in the file system to the current inode
allocation unit (iau) position. If the last
command on a line, print the inode allocation
unit header.
cut (vxfs Version 2 layout only.) Set current
position to the current usage table (cut). If
the last command on a line, print the first
current usage table entry.
olt (vxfs Version 2 layout only.) Set the current
position to the object location table (olt). If
the last command on a line, print the object
location table.
# i Set current position in the file system (Version
1 layout) or current fileset (Version 2 layout)
to the ilist entry for the specified inode. Set
current inode position to the resulting offset.
If the last command on a line, print the ilist
entry for the inode.
+ | - # i Set current position in the file system (Version
1 layout) or current fileset (Version 2 layout)
to the ilist entry for the specified relative
inode. Set current inode position to the
resulting offset. If the last command on a line,
print the ilist entry for the inode.
i Set current position in the file system (Version
1 layout) or current fileset (Version 2 layout)
to the current inode position. If the last
command on a line, print the ilist entry for the
inode.
a # Set current position to specified offset in
blocks specified by the inode address #.
Addresses 0 through 9 are for direct extents
(de). Addresses 10-11 are for indirect extents
(ie). The addresses are displayed when printing
an ilist entry. Set current block position to
the resulting offset. If the last command on a
line, print the first word in the block in
hexadecimal.
Copyright 1994 Novell, Inc. Page 8
fsdb(1M_VXFS) (VXFS) fsdb(1M_VXFS)
im Set current position to immediate data area of
the current inode. Set current block position to
the resulting offset. If the last command on a
line, print the first word in the block in
hexadecimal.
+ | - # au Set current position in the file system to the
specified relative allocation unit (au). Set
current allocation unit position to the resulting
offset. If the last command on a line, print the
allocation unit header.
au Set current position in the file system to the
specified allocation unit. If the last command
on a line, print the allocation unit header.
# B | H | W | D = # [#]
Set the current position and change the number at
the specified offset to the given number. If a
double-word offset is specified, then two numbers
separated by a space are required. The resulting
value is printed in hexadecimal.
+ | - # B | H | W | D = # [#]
Set the current position and change the number at
the specified relative offset to the given
number. If a double-word offset is specified,
then two numbers separated by a space are
required. The resulting value is printed in
hexadecimal.
# B | H | W PD = "string"
Set the current position and change the
characters at the specified offset to the given
string. The resulting value is printed as a
character string.
+ | - # B | H | W | D = "string"
Set the current position and change the
characters at the specified relative offset to
the given string. The resulting value is printed
as a character string.
p [#] format Print the contents of the file system at the
current offset as the specified number of entries
of a given format. The allowable print formats
Copyright 1994 Novell, Inc. Page 9
fsdb(1M_VXFS) (VXFS) fsdb(1M_VXFS)
are specified above. If a number of entries to
print is not specified, one entry is printed.
inode_field = #
Set the contents of the given inode field to the
specified number. The current inode specifies
the inode list entry to be modified. The symbols
representing inode fields are previously listed.
directory_block_field = #
Set the contents of the given directory block
field to the specified number. The current block
is treated as a directory block and the offset in
that block which is represented by the given
field is changed. The symbols representing
directory block fields are listed above.
d # Set the current directory entry to the specified
number. The current block is treated as a
directory block. If the current block is an
immediate data area for an inode, then the block
is treated as containing immediate directory
entries. If the last command on a line, the
directory entry at the resulting offset is
printed.
directory_entry_field = #
Set the contents of the given directory field to
the specified number. The current directory
entry specifies where the directory entry is
located. The resulting value is printed in
hexadecimal.
nm = "string"
Set the directory name field of the current
directory entry to the specified string. The
resulting value is printed as a character string.
calc # [+ | - | * | / #]
Take a number or the sum, difference, product or
dividend of two numbers and print in decimal,
octal, hexadecimal and character format.
find # B | H | W | D [#]
Search for the given numeric pattern in the file
system. The size of the object to match is
Copyright 1994 Novell, Inc. Page 10
fsdb(1M_VXFS) (VXFS) fsdb(1M_VXFS)
specified. If a double-word is specified, then
two numbers must be given. The search is
performed forward from the current offset. A
maximum number of blocks to search may be
specified. If found, the location and value are
printed in hexadecimal.
find "string" [#]
Search for the given character string in the file
system. The search is performed forward from the
current offset. A maximum number of blocks to
search may be specified. If found the location
and string are printed.
fmtlog Format all intent log entries. A completely
formatted intent log can be quite lengthy. It is
a good idea use fsdb as a filter and redirect the
output to a file or pager to look at a complete
log format.
listfset (vxfs Version 2 layout only.) List all filesets
by their indexes and names.
EXAMPLES
386i Prints inumber 386 in an inode format. This
now becomes the current working inode.
ln=4 Changes the link count for the working inode
to 4.
1024B.p S Prints the super-block of this file system
symbolically.
2i.a0b.d7.ino=3 Changes the inumber for the seventh directory
slot in the root directory to 3. This example
also shows how several operations can be
combined on one command line.
d7.nm="string" Changes the name field in the directory slot
to the given string.
23i.im.pdb Prints the immediate area of inode 23 as a
directory block.
Copyright 1994 Novell, Inc. Page 11
fsdb(1M_VXFS) (VXFS) fsdb(1M_VXFS)
23i.im.d5 Prints the sixth directory entry in the
immediate area of inode 23.
REFERENCES
vxfs-specific fs(4VXFS), fsck(1M), generic fsdb(1M)
Copyright 1994 Novell, Inc. Page 12