8980 BIOS clock is sometimes one hour fast
[unleashed.git] / usr / src / man / man1m / fsdb_ufs.1m
blob6481f4688af5304d4077bfcee1dbee9414893106
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
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
61 .sp
62 .ne 2
63 .na
64 \fB\fBo\fR\fR
65 .ad
66 .RS 14n
67 Override some error conditions
68 .RE
70 .sp
71 .ne 2
72 .na
73 \fB\fBp='string'\fR\fR
74 .ad
75 .RS 14n
76 set prompt to string
77 .RE
79 .sp
80 .ne 2
81 .na
82 \fB\fBw\fR\fR
83 .ad
84 .RS 14n
85 open for write
86 .RE
88 .RE
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.
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).
109 Several global values are maintained by \fBfsdb\fR:
110 .RS +4
112 .ie t \(bu
113 .el o
114 the current base (referred to as \fBbase\fR),
116 .RS +4
118 .ie t \(bu
119 .el o
120 the current address (referred to as \fBdot\fR),
122 .RS +4
124 .ie t \(bu
125 .el o
126 the current inode (referred to as \fBinode\fR),
128 .RS +4
130 .ie t \(bu
131 .el o
132 the current count (referred to as \fBcount\fR),
134 .RS +4
136 .ie t \(bu
137 .el o
138 and the current type (referred to as \fBtype\fR).
142 Most commands use the preset value of \fBdot\fR in their execution. For
143 example,
146 \fB> 2:inode\fR
149 will first set the value of \fBdot\fR to 2, ':', will alert the start of a
150 command, and the \fBinode\fR command will set \fBinode\fR to 2. A count is
151 specified after a ','. Once set, \fBcount\fR will remain at this value until a
152 new command is encountered which will then reset the value back to 1 (the
153 default). So, if
156 \fB> 2000,400/X\fR
159 is typed, 400 hex longs are listed from 2000, and when completed, the value of
160 \fBdot\fR will be \fB2000 + 400 * sizeof (long)\fR. If a  \fBRETURN\fR is then
161 typed, the output routine will use the current values of \fBdot\fR,
162 \fBcount\fR, and \fBtype\fR and display 400 more hex longs. A '*' will cause
163 the entire block to be displayed.
166 End of fragment, block and file are maintained by \fBfsdb\fR. When displaying
167 data as fragments or blocks, an error message will be displayed when the end of
168 fragment or block is reached. When displaying data using the \fBdb\fR,
169 \fBib\fR, \fBdirectory\fR, or \fBfile\fR commands an error message is displayed
170 if the end of file is reached. This is mainly needed to avoid passing the end
171 of a directory or file and getting unknown and unwanted results.
174 An example showing several commands and the use of  \fBRETURN\fR would be:
176 .in +2
178 \fB> 2:ino; 0:dir?d\fR
179       or
180 \fB> 2:ino; 0:db:block?d\fR
182 .in -2
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
191 .in +2
193 \fB> 2:inode; :ls\fR
194       or
195 \fB> :ls /\fR
197 .in -2
202 is again synonymous.
203 .SS "Expressions"
206 The symbols recognized by \fBfsdb\fR are:
208 .ne 2
210 \fB\fBRETURN\fR\fR
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.
218 .ne 2
220 \fB\fB#\fR\fR
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
225 updated.
229 .ne 2
231 \fB\fB,\fR\fI count\fR\fR
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.
241 .ne 2
243 \fB\fB?\fR\fI f\fR\fR
245 .RS 13n
246 display in structured style with format specifier \fIf\fR. See
247 \fBFormatted\fROutput\fB\&.\fR
251 .ne 2
253 \fB\fB/\fR\fI f\fR\fR
255 .RS 13n
256 display in unstructured style with format specifier \fIf\fR See
257 \fBFormatted\fROutput\fB\&.\fR
261 .ne 2
263 \fB\fB\&.\fR\fR
265 .RS 13n
266 the value of \fBdot\fR.
270 .ne 2
272 \fB\fB+\fR\fIe\fR\fR
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:
278 \fBdot = dot + e * sizeof (type)\fR
280 The default for \fIe\fR is \fB1\fR.
284 .ne 2
286 \fB\fB-\fR\fIe\fR\fR
288 .RS 13n
289 decrement the value of \fBdot\fR by the expression \fIe\fR. See  \fB+\fR.
293 .ne 2
295 \fB\fB*\fR\fIe\fR\fR
297 .RS 13n
298 multiply the value of \fBdot\fR by the expression \fIe.\fR Multiplication and
299 division don't use \fBtype\fR. In the above calculation of \fBdot\fR, consider
300 the \fBsizeof(type)\fR to be \fB1\fR.
304 .ne 2
306 \fB\fB%\fR\fIe\fR\fR
308 .RS 13n
309 divide the value of \fBdot\fR by the expression \fIe\fR. See  \fB*\fR.
313 .ne 2
315 \fB\fB<\fR\fI name\fR\fR
317 .RS 13n
318 restore an address saved in register \fIname\fR. \fIname\fR must be a single
319 letter or digit.
323 .ne 2
325 \fB\fB>\fR\fI name\fR\fR
327 .RS 13n
328 save an address in register \fIname\fR. \fIname\fR must be a single letter or
329 digit.
333 .ne 2
335 \fB\fB=\fR\fI f\fR\fR
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.
344 .ne 2
346 \fB\fB= [\fR\fIs\fR\fB] [\fR\fIe\fR\fB]\fR\fR
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.
356 .ne 2
358 \fB\fB=+\fR\fI e\fR\fR
360 .RS 13n
361 incremental assignment. The address pointed to by \fBdot\fR has its contents
362 incremented by expression \fIe\fR.
366 .ne 2
368 \fB\fB=-\fR\fI e\fR\fR
370 .RS 13n
371 decremental assignment. The address pointed to by \fBdot\fR has its contents
372 decremented by expression \fIe\fR.
375 .SS "Commands"
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 ';'.
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.
389 .ne 2
391 \fB\fBbase=b\fR\fR
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
397 displayed. Otherwise, the current \fBbase\fR is set to \fIb.\fR Note that this
398 is interpreted using the old value of \fBbase\fR, so to ensure correctness use
399 the '0', '0t', or '0x' prefix when changing the \fBbase\fR. The default for
400 \fBbase\fR is hexadecimal.
404 .ne 2
406 \fB\fBblock\fR\fR
408 .sp .6
409 .RS 4n
410 convert the value of \fBdot\fR to a block address.
414 .ne 2
416 \fB\fBcd \fR\fIdir\fR\fR
418 .sp .6
419 .RS 4n
420 change the current directory to directory \fIdir\fR. The current values of
421 \fBinode\fR and \fBdot\fR are also updated. If no \fIdir\fR is specified, then
422 change directories to inode \fB2\fR ("/").
426 .ne 2
428 \fB\fBcg\fR\fR
430 .sp .6
431 .RS 4n
432 convert the value of \fBdot\fR to a cylinder group.
436 .ne 2
438 \fB\fBdirectory\fR\fR
440 .sp .6
441 .RS 4n
442 If the current \fBinode\fR is a directory, then the value of \fBdot\fR is
443 converted to a directory slot offset in that directory and \fBdot\fR now points
444 to this entry.
448 .ne 2
450 \fB\fBfile\fR\fR
452 .sp .6
453 .RS 4n
454 the value of \fBdot\fR is taken as a relative block count from the beginning of
455 the file. The value of \fBdot\fR is updated to the first byte of this block.
459 .ne 2
461 \fB\fBfind\fR \fIdir\fR [ \fB-name\fR \fIn\fR] [\fB-inum\fR \fIi\fR]\fR
463 .sp .6
464 .RS 4n
465 find files by name or i-number. \fBfind\fR recursively searches directory
466 \fBdir\fR and below for filenames whose i-number matches \fIi\fR or whose name
467 matches pattern \fIn\fR. Note that only one of the two options (-name or -inum)
468 may be used at one time. Also, the -print is not needed or accepted.
472 .ne 2
474 \fB\fBfill\fR\fI=p\fR\fR
476 .sp .6
477 .RS 4n
478 fill an area of disk with pattern \fIp\fR. The area of disk is delimited by
479 \fBdot\fR and \fBcount\fR.
483 .ne 2
485 \fB\fBfragment\fR\fR
487 .sp .6
488 .RS 4n
489 convert the value of \fIdot\fR to a fragment address. The only difference
490 between the \fBfragment\fR command and the \fBblock\fR command is the amount
491 that is able to be displayed.
495 .ne 2
497 \fB\fBinode\fR\fR
499 .sp .6
500 .RS 4n
501 convert the value of \fIdot\fR to an inode address. If successful, the current
502 value of \fBinode\fR will be updated as well as the value of \fIdot\fR. As a
503 convenient shorthand, if ':inode' appears at the beginning of the line, the
504 value of \fIdot\fR is set to the current \fBinode\fR and that inode is
505 displayed in inode format.
509 .ne 2
511 \fB\fBlog_chk\fR\fR
513 .sp .6
514 .RS 4n
515 run through the valid log entries without printing any information and verify
516 the layout.
520 .ne 2
522 \fB\fBlog_delta\fR\fR
524 .sp .6
525 .RS 4n
526 count the number of deltas into the log, using the value of dot as an offset
527 into the log. No checking is done to make sure that offset is within the
528 head/tail offsets.
532 .ne 2
534 \fB\fBlog_head\fR\fR
536 .sp .6
537 .RS 4n
538 display the header information about the file system logging. This shows the
539 block allocation for the log and the data structures on the disk.
543 .ne 2
545 \fB\fBlog_otodb\fR\fR
547 .sp .6
548 .RS 4n
549 return the physical disk block number, using the value of dot as an offset into
550 the log.
554 .ne 2
556 \fB\fBlog_show\fR\fR
558 .sp .6
559 .RS 4n
560 display all deltas between  the beginning of the log (BOL) and the end of the
561 log (EOL).
565 .ne 2
567 \fB\fBls\fR\fR
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.
580 .ne 2
582 \fB\fBoverride\fR\fR
584 .sp .6
585 .RS 4n
586 toggle the value of override. Some error conditions may be overriden if
587 override is toggled on.
591 .ne 2
593 \fB\fBprompt\fR\fI p\fR\fR
595 .sp .6
596 .RS 4n
597 change the \fBfsdb\fR prompt to \fIp\fR. \fIp\fR must be surrounded by (")s.
601 .ne 2
603 \fB\fBpwd\fR\fR
605 .sp .6
606 .RS 4n
607 display the current working directory.
611 .ne 2
613 \fB\fBquit\fR\fR
615 .sp .6
616 .RS 4n
617 quit \fBfsdb\fR.
621 .ne 2
623 \fB\fBsb\fR\fR
625 .sp .6
626 .RS 4n
627 the value of \fIdot\fR is taken as a cylinder group number and then converted
628 to the address of the superblock in that cylinder group. As a shorthand, ':sb'
629 at the beginning of a line will set the value of \fIdot\fR to \fIthe\fR
630 superblock and display it in superblock format.
634 .ne 2
636 \fB\fBshadow\fR\fR
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.
645 .ne 2
647 \fB\fB!\fR\fR
649 .sp .6
650 .RS 4n
651 escape to shell
654 .SS "Inode Commands"
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,
665 \fB> :ln=+1\fR
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.
671 .ne 2
673 \fB\fBat\fR\fR
675 .RS 7n
676 access time.
680 .ne 2
682 \fB\fBbs\fR\fR
684 .RS 7n
685 block size.
689 .ne 2
691 \fB\fBct\fR\fR
693 .RS 7n
694 creation time.
698 .ne 2
700 \fB\fBdb\fR\fR
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,
707 .in +2
709 \fB     > 1:db:block,20/X\fR
711 .in -2
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
720 .ne 2
722 \fB\fBgid\fR\fR
724 .RS 7n
725 group id.
729 .ne 2
731 \fB\fBib\fR\fR
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
737 and start at block 12 to get to the actual blocks.
741 .ne 2
743 \fB\fBln\fR\fR
745 .RS 7n
746 link count.
750 .ne 2
752 \fB\fBmt\fR\fR
754 .RS 7n
755 modification time.
759 .ne 2
761 \fB\fBmd\fR\fR
763 .RS 7n
764 mode.
768 .ne 2
770 \fB\fBmaj\fR\fR
772 .RS 7n
773 major device number.
777 .ne 2
779 \fB\fBmin\fR\fR
781 .RS 7n
782 minor device number.
786 .ne 2
788 \fB\fBnm\fR\fR
790 .RS 7n
791 although listed here, this command actually operates on the directory name
792 field. Once poised at the desired directory entry (using the \fIdirectory\fR
793 command), this command will allow you to change or display the directory name.
794 For example,
796 \fB> 7:dir:nm="foo"\fR
798 will get the \fB7\fRth directory entry of the current \fBinode\fR and change
799 its name to foo. Note that names cannot be made larger than the field is set up
800 for. If an attempt is made, the string is truncated to fit and a warning
801 message to this effect is displayed.
805 .ne 2
807 \fB\fBsi\fR\fR
809 .RS 7n
810 shadow inode.
814 .ne 2
816 \fB\fBsz\fR\fR
818 .RS 7n
819 file size.
823 .ne 2
825 \fB\fBuid\fR\fR
827 .RS 7n
828 user id.
831 .SS "Formatted Output"
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:
839 .ne 2
841 \fB\fB?\fR\fR
843 .RS 5n
845 .ne 2
847 \fB\fBc\fR\fR
849 .RS 5n
850 display as cylinder groups
854 .ne 2
856 \fB\fBi\fR\fR
858 .RS 5n
859 display as inodes
863 .ne 2
865 \fB\fBd\fR\fR
867 .RS 5n
868 display as directories
872 .ne 2
874 \fB\fBs\fR\fR
876 .RS 5n
877 display as superblocks
881 .ne 2
883 \fB\fBS\fR\fR
885 .RS 5n
886 display as shadow inode data
892 .ne 2
894 \fB\fB/\fR\fR
896 .RS 5n
898 .ne 2
900 \fB\fBb\fR\fR
902 .RS 7n
903 display as bytes
907 .ne 2
909 \fB\fBc\fR\fR
911 .RS 7n
912 display as characters
916 .ne 2
918 \fB\fBo O\fR\fR
920 .RS 7n
921 display as octal shorts or longs
925 .ne 2
927 \fB\fBd D\fR\fR
929 .RS 7n
930 display as decimal shorts or longs
934 .ne 2
936 \fB\fBx X\fR\fR
938 .RS 7n
939 display as hexadecimal shorts or longs
942 The format specifier immediately follows the '/' or '?' character. The values
943 displayed by '/b' and all '?' formats are displayed in the current \fBbase\fR.
944 Also, \fBtype\fR is appropriately updated upon completion.
947 .SH EXAMPLES
949 \fBExample 1 \fRDisplaying in Decimal
952 The following command displays \fB2010\fR in decimal (use of \fBfsdb\fR as a
953 calculator for complex arithmetic):
956 .in +2
958 > 2000+400%(20+20)=D
960 .in -2
964 \fBExample 2 \fRDisplaying an i-number in Inode Format
967 The following command displays i-number \fB386\fR in an inode format. This now
968 becomes the current \fBinode\fR:
971 .in +2
973 > 386:ino?i
975 .in -2
979 \fBExample 3 \fRChanging the Link Count
982 The following command changes the link count for the current \fBinode\fR to
983 \fB4\fR:
986 .in +2
988 > :ln=4
990 .in -2
994 \fBExample 4 \fRIncrementing the Link Count
997 The following command increments the link count by \fB1\fR:
1000 .in +2
1002 > :ln=+1
1004 .in -2
1008 \fBExample 5 \fRDisplaying the Creation Time
1011 The following command displays the creation time as a hexadecimal long:
1014 .in +2
1016 > :ct=X
1018 .in -2
1022 \fBExample 6 \fRDisplaying the Modification Time
1025 The following command displays the modification time in time format:
1028 .in +2
1030 > :mt=t
1032 .in -2
1036 \fBExample 7 \fRDisplaying in ASCII
1039 The following command displays in \fBASCII,\fR block zero of the file
1040 associated with the current \fBinode\fR:
1043 .in +2
1045 > 0:file/c
1047 .in -2
1051 \fBExample 8 \fRDisplaying the First Block's Worth of Directorty Entries
1054 The following command displays the first block's worth of directory entries for
1055 the root inode of this file system. It will stop prematurely if the \fBEOF\fR
1056 is reached:
1059 .in +2
1061 > 2:ino,*?d
1063 .in -2
1067 \fBExample 9 \fRDisplaying Changes to the Current Inode
1070 The following command displays changes the current inode to that associated
1071 with the \fB5\fRth directory entry (numbered from zero) of the current
1072 \fBinode\fR. The first logical block of the file is then displayed in
1073 \fBASCII\fR:
1076 .in +2
1078 > 5:dir:inode; 0:file,*/c
1080 .in -2
1084 \fBExample 10 \fRDisplaying the Superblock
1087 The following command displays the superblock of this file system:
1090 .in +2
1092 > :sb
1094 .in -2
1098 \fBExample 11 \fRDisplaying the Cylinder Group
1101 The following command displays cylinder group information and summary for
1102 cylinder group \fB1\fR:
1105 .in +2
1107 > 1:cg?c
1109 .in -2
1113 \fBExample 12 \fRChanging the i-number
1116 The following command changes the i-number for the seventh directory slot in
1117 the root directory to \fB3\fR:
1120 .in +2
1122 > 2:inode; 7:dir=3
1124 .in -2
1128 \fBExample 13 \fRDisplaying as Directory Entries
1131 The following command displays the third block of the current \fBinode\fR as
1132 directory entries:
1135 .in +2
1137 > 2:db:block,*?d
1139 .in -2
1143 \fBExample 14 \fRChanging the Name Field
1146 The following command changes the name field in the directory slot to
1147 \fIname\fR:
1150 .in +2
1152 > 7:dir:nm="name"
1154 .in -2
1158 \fBExample 15 \fRGetting and Filling Elements
1161 The following command gets fragment \fB3c3\fR and fill \fB20\fR \fBtype\fR
1162 elements with \fB0x20\fR:
1165 .in +2
1167 > 3c3:fragment,20:fill=0x20
1169 .in -2
1173 \fBExample 16 \fRSetting the Contents of an Address
1176 The following command sets the contents of address \fB2050\fR to
1177 \fB0xffffffff\fR. \fB0xffffffff\fR may be truncated depending on the current
1178 \fBtype\fR:
1181 .in +2
1183 > 2050=0xffff
1185 .in -2
1189 \fBExample 17 \fRPlacing ASCII
1192 The following command places the \fBASCII\fR for the string at \fB1c92434\fR:
1195 .in +2
1197 > 1c92434="this is some text"
1199 .in -2
1203 \fBExample 18 \fRDisplaying Shadow Inode Data
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:
1210 .in +2
1212 > 2:ino:si:ino;0:shadow,*?S
1214 .in -2
1217 .SH SEE ALSO
1220 \fBclri\fR(1M), \fBfsck_ufs\fR(1M), \fBdir_ufs\fR(4), \fBattributes\fR(5),
1221 \fBufs\fR(7FS)
1222 .SH WARNINGS
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
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.