Print this page
10057 Man page misspellings ouput particuliar overriden
Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
   1 '\" te
   2 .\"  Copyright (c) 1988 Regents of the University
   3 .\" of California.  All rights reserved.  Copyright (c) 2003 Sun Microsystems,
   4 .\" Inc.  All Rights Reserved.
   5 .TH FSDB_UFS 1M "Apr 14, 2003"
   6 .SH NAME
   7 fsdb_ufs \- ufs file system debugger
   8 .SH SYNOPSIS
   9 .LP
  10 .nf
  11 \fBfsdb\fR \fB-F\fR ufs [\fIgeneric_options\fR] [\fIspecific_options\fR] \fIspecial\fR
  12 .fi
  13 
  14 .SH DESCRIPTION
  15 .sp
  16 .LP
  17 The \fBfsdb_ufs\fR command is an interactive tool that can be used to patch up
  18 a damaged \fBUFS\fR file system. It has conversions to translate block and
  19 i-numbers into their corresponding disk addresses. Also included are mnemonic
  20 offsets to access different parts of an inode. These greatly simplify the
  21 process of correcting control block entries or descending the file system tree.
  22 .sp
  23 .LP
  24 \fBfsdb\fR contains several error-checking routines to verify inode and block
  25 addresses. These can be disabled if necessary by invoking \fBfsdb\fR with the
  26 \fB-o\fR option or by the use of the \fBo\fR command.
  27 .sp
  28 .LP
  29 \fBfsdb\fR reads a block at a time and will therefore work with raw as well as
  30 block \fBI/O\fR devices. A buffer management routine is used to retain commonly
  31 used blocks of data in order to reduce the number of read system calls. All
  32 assignment operations result in an immediate write-through of the corresponding
  33 block. Note that in order to modify any portion of the disk, \fBfsdb\fR must be
  34 invoked with the \fBw\fR option.
  35 .sp
  36 .LP
  37 Wherever possible, \fBadb-\fRlike syntax was adopted to promote the use of
  38 \fBfsdb\fR through familiarity.
  39 .SH OPTIONS
  40 .sp
  41 .LP
  42 The following option is supported:
  43 .sp
  44 .ne 2
  45 .na
  46 \fB\fB-o\fR\fR
  47 .ad
  48 .RS 6n
  49 Specify \fBUFS\fR file system specific options. These options can be any
  50 combination of the following separated by commas (with no intervening spaces).
  51 The options available are:
  52 .sp
  53 .ne 2
  54 .na
  55 \fB\fB?\fR\fR
  56 .ad
  57 .RS 14n
  58 Display usage
  59 .RE
  60 


  71 .ne 2
  72 .na
  73 \fB\fBp='string'\fR\fR
  74 .ad
  75 .RS 14n
  76 set prompt to string
  77 .RE
  78 
  79 .sp
  80 .ne 2
  81 .na
  82 \fB\fBw\fR\fR
  83 .ad
  84 .RS 14n
  85 open for write
  86 .RE
  87 
  88 .RE
  89 
  90 .SH USAGE
  91 .sp
  92 .LP
  93 Numbers are considered hexadecimal by default. However, the user has control
  94 over how data is to be displayed or accepted. The \fBbase\fR command will
  95 display or set the input/output base. Once set, all input will default to this
  96 base and all output will be shown in this base. The base can be overridden
  97 temporarily for input by preceding hexadecimal numbers with \&'\fB0x\fR',
  98 preceding decimal numbers with '\fB0t\fR', or octal numbers with '\fB0\fR'.
  99 Hexadecimal numbers beginning with \fBa-f\fR or \fBA-F\fR must be preceded with
 100 \&'\fB0x\fR' to distinguish them from commands.
 101 .sp
 102 .LP
 103 Disk addressing by \fBfsdb\fR is at the byte level. However, \fBfsdb\fR offers
 104 many commands to convert a desired inode, directory entry, block, superblock
 105 and so forth to a byte address. Once the address has been calculated,
 106 \fBfsdb\fR will record the result in dot (\fB\&.\fR).
 107 .sp
 108 .LP
 109 Several global values are maintained by \fBfsdb\fR:
 110 .RS +4
 111 .TP


 184 
 185 .sp
 186 .LP
 187 The two examples are synonymous for getting to the first directory entry of the
 188 root of the file system. Once there, any subsequent  \fBRETURN\fR (or +, -)
 189 will advance to subsequent entries. Note that
 190 .sp
 191 .in +2
 192 .nf
 193 \fB> 2:inode; :ls\fR
 194       or
 195 \fB> :ls /\fR
 196 .fi
 197 .in -2
 198 .sp
 199 
 200 .sp
 201 .LP
 202 is again synonymous.
 203 .SS "Expressions"
 204 .sp
 205 .LP
 206 The symbols recognized by \fBfsdb\fR are:
 207 .sp
 208 .ne 2
 209 .na
 210 \fB\fBRETURN\fR\fR
 211 .ad
 212 .RS 13n
 213 update the value of \fBdot\fR by the current value of \fBtype\fR and display
 214 using the current value of \fBcount\fR.
 215 .RE
 216 
 217 .sp
 218 .ne 2
 219 .na
 220 \fB\fB#\fR\fR
 221 .ad
 222 .RS 13n
 223 numeric expressions may be composed of +, -, *, and % operators (evaluated left
 224 to right) and may use parentheses. Once evaluated, the value of \fBdot\fR is


 227 
 228 .sp
 229 .ne 2
 230 .na
 231 \fB\fB,\fR\fI count\fR\fR
 232 .ad
 233 .RS 13n
 234 count indicator. The global value of \fBcount\fR will be updated to
 235 \fBcount\fR. The value of \fBcount\fR will remain until a new command is run. A
 236 count specifier of '*' will attempt to show a \fIblocks's\fR worth of
 237 information. The default for \fBcount\fR is 1.
 238 .RE
 239 
 240 .sp
 241 .ne 2
 242 .na
 243 \fB\fB?\fR\fI f\fR\fR
 244 .ad
 245 .RS 13n
 246 display in structured style with format specifier \fIf\fR. See
 247 \fBFormatted\fROutput\fB\&.\fR
 248 .RE
 249 
 250 .sp
 251 .ne 2
 252 .na
 253 \fB\fB/\fR\fI f\fR\fR
 254 .ad
 255 .RS 13n
 256 display in unstructured style with format specifier \fIf\fR See
 257 \fBFormatted\fROutput\fB\&.\fR
 258 .RE
 259 
 260 .sp
 261 .ne 2
 262 .na
 263 \fB\fB\&.\fR\fR
 264 .ad
 265 .RS 13n
 266 the value of \fBdot\fR.
 267 .RE
 268 
 269 .sp
 270 .ne 2
 271 .na
 272 \fB\fB+\fR\fIe\fR\fR
 273 .ad
 274 .RS 13n
 275 increment the value of \fBdot\fR by the expression \fIe.\fR The amount actually
 276 incremented is dependent on the size of \fBtype\fR:
 277 .sp


 318 restore an address saved in register \fIname\fR. \fIname\fR must be a single
 319 letter or digit.
 320 .RE
 321 
 322 .sp
 323 .ne 2
 324 .na
 325 \fB\fB>\fR\fI name\fR\fR
 326 .ad
 327 .RS 13n
 328 save an address in register \fIname\fR. \fIname\fR must be a single letter or
 329 digit.
 330 .RE
 331 
 332 .sp
 333 .ne 2
 334 .na
 335 \fB\fB=\fR\fI f\fR\fR
 336 .ad
 337 .RS 13n
 338 display indicator. If \fIf\fR is a legitimate format specifier. then the value
 339 of \fBdot\fR is displayed using the format specifier \fIf\fR. See
 340 \fBFormatted\fROutput. Otherwise, assignment is assumed See  \fB=\fR.
 341 .RE
 342 
 343 .sp
 344 .ne 2
 345 .na
 346 \fB\fB= [\fR\fIs\fR\fB] [\fR\fIe\fR\fB]\fR\fR
 347 .ad
 348 .RS 13n
 349 assignment indicator. The address pointed to by \fBdot\fR has its contents
 350 changed to the value of the expression \fIe\fR or to the \fBASCII\fR
 351 representation of the quoted (") string \fIs\fR. This may be useful for
 352 changing directory names or \fBASCII\fR file information.
 353 .RE
 354 
 355 .sp
 356 .ne 2
 357 .na
 358 \fB\fB=+\fR\fI e\fR\fR
 359 .ad
 360 .RS 13n
 361 incremental assignment. The address pointed to by \fBdot\fR has its contents
 362 incremented by expression \fIe\fR.
 363 .RE
 364 
 365 .sp
 366 .ne 2
 367 .na
 368 \fB\fB=-\fR\fI e\fR\fR
 369 .ad
 370 .RS 13n
 371 decremental assignment. The address pointed to by \fBdot\fR has its contents
 372 decremented by expression \fIe\fR.
 373 .RE
 374 
 375 .SS "Commands"
 376 .sp
 377 .LP
 378 A command must be prefixed by a ':' character. Only enough letters of the
 379 command to uniquely distinguish it are needed. Multiple commands may be entered
 380 on one line by separating them by a  \fBSPACE,\fR \fBTAB\fR or ';'.
 381 .sp
 382 .LP
 383 In order to view a potentially unmounted disk in a reasonable manner,
 384 \fBfsdb\fR offers the \fBcd\fR, \fBpwd\fR, \fBls\fR and \fBfind\fR commands.
 385 The functionality of these commands substantially matches those of its UNIX
 386 counterparts. See individual commands for details. The '*', '?', and '[-]' wild
 387 card characters are available.
 388 .sp
 389 .ne 2
 390 .na
 391 \fB\fBbase=b\fR\fR
 392 .ad
 393 .sp .6
 394 .RS 4n
 395 display or set base. As stated above, all input and output is governed by the
 396 current \fBbase\fR. If the  \fB=b\fR is omitted, the current \fBbase\fR is


 566 .na
 567 \fB\fBls\fR\fR
 568 .ad
 569 .sp .6
 570 .RS 4n
 571 [ \fB-R\fR ] [ \fB-l\fR ] \fIpat1 pat2\fR\|.\|.\|. list directories or files.
 572 If no file is specified, the current directory is assumed. Either or both of
 573 the options may be used (but, if used, \fImust\fR be specified before the
 574 filename specifiers). Also, as stated above, wild card characters are available
 575 and multiple arguments may be given. The long listing shows only the i-number
 576 and the name; use the \fBinode\fR command with '?i' to get more information.
 577 .RE
 578 
 579 .sp
 580 .ne 2
 581 .na
 582 \fB\fBoverride\fR\fR
 583 .ad
 584 .sp .6
 585 .RS 4n
 586 toggle the value of override. Some error conditions may be overriden if
 587 override is toggled on.
 588 .RE
 589 
 590 .sp
 591 .ne 2
 592 .na
 593 \fB\fBprompt\fR\fI p\fR\fR
 594 .ad
 595 .sp .6
 596 .RS 4n
 597 change the \fBfsdb\fR prompt to \fIp\fR. \fIp\fR must be surrounded by (")s.
 598 .RE
 599 
 600 .sp
 601 .ne 2
 602 .na
 603 \fB\fBpwd\fR\fR
 604 .ad
 605 .sp .6
 606 .RS 4n


 635 .na
 636 \fB\fBshadow\fR\fR
 637 .ad
 638 .sp .6
 639 .RS 4n
 640 if the current inode is a shadow inode, then the value of \fIdot\fR is set to
 641 the beginning of the shadow inode data.
 642 .RE
 643 
 644 .sp
 645 .ne 2
 646 .na
 647 \fB\fB!\fR\fR
 648 .ad
 649 .sp .6
 650 .RS 4n
 651 escape to shell
 652 .RE
 653 
 654 .SS "Inode Commands"
 655 .sp
 656 .LP
 657 In addition to the above commands, there are several commands that deal with
 658 inode fields and operate directly on the current \fBinode\fR (they still
 659 require the ':'). They may be used to more easily display or change the
 660 particular fields. The value of \fIdot\fR is only used by the '\fB:db\fR'
 661 and '\fB:ib\fR' commands. Upon completion of the command, the value of \fIdot\fR is
 662 changed to point to that particular field. For example,
 663 .sp
 664 .LP
 665 \fB> :ln=+1\fR
 666 .sp
 667 .LP
 668 would increment the link count of the current \fBinode\fR and set the value of
 669 \fIdot\fR to the address of the link count field.
 670 .sp
 671 .ne 2
 672 .na
 673 \fB\fBat\fR\fR
 674 .ad
 675 .RS 7n


 696 
 697 .sp
 698 .ne 2
 699 .na
 700 \fB\fBdb\fR\fR
 701 .ad
 702 .RS 7n
 703 use the current value of \fIdot\fR as a direct block index, where direct blocks
 704 number from 0 - 11. In order to display the block itself, you need to 'pipe'
 705 this result into the \fBblock\fR or \fBfragment\fR command. For example,
 706 .sp
 707 .in +2
 708 .nf
 709 \fB     > 1:db:block,20/X\fR
 710 .fi
 711 .in -2
 712 .sp
 713 
 714 would get the contents of data block field 1 from the inode and convert it to a
 715 block address. 20 longs are then displayed in hexadecimal. See
 716 \fBFormatted\fROutput\fB\&.\fR
 717 .RE
 718 
 719 .sp
 720 .ne 2
 721 .na
 722 \fB\fBgid\fR\fR
 723 .ad
 724 .RS 7n
 725 group id.
 726 .RE
 727 
 728 .sp
 729 .ne 2
 730 .na
 731 \fB\fBib\fR\fR
 732 .ad
 733 .RS 7n
 734 use the current value of \fIdot\fR as an indirect block index where indirect
 735 blocks number from 0 - 2. This will only get the indirect block itself (the
 736 block containing the pointers to the actual blocks). Use the \fBfile\fR command


 812 
 813 .sp
 814 .ne 2
 815 .na
 816 \fB\fBsz\fR\fR
 817 .ad
 818 .RS 7n
 819 file size.
 820 .RE
 821 
 822 .sp
 823 .ne 2
 824 .na
 825 \fB\fBuid\fR\fR
 826 .ad
 827 .RS 7n
 828 user id.
 829 .RE
 830 
 831 .SS "Formatted Output"
 832 .sp
 833 .LP
 834 There are two styles and many format types. The two styles are structured and
 835 unstructured. Structured output is used to display inodes, directories,
 836 superblocks and the like. Unstructured displays raw data. The following shows
 837 the different ways of displaying:
 838 .sp
 839 .ne 2
 840 .na
 841 \fB\fB?\fR\fR
 842 .ad
 843 .RS 5n
 844 .sp
 845 .ne 2
 846 .na
 847 \fB\fBc\fR\fR
 848 .ad
 849 .RS 5n
 850 display as cylinder groups
 851 .RE
 852 


1198 .fi
1199 .in -2
1200 .sp
1201 
1202 .LP
1203 \fBExample 18 \fRDisplaying Shadow Inode Data
1204 .sp
1205 .LP
1206 The following command displays all of the shadow inode data in the shadow inode
1207 associated with the root inode of this file system:
1208 
1209 .sp
1210 .in +2
1211 .nf
1212 > 2:ino:si:ino;0:shadow,*?S
1213 .fi
1214 .in -2
1215 .sp
1216 
1217 .SH SEE ALSO
1218 .sp
1219 .LP
1220 \fBclri\fR(1M), \fBfsck_ufs\fR(1M), \fBdir_ufs\fR(4), \fBattributes\fR(5),
1221 \fBufs\fR(7FS)
1222 .SH WARNINGS
1223 .sp
1224 .LP
1225 Since \fBfsdb\fR reads the disk raw, extreme caution is advised in determining
1226 its availability of \fBfsdb\fR on the system. Suggested permissions are 600 and
1227 owned by bin.
1228 .SH NOTES
1229 .sp
1230 .LP
1231 The old command line syntax for clearing i-nodes using the ufs-specific
1232 \fB\&'-z i-number'\fR option is still supported by the new debugger, though it
1233 is obsolete and will be removed in a future release. Use of this flag will
1234 result in correct operation, but an error message will be printed warning of
1235 the impending obsolesence of this option to the command. The equivalent
1236 functionality is available using the more flexible \fBclri\fR(1M) command.
   1 '\" te
   2 .\"  Copyright (c) 1988 Regents of the University
   3 .\" of California.  All rights reserved.  Copyright (c) 2003 Sun Microsystems,
   4 .\" Inc.  All Rights Reserved.
   5 .TH FSDB_UFS 1M "Apr 14, 2003"
   6 .SH NAME
   7 fsdb_ufs \- ufs file system debugger
   8 .SH SYNOPSIS
   9 .LP
  10 .nf
  11 \fBfsdb\fR \fB-F\fR ufs [\fIgeneric_options\fR] [\fIspecific_options\fR] \fIspecial\fR
  12 .fi
  13 
  14 .SH DESCRIPTION

  15 .LP
  16 The \fBfsdb_ufs\fR command is an interactive tool that can be used to patch up
  17 a damaged \fBUFS\fR file system. It has conversions to translate block and
  18 i-numbers into their corresponding disk addresses. Also included are mnemonic
  19 offsets to access different parts of an inode. These greatly simplify the
  20 process of correcting control block entries or descending the file system tree.
  21 .sp
  22 .LP
  23 \fBfsdb\fR contains several error-checking routines to verify inode and block
  24 addresses. These can be disabled if necessary by invoking \fBfsdb\fR with the
  25 \fB-o\fR option or by the use of the \fBo\fR command.
  26 .sp
  27 .LP
  28 \fBfsdb\fR reads a block at a time and will therefore work with raw as well as
  29 block \fBI/O\fR devices. A buffer management routine is used to retain commonly
  30 used blocks of data in order to reduce the number of read system calls. All
  31 assignment operations result in an immediate write-through of the corresponding
  32 block. Note that in order to modify any portion of the disk, \fBfsdb\fR must be
  33 invoked with the \fBw\fR option.
  34 .sp
  35 .LP
  36 Wherever possible, \fBadb-\fRlike syntax was adopted to promote the use of
  37 \fBfsdb\fR through familiarity.
  38 .SH OPTIONS

  39 .LP
  40 The following option is supported:
  41 .sp
  42 .ne 2
  43 .na
  44 \fB\fB-o\fR\fR
  45 .ad
  46 .RS 6n
  47 Specify \fBUFS\fR file system specific options. These options can be any
  48 combination of the following separated by commas (with no intervening spaces).
  49 The options available are:
  50 .sp
  51 .ne 2
  52 .na
  53 \fB\fB?\fR\fR
  54 .ad
  55 .RS 14n
  56 Display usage
  57 .RE
  58 


  69 .ne 2
  70 .na
  71 \fB\fBp='string'\fR\fR
  72 .ad
  73 .RS 14n
  74 set prompt to string
  75 .RE
  76 
  77 .sp
  78 .ne 2
  79 .na
  80 \fB\fBw\fR\fR
  81 .ad
  82 .RS 14n
  83 open for write
  84 .RE
  85 
  86 .RE
  87 
  88 .SH USAGE

  89 .LP
  90 Numbers are considered hexadecimal by default. However, the user has control
  91 over how data is to be displayed or accepted. The \fBbase\fR command will
  92 display or set the input/output base. Once set, all input will default to this
  93 base and all output will be shown in this base. The base can be overridden
  94 temporarily for input by preceding hexadecimal numbers with \&'\fB0x\fR',
  95 preceding decimal numbers with '\fB0t\fR', or octal numbers with '\fB0\fR'.
  96 Hexadecimal numbers beginning with \fBa-f\fR or \fBA-F\fR must be preceded with
  97 \&'\fB0x\fR' to distinguish them from commands.
  98 .sp
  99 .LP
 100 Disk addressing by \fBfsdb\fR is at the byte level. However, \fBfsdb\fR offers
 101 many commands to convert a desired inode, directory entry, block, superblock
 102 and so forth to a byte address. Once the address has been calculated,
 103 \fBfsdb\fR will record the result in dot (\fB\&.\fR).
 104 .sp
 105 .LP
 106 Several global values are maintained by \fBfsdb\fR:
 107 .RS +4
 108 .TP


 181 
 182 .sp
 183 .LP
 184 The two examples are synonymous for getting to the first directory entry of the
 185 root of the file system. Once there, any subsequent  \fBRETURN\fR (or +, -)
 186 will advance to subsequent entries. Note that
 187 .sp
 188 .in +2
 189 .nf
 190 \fB> 2:inode; :ls\fR
 191       or
 192 \fB> :ls /\fR
 193 .fi
 194 .in -2
 195 .sp
 196 
 197 .sp
 198 .LP
 199 is again synonymous.
 200 .SS "Expressions"

 201 .LP
 202 The symbols recognized by \fBfsdb\fR are:
 203 .sp
 204 .ne 2
 205 .na
 206 \fB\fBRETURN\fR\fR
 207 .ad
 208 .RS 13n
 209 update the value of \fBdot\fR by the current value of \fBtype\fR and display
 210 using the current value of \fBcount\fR.
 211 .RE
 212 
 213 .sp
 214 .ne 2
 215 .na
 216 \fB\fB#\fR\fR
 217 .ad
 218 .RS 13n
 219 numeric expressions may be composed of +, -, *, and % operators (evaluated left
 220 to right) and may use parentheses. Once evaluated, the value of \fBdot\fR is


 223 
 224 .sp
 225 .ne 2
 226 .na
 227 \fB\fB,\fR\fI count\fR\fR
 228 .ad
 229 .RS 13n
 230 count indicator. The global value of \fBcount\fR will be updated to
 231 \fBcount\fR. The value of \fBcount\fR will remain until a new command is run. A
 232 count specifier of '*' will attempt to show a \fIblocks's\fR worth of
 233 information. The default for \fBcount\fR is 1.
 234 .RE
 235 
 236 .sp
 237 .ne 2
 238 .na
 239 \fB\fB?\fR\fI f\fR\fR
 240 .ad
 241 .RS 13n
 242 display in structured style with format specifier \fIf\fR. See
 243 \fBFormatted Output\fR.
 244 .RE
 245 
 246 .sp
 247 .ne 2
 248 .na
 249 \fB\fB/\fR\fI f\fR\fR
 250 .ad
 251 .RS 13n
 252 display in unstructured style with format specifier \fIf\fR. See
 253 \fBFormatted Output\fR.
 254 .RE
 255 
 256 .sp
 257 .ne 2
 258 .na
 259 \fB\fB\&.\fR\fR
 260 .ad
 261 .RS 13n
 262 the value of \fBdot\fR.
 263 .RE
 264 
 265 .sp
 266 .ne 2
 267 .na
 268 \fB\fB+\fR\fIe\fR\fR
 269 .ad
 270 .RS 13n
 271 increment the value of \fBdot\fR by the expression \fIe.\fR The amount actually
 272 incremented is dependent on the size of \fBtype\fR:
 273 .sp


 314 restore an address saved in register \fIname\fR. \fIname\fR must be a single
 315 letter or digit.
 316 .RE
 317 
 318 .sp
 319 .ne 2
 320 .na
 321 \fB\fB>\fR\fI name\fR\fR
 322 .ad
 323 .RS 13n
 324 save an address in register \fIname\fR. \fIname\fR must be a single letter or
 325 digit.
 326 .RE
 327 
 328 .sp
 329 .ne 2
 330 .na
 331 \fB\fB=\fR\fI f\fR\fR
 332 .ad
 333 .RS 13n
 334 display indicator. If \fIf\fR is a legitimate format specifier, then the value
 335 of \fBdot\fR is displayed using the format specifier \fIf\fR. See
 336 \fBFormatted Output\fR. Otherwise, assignment is assumed. See \fB=\fR.
 337 .RE
 338 
 339 .sp
 340 .ne 2
 341 .na
 342 \fB\fB= [\fR\fIs\fR\fB] [\fR\fIe\fR\fB]\fR\fR
 343 .ad
 344 .RS 13n
 345 assignment indicator. The address pointed to by \fBdot\fR has its contents
 346 changed to the value of the expression \fIe\fR or to the \fBASCII\fR
 347 representation of the quoted (") string \fIs\fR. This may be useful for
 348 changing directory names or \fBASCII\fR file information.
 349 .RE
 350 
 351 .sp
 352 .ne 2
 353 .na
 354 \fB\fB=+\fR\fI e\fR\fR
 355 .ad
 356 .RS 13n
 357 incremental assignment. The address pointed to by \fBdot\fR has its contents
 358 incremented by expression \fIe\fR.
 359 .RE
 360 
 361 .sp
 362 .ne 2
 363 .na
 364 \fB\fB=-\fR\fI e\fR\fR
 365 .ad
 366 .RS 13n
 367 decremental assignment. The address pointed to by \fBdot\fR has its contents
 368 decremented by expression \fIe\fR.
 369 .RE
 370 
 371 .SS "Commands"

 372 .LP
 373 A command must be prefixed by a ':' character. Only enough letters of the
 374 command to uniquely distinguish it are needed. Multiple commands may be entered
 375 on one line by separating them by a  \fBSPACE,\fR \fBTAB\fR or ';'.
 376 .sp
 377 .LP
 378 In order to view a potentially unmounted disk in a reasonable manner,
 379 \fBfsdb\fR offers the \fBcd\fR, \fBpwd\fR, \fBls\fR and \fBfind\fR commands.
 380 The functionality of these commands substantially matches those of its UNIX
 381 counterparts. See individual commands for details. The '*', '?', and '[-]' wild
 382 card characters are available.
 383 .sp
 384 .ne 2
 385 .na
 386 \fB\fBbase=b\fR\fR
 387 .ad
 388 .sp .6
 389 .RS 4n
 390 display or set base. As stated above, all input and output is governed by the
 391 current \fBbase\fR. If the  \fB=b\fR is omitted, the current \fBbase\fR is


 561 .na
 562 \fB\fBls\fR\fR
 563 .ad
 564 .sp .6
 565 .RS 4n
 566 [ \fB-R\fR ] [ \fB-l\fR ] \fIpat1 pat2\fR\|.\|.\|. list directories or files.
 567 If no file is specified, the current directory is assumed. Either or both of
 568 the options may be used (but, if used, \fImust\fR be specified before the
 569 filename specifiers). Also, as stated above, wild card characters are available
 570 and multiple arguments may be given. The long listing shows only the i-number
 571 and the name; use the \fBinode\fR command with '?i' to get more information.
 572 .RE
 573 
 574 .sp
 575 .ne 2
 576 .na
 577 \fB\fBoverride\fR\fR
 578 .ad
 579 .sp .6
 580 .RS 4n
 581 toggle the value of override. Some error conditions may be overridden if
 582 override is toggled on.
 583 .RE
 584 
 585 .sp
 586 .ne 2
 587 .na
 588 \fB\fBprompt\fR\fI p\fR\fR
 589 .ad
 590 .sp .6
 591 .RS 4n
 592 change the \fBfsdb\fR prompt to \fIp\fR. \fIp\fR must be surrounded by (")s.
 593 .RE
 594 
 595 .sp
 596 .ne 2
 597 .na
 598 \fB\fBpwd\fR\fR
 599 .ad
 600 .sp .6
 601 .RS 4n


 630 .na
 631 \fB\fBshadow\fR\fR
 632 .ad
 633 .sp .6
 634 .RS 4n
 635 if the current inode is a shadow inode, then the value of \fIdot\fR is set to
 636 the beginning of the shadow inode data.
 637 .RE
 638 
 639 .sp
 640 .ne 2
 641 .na
 642 \fB\fB!\fR\fR
 643 .ad
 644 .sp .6
 645 .RS 4n
 646 escape to shell
 647 .RE
 648 
 649 .SS "Inode Commands"

 650 .LP
 651 In addition to the above commands, there are several commands that deal with
 652 inode fields and operate directly on the current \fBinode\fR (they still
 653 require the ':'). They may be used to more easily display or change the
 654 particular fields. The value of \fIdot\fR is only used by the '\fB:db\fR'
 655 and '\fB:ib\fR' commands. Upon completion of the command, the value of \fIdot\fR is
 656 changed to point to that particular field. For example,
 657 .sp
 658 .LP
 659 \fB> :ln=+1\fR
 660 .sp
 661 .LP
 662 would increment the link count of the current \fBinode\fR and set the value of
 663 \fIdot\fR to the address of the link count field.
 664 .sp
 665 .ne 2
 666 .na
 667 \fB\fBat\fR\fR
 668 .ad
 669 .RS 7n


 690 
 691 .sp
 692 .ne 2
 693 .na
 694 \fB\fBdb\fR\fR
 695 .ad
 696 .RS 7n
 697 use the current value of \fIdot\fR as a direct block index, where direct blocks
 698 number from 0 - 11. In order to display the block itself, you need to 'pipe'
 699 this result into the \fBblock\fR or \fBfragment\fR command. For example,
 700 .sp
 701 .in +2
 702 .nf
 703 \fB     > 1:db:block,20/X\fR
 704 .fi
 705 .in -2
 706 .sp
 707 
 708 would get the contents of data block field 1 from the inode and convert it to a
 709 block address. 20 longs are then displayed in hexadecimal. See
 710 \fBFormatted Output\fR.
 711 .RE
 712 
 713 .sp
 714 .ne 2
 715 .na
 716 \fB\fBgid\fR\fR
 717 .ad
 718 .RS 7n
 719 group id.
 720 .RE
 721 
 722 .sp
 723 .ne 2
 724 .na
 725 \fB\fBib\fR\fR
 726 .ad
 727 .RS 7n
 728 use the current value of \fIdot\fR as an indirect block index where indirect
 729 blocks number from 0 - 2. This will only get the indirect block itself (the
 730 block containing the pointers to the actual blocks). Use the \fBfile\fR command


 806 
 807 .sp
 808 .ne 2
 809 .na
 810 \fB\fBsz\fR\fR
 811 .ad
 812 .RS 7n
 813 file size.
 814 .RE
 815 
 816 .sp
 817 .ne 2
 818 .na
 819 \fB\fBuid\fR\fR
 820 .ad
 821 .RS 7n
 822 user id.
 823 .RE
 824 
 825 .SS "Formatted Output"

 826 .LP
 827 There are two styles and many format types. The two styles are structured and
 828 unstructured. Structured output is used to display inodes, directories,
 829 superblocks and the like. Unstructured displays raw data. The following shows
 830 the different ways of displaying:
 831 .sp
 832 .ne 2
 833 .na
 834 \fB\fB?\fR\fR
 835 .ad
 836 .RS 5n
 837 .sp
 838 .ne 2
 839 .na
 840 \fB\fBc\fR\fR
 841 .ad
 842 .RS 5n
 843 display as cylinder groups
 844 .RE
 845 


1191 .fi
1192 .in -2
1193 .sp
1194 
1195 .LP
1196 \fBExample 18 \fRDisplaying Shadow Inode Data
1197 .sp
1198 .LP
1199 The following command displays all of the shadow inode data in the shadow inode
1200 associated with the root inode of this file system:
1201 
1202 .sp
1203 .in +2
1204 .nf
1205 > 2:ino:si:ino;0:shadow,*?S
1206 .fi
1207 .in -2
1208 .sp
1209 
1210 .SH SEE ALSO

1211 .LP
1212 \fBclri\fR(1M), \fBfsck_ufs\fR(1M), \fBdir_ufs\fR(4), \fBattributes\fR(5),
1213 \fBufs\fR(7FS)
1214 .SH WARNINGS

1215 .LP
1216 Since \fBfsdb\fR reads the disk raw, extreme caution is advised in determining
1217 its availability of \fBfsdb\fR on the system. Suggested permissions are 600 and
1218 owned by bin.
1219 .SH NOTES

1220 .LP
1221 The old command line syntax for clearing i-nodes using the ufs-specific
1222 \fB\&'-z i-number'\fR option is still supported by the new debugger, though it
1223 is obsolete and will be removed in a future release. Use of this flag will
1224 result in correct operation, but an error message will be printed warning of
1225 the impending obsolesence of this option to the command. The equivalent
1226 functionality is available using the more flexible \fBclri\fR(1M) command.