fsdb(1M-vxfs) (VxFS) fsdb(1M-vxfs)
NAME
fsdb (vxfs) - Veritas File System debugger (VxFS)
SYNOPSIS
fsdb [-F vxfs] [genericoptions] special
DESCRIPTION
This manual page is an addendum to the fsdb(1M) manual page. It
describes the Veritas File System (VxFS) specific features of the fsdb
command.
fsdb can be used to patch up a damaged Veritas file system. It has
conversions to translate blocks 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.
OPTIONS
-F vxfs Specifies the Veritas file system type (FSType).
genericoptions
Options supported by the generic fsdb command.
By default, numbers are considered decimal. Octal numbers must be pre-
fixed 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 hexade-
cimal 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 will work with raw and block I/O. A
buffer management routine is used to retain commonly used blocks of
data in order to reduce the number of read system calls. All assign-
ment operations result in an immediate write-through of the corre-
sponding block.
The following symbols are recognized by fsdb:
? h help Print command summary.
! Escape to shell.
q Quit.
"string" A character string. Inside of a character string, a NULL
may be specified with \0 and a double quote may be speci-
fied with a \" and a backslash may be specified by \\.
- + * / Add, subtract, multiply, and divide.
= Assignment.
Page 1 Reliant UNIX 5.44 Printed 11/98
fsdb(1M-vxfs) (VxFS) fsdb(1M-vxfs)
i An inode.
au An allocation unit.
b A block.
im The immediate data area of an inode. Small files (96
bytes or less) may be 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.
calc Simple calculator and base converter.
find Find a matching pattern in the file system.
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.
Page 2 Reliant UNIX 5.44 Printed 11/98
fsdb(1M-vxfs) (VxFS) fsdb(1M-vxfs)
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.
c Print as characters.
Changes to inode fields may be made symbolically. The following sym-
bols 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).
e # 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 files (96 bytes or less) may
be stored directly in the inode itself, in the area nor-
mally occupied by data block numbers and extent sizes.
at Inode access time field.
ct Inode change time field.
mt Inode modification time field.
af Inode allocation flags field.
gen Inode generation count field.
org Inode mapping type field (diorgtype).
fe Inode fixed extent size field.
bl Inode blocks held field.
eopflg Inode extended operation flag field.
Page 3 Reliant UNIX 5.44 Printed 11/98
fsdb(1M-vxfs) (VxFS) fsdb(1M-vxfs)
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 (dihserial).
serlo Inode low order word of serial number (dilserial).
Changes to directory block fields may be made symbolically. The fol-
lowing 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).
nhash Number of hash chains.
d # Directory entry (variable number of entries).
Changes to directory entry fields may be made symbolically. The fol-
lowing symbols represent directory entry fields:
ino Inode number.
nm Entry name.
nmlen Name length.
nmmax Maximum name length (only if in immediate area).
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 separa-
tion, 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.
Page 4 Reliant UNIX 5.44 Printed 11/98
fsdb(1M-vxfs) (VxFS) fsdb(1M-vxfs)
Commands are separated by new lines or multiple commands may be placed
on one line, separated by a period (.) or a semicolon (;). When multi-
ple 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.
+|- # 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.
# i Set current position in the file system 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 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 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 speci-
fied 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
Page 5 Reliant UNIX 5.44 Printed 11/98
fsdb(1M-vxfs) (VxFS) fsdb(1M-vxfs)
an ilist entry. Set current block position to the result-
ing offset. If the last command on a line, print the
first word in the block in hexadecimal.
im Set current position to immediate data area of the
current inode. Set current block position to the result-
ing offset. If the last command on a line, print the
first word in the block in hexadecimal.
# 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 sepa-
rated by a space are required. The resulting value is
printed in hexadecimal.
# B|H|W|D = "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 for-
mat. The allowable print formats are specified above. If
a number of entries to print is not specified, one entry
is printed.
inodefield = #
Set the contents of the given inode field to the speci-
fied number. The current inode specifies the inode list
entry to be modified. The symbols representing inode
fields are previously listed.
directoryblockfield = #
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.
Page 6 Reliant UNIX 5.44 Printed 11/98
fsdb(1M-vxfs) (VxFS) fsdb(1M-vxfs)
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 direc-
tory entries. If the last command on a line, the direc-
tory entry at the resulting offset is printed.
directoryentryfield = #
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 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 # B|H|W|D "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 to use
fsdb as a filter and redirect the output to a file or
pager to look at a complete log format.
Page 7 Reliant UNIX 5.44 Printed 11/98
fsdb(1M-vxfs) (VxFS) fsdb(1M-vxfs)
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.pS Prints the super block of this file system symboli-
cally.
1024B.p0o Prints the super block of this file system in octal.
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="name" 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.
23i.im.d5 Prints sixth directory entry in the immediate area of
inode 23.
SEE ALSO
fsck(1M), fsdb(1M), fs(4-vxfs).
Page 8 Reliant UNIX 5.44 Printed 11/98