Commit | Line | Data |
---|---|---|
ba8cfc9e KM |
1 | .\" Copyright (c) 1988 Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" This program is derived from software contributed to Berkeley by | |
5 | .\" Computer Consoles Inc. | |
6 | .\" | |
7 | .\" Redistribution and use in source and binary forms are permitted | |
8 | .\" provided that this notice is preserved and that due credit is given | |
9 | .\" to the University of California at Berkeley. The name of the University | |
10 | .\" may not be used to endorse or promote products derived from this | |
11 | .\" software without specific prior written permission. This software | |
12 | .\" is provided ``as is'' without express or implied warranty. | |
13 | .\" | |
14 | .\" @(#)fsdb.8 6.1 (Berkeley) %G% | |
15 | .\" | |
16 | .TH FSDB 8 "" | |
17 | .UC 7 | |
18 | .SH NAME | |
19 | fsdb \- file system debugger | |
20 | .SH SYNOPSIS | |
21 | .B /etc/fsdb | |
22 | .RB [ options ] | |
23 | special | |
24 | .SH OPTIONS | |
25 | The options available to | |
26 | .I fsdb\^ | |
27 | are: | |
28 | .RS | |
29 | .PD 0 | |
30 | .TP 13 | |
31 | .B -? | |
32 | display usage | |
33 | .TP 13 | |
34 | .B -o | |
35 | override some error conditions | |
36 | .TP 13 | |
37 | .B "-p'string'\^" | |
38 | set prompt to string | |
39 | .TP 13 | |
40 | .B -w | |
41 | open for write | |
42 | .PD | |
43 | .RE | |
44 | .SH DESCRIPTION | |
45 | Since | |
46 | .I fsdb | |
47 | reads the disk raw, | |
48 | it is able to circumvent normal | |
49 | file system security. | |
50 | Extreme caution is advised | |
51 | in determining its availability | |
52 | on the system. | |
53 | Suggested permissions are 600 | |
54 | and owned by bin. | |
55 | .PP | |
56 | .I Fsdb\^ | |
57 | can be used | |
58 | to patch up | |
59 | a damaged file system | |
60 | after a crash. | |
61 | It has conversions | |
62 | to translate block and i-numbers | |
63 | into their corresponding disk addresses. | |
64 | Also included are mnemonic offsets | |
65 | to access different parts | |
66 | of an inode. | |
67 | These greatly simplify the process | |
68 | of correcting control block entries | |
69 | or descending the file system tree. | |
70 | .PP | |
71 | .I Fsdb\^ | |
72 | contains several error-checking routines | |
73 | to verify inode and block addresses. | |
74 | These can be disabled if necessary | |
75 | by invoking | |
76 | .I fsdb\^ | |
77 | with the | |
78 | .IR \-o | |
79 | option | |
80 | or by the use of the | |
81 | .IR o | |
82 | command. | |
83 | .PP | |
84 | .I Fsdb\^ | |
85 | reads a block at a time | |
86 | and will therefore work with raw as well as block | |
87 | I/O. | |
88 | A buffer management routine | |
89 | is used to retain commonly used | |
90 | blocks of data | |
91 | in order to reduce the number of read system calls. | |
92 | All assignment operations result | |
93 | in an immediate write-through | |
94 | of the corresponding block. | |
95 | Note that in order to modify | |
96 | any portion of the disk, | |
97 | .IR fsdb | |
98 | must be invoked with the | |
99 | .IR -w | |
100 | option. | |
101 | .PP | |
102 | Wherever possible, | |
103 | .IR adb- like | |
104 | syntax was adopted | |
105 | to promote the use | |
106 | of | |
107 | .IR fsdb | |
108 | through familiarity. | |
109 | .PP | |
110 | Numbers are considered hexadecimal by default. | |
111 | However, the user has control over how data is | |
112 | to be displayed | |
113 | or accepted. | |
114 | The | |
115 | .IR base | |
116 | command will display | |
117 | or set the input/output base. | |
118 | Once set, | |
119 | all input will default to this base | |
120 | and all output will be shown in this base. | |
121 | The base can be overriden temporarily for input by | |
122 | preceding hexadecimal numbers with '0x', preceding | |
123 | decimal numbers with '0t', or | |
124 | octal numbers with '0'. | |
125 | Hexadecimal numbers beginning with a-f or A-F must | |
126 | be preceded with '0x' | |
127 | to distinguish them from commands. | |
128 | .PP | |
129 | Disk addressing by | |
130 | .IR fsdb | |
131 | is at the byte level. | |
132 | However, | |
133 | .IR fsdb | |
134 | offers many commands to convert | |
135 | a desired inode, directory entry, | |
136 | block, superblock etc. to a | |
137 | byte address. | |
138 | Once the address has been calculated, | |
139 | .IR fsdb | |
140 | will record the result in | |
141 | .IR dot | |
142 | (see next paragraph). | |
143 | .PP | |
144 | Several global values are maintained by | |
145 | .IR fsdb : | |
146 | the current base (referred to as | |
147 | .IR base ), | |
148 | the current address (referred to as | |
149 | .IR dot ), | |
150 | the current inode (referred to as | |
151 | .IR inode ), | |
152 | the current count (referred to as | |
153 | .IR count ), | |
154 | and the current type (referred to as | |
155 | .IR type ). | |
156 | Most commands use the preset value of | |
157 | .IR dot | |
158 | in | |
159 | their execution. | |
160 | For example, | |
161 | .RS | |
162 | .PD 0 | |
163 | .TP 7.2n | |
164 | > 2:inode | |
165 | .PD | |
166 | .RE | |
167 | will first set the value of | |
168 | .IR dot | |
169 | to 2, ':' will alert the start of a command, | |
170 | and the | |
171 | .IR inode | |
172 | command will set | |
173 | .IR inode | |
174 | to 2. | |
175 | A count is specified after a ','. | |
176 | Once set, | |
177 | .IR count | |
178 | will remain at this value | |
179 | until a new command is encountered | |
180 | which will then reset the value back to 1 (the default). | |
181 | So, if | |
182 | .RS | |
183 | .PD 0 | |
184 | .TP 7.2n | |
185 | > 2000,400/X | |
186 | .PD | |
187 | .RE | |
188 | is typed, | |
189 | 400 hex longs are listed | |
190 | from 2000, | |
191 | and when completed, | |
192 | the value of | |
193 | .IR dot | |
194 | will be 2000 + 400 * sizeof (long). | |
195 | If a carriage-return is then typed, | |
196 | the output routine will use the | |
197 | current values of | |
198 | .IR dot , | |
199 | .IR count , | |
200 | and | |
201 | .IR type | |
202 | and display 400 more hex longs. | |
203 | A '*' will cause the entire block to | |
204 | be displayed. | |
205 | .PP | |
206 | End of fragment, block and file are maintained by | |
207 | .IR fsdb. | |
208 | When displaying data as fragments or blocks, | |
209 | an error message will be displayed when the end of fragment | |
210 | or block is reached. | |
211 | When displaying data using the | |
212 | .IR db, | |
213 | .IR ib, | |
214 | .IR directory, | |
215 | or | |
216 | .IR file | |
217 | commands an error message is displayed if the | |
218 | end of file is reached. | |
219 | This is mainly needed | |
220 | to avoid passing the | |
221 | end of a directory or file | |
222 | and getting unknown and unwanted results. | |
223 | .PP | |
224 | An example showing several commands and | |
225 | the use of carriage-return would be: | |
226 | .RS | |
227 | .PD 0 | |
228 | .TP 7.2n | |
229 | > 2:ino; 0:dir?d | |
230 | .br | |
231 | or | |
232 | .PD | |
233 | .RE | |
234 | .RS | |
235 | .PD 0 | |
236 | .TP 7.2n | |
237 | > 2:ino; 0:db:block?d | |
238 | .PD | |
239 | .RE | |
240 | The two examples are synonymous for getting to the first | |
241 | directory entry of the root of the file system. | |
242 | Once there, | |
243 | subsequent carriage-returns (or +, -) will advance to subsequent | |
244 | entries. | |
245 | Note that | |
246 | .RS | |
247 | .PD 0 | |
248 | .TP 7.2n | |
249 | > 2:inode; :ls | |
250 | .br | |
251 | or | |
252 | .PD | |
253 | .RE | |
254 | .RS | |
255 | .PD 0 | |
256 | .TP 7.2n | |
257 | > :ls / | |
258 | .PD | |
259 | .RE | |
260 | is again synonymous. | |
261 | .SH EXPRESSIONS | |
262 | .PP | |
263 | The symbols recognized by | |
264 | .I fsdb\^ | |
265 | are: | |
266 | .TP 7.2n | |
267 | .B carriage-return | |
268 | update the value of | |
269 | .IR dot | |
270 | by the current value of | |
271 | .IR type | |
272 | and display using the current value of | |
273 | .IR count . | |
274 | .TP 7.2n | |
275 | .B # | |
276 | numeric expressions may be composed of +, -, *, and % operators | |
277 | (evaluated left to right) and may use parentheses. Once evaluated, | |
278 | the value of | |
279 | .IR dot | |
280 | is updated. | |
281 | .TP 7.2n | |
282 | .BI , " count"\^ | |
283 | count indicator. The global value of | |
284 | .IR count | |
285 | will be updated to | |
286 | .IR count . | |
287 | The value of | |
288 | .IR count | |
289 | will remain until a new command is run. | |
290 | A count specifier of '*' will attempt to show a | |
291 | .IR blocks's | |
292 | worth of information. | |
293 | The default for | |
294 | .IR count | |
295 | is 1. | |
296 | .TP 7.2n | |
297 | .BI ? " f\^" | |
298 | display in structured style with format | |
299 | specifier | |
300 | .IR f | |
301 | (see FORMATTED OUTPUT section). | |
302 | .TP 7.2n | |
303 | .BI / " f\^" | |
304 | display in unstructured style with format | |
305 | specifier | |
306 | .IR f | |
307 | (see FORMATTED OUTPUT section). | |
308 | .TP 7.2n | |
309 | .B . | |
310 | the value of | |
311 | .IR dot . | |
312 | .TP 7.2n | |
313 | .BI + "e\^" | |
314 | increment the value of | |
315 | .IR dot | |
316 | by the expression | |
317 | .IR e. | |
318 | The amount actually incremented is dependent | |
319 | on the size of | |
320 | .IR type : | |
321 | .br | |
322 | .nf | |
323 | dot = dot + e * sizeof (type) | |
324 | .fi | |
325 | The default for | |
326 | .IR e | |
327 | is 1. | |
328 | .TP 7.2n | |
329 | .BI - "e\^" | |
330 | decrement the value of | |
331 | .IR dot | |
332 | by the expression | |
333 | .IR e | |
334 | (see +). | |
335 | .TP 7.2n | |
336 | .BI * "e\^" | |
337 | multiply the value of | |
338 | .IR dot | |
339 | by the expression | |
340 | .IR e. | |
341 | Multiplication and division don't | |
342 | use | |
343 | .IR type. | |
344 | In the above calculation of | |
345 | .IR dot , | |
346 | consider the | |
347 | sizeof ( | |
348 | .IR type ) | |
349 | to be 1. | |
350 | .TP 7.2n | |
351 | .BI % "e\^" | |
352 | divide the value of | |
353 | .IR dot | |
354 | by the expression | |
355 | .IR e | |
356 | (see *). | |
357 | .TP 7.2n | |
358 | .BI < " name\^" | |
359 | restore an address saved in register | |
360 | .IR name . | |
361 | .IR name | |
362 | must be a single letter or digit. | |
363 | .TP 7.2n | |
364 | .BI > " name\^" | |
365 | save an address in register | |
366 | .IR name . | |
367 | .IR name | |
368 | must be a single letter or digit. | |
369 | .TP 7.2n | |
370 | .BI = " f" | |
371 | display indicator. | |
372 | If | |
373 | .IR f | |
374 | is a legitimate format specifier | |
375 | (see FORMATTED OUTPUT | |
376 | section), | |
377 | then the value of | |
378 | .IR dot | |
379 | is displayed using | |
380 | format specifier | |
381 | .IR f . | |
382 | Otherwise, | |
383 | assignment is assumed | |
384 | (see next item). | |
385 | .TP 7.2n | |
386 | .BI = " [s] [e]\^" | |
387 | assignment indicator. | |
388 | The address pointed to by | |
389 | .IR dot | |
390 | has its contents changed to the value of the | |
391 | expression | |
392 | .IR e | |
393 | or to the | |
394 | .IR ASCII | |
395 | representation of the | |
396 | quoted (") string | |
397 | .IR s. | |
398 | This may be useful for changing | |
399 | directory names or | |
400 | .IR ASCII | |
401 | file information. | |
402 | .TP 7.2n | |
403 | .BI =+ " e\^" | |
404 | incremental assignment. | |
405 | The address pointed to by | |
406 | .IR dot | |
407 | has its contents incremented by expression | |
408 | .IR e . | |
409 | .TP 7.2n | |
410 | .BI =- " e\^" | |
411 | decremental assignment. | |
412 | The address pointed to by | |
413 | .IR dot | |
414 | has its contents decremented by expression | |
415 | .IR e . | |
416 | .SH COMMANDS | |
417 | .PP | |
418 | A command must be prefixed by a ':' character. | |
419 | Only enough letters of the command | |
420 | to uniquely | |
421 | distinguish it are needed. | |
422 | Multiple commands may be entered | |
423 | on one line by separating | |
424 | them by a space, tab or ';'. | |
425 | .PP | |
426 | In order to view a potentially | |
427 | unmounted disk in a reasonable | |
428 | manner, | |
429 | .I fsdb\^ | |
430 | offers the | |
431 | .IR cd , | |
432 | .IR pwd , | |
433 | .IR ls | |
434 | and | |
435 | .IR find | |
436 | commands. | |
437 | The functionality of these | |
438 | commands substantially matches those of | |
439 | its | |
440 | .IR UNIX | |
441 | counterparts | |
442 | (see individual command for details). | |
443 | The '*', '?', and '[-]' wild card | |
444 | characters are available. | |
445 | .TP 7.2n | |
446 | .BI base=b | |
447 | display or set base. As stated above, | |
448 | all input and output is governed by | |
449 | the current | |
450 | .IR base . | |
451 | If the '=b' is left off, | |
452 | the current | |
453 | .IR base | |
454 | is displayed. | |
455 | Otherwise, the current | |
456 | .IR base | |
457 | is set | |
458 | to | |
459 | .IR b. | |
460 | Note that this is interpreted | |
461 | using the old value of | |
462 | .IR base , | |
463 | so to ensure correctness use the '0', '0t', or '0x' | |
464 | prefix when changing the | |
465 | .IR base. | |
466 | The default for | |
467 | .IR base | |
468 | is hexadecimal. | |
469 | .TP 7.2n | |
470 | .B block | |
471 | convert the value of | |
472 | .IR dot | |
473 | to a block address. | |
474 | .TP 7.2n | |
475 | .B cd dir | |
476 | change the current directory | |
477 | to directory | |
478 | .IR dir. | |
479 | The current values of | |
480 | .IR inode | |
481 | and | |
482 | .IR dot | |
483 | are also updated. | |
484 | If no | |
485 | .IR dir | |
486 | is specified, | |
487 | then change directories to | |
488 | inode 2 ("/"). | |
489 | .TP 7.2n | |
490 | .B cg | |
491 | convert the value of | |
492 | .IR dot | |
493 | to a cylinder group. | |
494 | .TP 7.2n | |
495 | .B directory | |
496 | If the current | |
497 | .IR inode | |
498 | is a directory, | |
499 | then the value of | |
500 | .IR dot | |
501 | is converted to a directory | |
502 | slot offset in that directory | |
503 | and | |
504 | .IR dot | |
505 | now points to | |
506 | this entry. | |
507 | .TP 7.2n | |
508 | .B file | |
509 | the value of | |
510 | .IR dot | |
511 | is taken as | |
512 | a relative block count from the | |
513 | beginning of the file. | |
514 | The value of | |
515 | .IR dot | |
516 | is updated to the first byte | |
517 | of this block. | |
518 | .IR | |
519 | .TP 7.2n | |
520 | .BI find " dir [-name n] [-inum i]\^" | |
521 | find files by name or i-number. | |
522 | .IR find | |
523 | recursively searches | |
524 | directory | |
525 | .IR dir | |
526 | and below for filenames whose | |
527 | i-number matches | |
528 | .IR i | |
529 | or whose name | |
530 | matches pattern | |
531 | .IR n . | |
532 | Note that only one of the two options | |
533 | (-name or -inum) | |
534 | may be used at one time. | |
535 | Also, the -print is not needed or | |
536 | accepted. | |
537 | .TP 7.2n | |
538 | .BI fill "=p\^" | |
539 | fill an area of disk with pattern | |
540 | .IR p. | |
541 | The area of disk | |
542 | is delimited by | |
543 | .IR dot | |
544 | and | |
545 | .IR count . | |
546 | .TP 7.2n | |
547 | .B fragment | |
548 | convert the value of | |
549 | .IR dot | |
550 | to | |
551 | a fragment address. | |
552 | The only difference between the | |
553 | .IR fragment | |
554 | command and the | |
555 | .IR block | |
556 | command is the amount that | |
557 | is able to be displayed. | |
558 | .TP 7.2n | |
559 | .B inode | |
560 | convert the value of | |
561 | .IR dot | |
562 | to an inode address. | |
563 | If successful, | |
564 | the current value of | |
565 | .IR inode | |
566 | will be updated as well as | |
567 | the value of | |
568 | .IR dot. | |
569 | As a convenient shorthand, | |
570 | if ':inode' appears at the | |
571 | beginning of the line, | |
572 | the value of | |
573 | .IR dot | |
574 | is set to the current | |
575 | .IR inode | |
576 | and that inode is displayed | |
577 | in inode format. | |
578 | .TP 7.2n | |
579 | .BI ls " [-R] [-l] pat1 pat2 ...\^" | |
580 | list directories or files. | |
581 | If no file is specified, | |
582 | the current directory is assumed. | |
583 | Either or both of the | |
584 | options may be used (but, if used, | |
585 | .IR must | |
586 | be specified before the | |
587 | filename specifiers). | |
588 | Also, as stated above, | |
589 | wild card characters are | |
590 | available and multiple | |
591 | arguments may be given. | |
592 | The long listing shows only | |
593 | the i-number and the name; | |
594 | use the | |
595 | .IR inode | |
596 | command with '?i' | |
597 | to get more information. | |
598 | .TP 7.2n | |
599 | .B override | |
600 | toggle the value of override. | |
601 | Some error conditions may be | |
602 | overriden | |
603 | if override is toggled on. | |
604 | .TP 7.2n | |
605 | .BI prompt " p\^" | |
606 | change the fsdb prompt to | |
607 | .IR p. | |
608 | .IR p | |
609 | must be surrounded by (")s. | |
610 | .TP 7.2n | |
611 | .B pwd | |
612 | display the current working directory. | |
613 | .TP 7.2n | |
614 | .B quit | |
615 | quit | |
616 | .IR fsdb . | |
617 | .TP 7.2n | |
618 | .B sb | |
619 | the value of | |
620 | .IR dot | |
621 | is taken as a cylinder group | |
622 | number and then converted to | |
623 | the address of the superblock | |
624 | in that cylinder group. | |
625 | As a shorthand, ':sb' at | |
626 | the beginning of a line | |
627 | will set the value of | |
628 | .IR dot | |
629 | to | |
630 | .IR the | |
631 | superblock and display it | |
632 | in superblock format. | |
633 | .TP 7.2n | |
634 | .B ! | |
635 | escape to shell | |
636 | .SH INODE COMMANDS | |
637 | In addition to the above commands, | |
638 | there are several commands that deal with inode | |
639 | fields and operate directly on the current | |
640 | .IR inode | |
641 | (they still require the ':'). | |
642 | They may be used to more easily display | |
643 | or change the particular fields. | |
644 | The value of | |
645 | .IR dot | |
646 | is only used by the ':db' | |
647 | and ':ib' commands. | |
648 | Upon completion of the command, | |
649 | the value of | |
650 | .IR dot | |
651 | is changed to point to | |
652 | that particular field. | |
653 | For example, | |
654 | .RS | |
655 | .PD 0 | |
656 | .TP 7.2n | |
657 | > :ln=+1 | |
658 | .PD | |
659 | .RE | |
660 | would | |
661 | increment the link count of the current | |
662 | .IR inode | |
663 | and set the value of | |
664 | .IR dot | |
665 | to the address of the link | |
666 | count field. | |
667 | .TP 7.2n | |
668 | .B at | |
669 | access time. | |
670 | .TP 7.2n | |
671 | .B bs | |
672 | block size. | |
673 | .TP 7.2n | |
674 | .B ct | |
675 | creation time. | |
676 | .TP 7.2n | |
677 | .B db | |
678 | use the current value of | |
679 | .IR dot | |
680 | as a direct block index, | |
681 | where direct blocks number from | |
682 | 0 - 11. | |
683 | In order to display the block | |
684 | itself, you need to 'pipe' this | |
685 | result into the | |
686 | .IR block | |
687 | or | |
688 | .IR fragment | |
689 | command. | |
690 | For example, | |
691 | .br | |
692 | .nf | |
693 | > 1:db:block,20/X | |
694 | .fi | |
695 | would get the contents of | |
696 | data block field 1 from the inode and | |
697 | convert it to a block address. | |
698 | 20 longs are then displayed in hexadecimal | |
699 | (see FORMATTED OUTPUT section). | |
700 | .TP 7.2n | |
701 | .B gid | |
702 | group id. | |
703 | .TP 7.2n | |
704 | .B ib | |
705 | use the current value of | |
706 | .IR dot | |
707 | as an indirect block index | |
708 | where indirect blocks number from | |
709 | 0 - 2. | |
710 | This will only get the indirect block itself | |
711 | (the block containing the pointers to the actual blocks). | |
712 | Use the | |
713 | .IR file | |
714 | command and start at block 12 to get to the actual | |
715 | blocks. | |
716 | .TP 7.2n | |
717 | .B ln | |
718 | link count. | |
719 | .TP 7.2n | |
720 | .B mt | |
721 | modification time. | |
722 | .TP 7.2n | |
723 | .B md | |
724 | mode. | |
725 | .TP 7.2n | |
726 | .B maj | |
727 | major device number. | |
728 | .TP 7.2n | |
729 | .B min | |
730 | minor device number. | |
731 | .TP 7.2n | |
732 | .B nm | |
733 | although listed here, | |
734 | this command actually | |
735 | operates on the directory | |
736 | name field. | |
737 | Once poised at the desired | |
738 | directory entry (using the | |
739 | .IR directory | |
740 | command), | |
741 | this command will allow | |
742 | you to change or display | |
743 | the directory name. | |
744 | For example, | |
745 | .br | |
746 | .nf | |
747 | > 7:dir:nm="foo" | |
748 | .fi | |
749 | will get the 7th directory | |
750 | entry of the current | |
751 | .IR inode | |
752 | and change its name to foo. | |
753 | Note that names | |
754 | cannot be made larger than the | |
755 | field is set up for. | |
756 | If an attempt is made, | |
757 | the string is truncated to fit | |
758 | and a warning message to this | |
759 | effect is displayed. | |
760 | .TP 7.2n | |
761 | .B sz | |
762 | file size. | |
763 | .TP 7.2n | |
764 | .B uid | |
765 | user id. | |
766 | .SH FORMATTED OUTPUT | |
767 | .PP | |
768 | There are two styles | |
769 | and many format types. | |
770 | The two styles are structured and | |
771 | unstructured. | |
772 | Structured output is used to display | |
773 | inodes, directories, superblocks and the | |
774 | like. | |
775 | Unstructured just displays | |
776 | raw data. | |
777 | The following table shows the | |
778 | different ways of displaying: | |
779 | .TP 7.2n | |
780 | .B ? | |
781 | .RS | |
782 | .PD 0 | |
783 | .TP 13 | |
784 | .B c | |
785 | display as cylinder groups | |
786 | .TP 13 | |
787 | .B i | |
788 | display as inodes | |
789 | .TP 13 | |
790 | .B d | |
791 | display as directories | |
792 | .TP 13 | |
793 | .B s | |
794 | display as superblocks | |
795 | .PD | |
796 | .RE | |
797 | .TP 7.2n | |
798 | .B / | |
799 | .RS | |
800 | .PD 0 | |
801 | .TP 13 | |
802 | .B b | |
803 | display as bytes | |
804 | .TP 13 | |
805 | .B c | |
806 | display as characters | |
807 | .TP 13 | |
808 | .B o O | |
809 | display as octal shorts or longs | |
810 | .TP 13 | |
811 | .B d D | |
812 | display as decimal shorts or longs | |
813 | .TP 13 | |
814 | .B x X | |
815 | display as hexadecimal shorts or longs | |
816 | .PD | |
817 | .RE | |
818 | .PP | |
819 | The format specifier immediately follows | |
820 | the '/' or '?' character. | |
821 | The values displayed by '/b' and all '?' | |
822 | formats are displayed in the current | |
823 | .IR base . | |
824 | Also, | |
825 | .IR type | |
826 | is appropriately updated | |
827 | upon completion. | |
828 | .SH EXAMPLES | |
829 | .TP 16 | |
830 | > 2000+400%(20+20)=D | |
831 | will display 2010 in decimal (use of | |
832 | .IR fsdb | |
833 | as a calculator | |
834 | for complex arithmetic). | |
835 | .TP 16 | |
836 | > 386:ino?i | |
837 | display i-number 386 in an inode format. | |
838 | This now becomes the current | |
839 | .IR inode . | |
840 | .TP 16 | |
841 | > :ln=4 | |
842 | changes the link count for the | |
843 | current | |
844 | .IR inode | |
845 | to 4. | |
846 | .TP 16 | |
847 | > :ln=+1 | |
848 | increments the link count by 1. | |
849 | .TP 16 | |
850 | > :ct=X | |
851 | display the creation time as a hexadecimal long. | |
852 | .TP 16 | |
853 | > :mt=t | |
854 | display the modification time in time format. | |
855 | .TP 16 | |
856 | > 0:file/c | |
857 | displays, in | |
858 | .IR ASCII , | |
859 | block zero of the file associated | |
860 | with the | |
861 | current | |
862 | .IR inode . | |
863 | .TP 16 | |
864 | > 2:ino,*?d | |
865 | displays the first blocks worth of directory entries for | |
866 | the root inode of this file system. | |
867 | It will stop prematurely if the eof is reached. | |
868 | .TP 16 | |
869 | > 5:dir:inode; 0:file,*/c | |
870 | changes the current inode to that | |
871 | associated with the 5th directory entry | |
872 | (numbered from zero) | |
873 | of the current | |
874 | .IR inode. | |
875 | The first logical block of the file | |
876 | is then displayed in | |
877 | .IR ASCII . | |
878 | .TP 16 | |
879 | > :sb | |
880 | displays the superblock of this file system. | |
881 | .TP 16 | |
882 | > 1:cg?c | |
883 | displays cylinder group information and summary | |
884 | for cylinder group 1. | |
885 | .TP 16 | |
886 | > 2:inode; 7:dir=3 | |
887 | changes the i-number for the | |
888 | seventh directory slot in the root directory to 3. | |
889 | .TP 16 | |
890 | > 7:dir:nm="name" | |
891 | changes the name field | |
892 | in the directory slot to | |
893 | .IR name . | |
894 | .TP 16 | |
895 | > 2:db:block,*?d | |
896 | displays the third block of the current | |
897 | .IR inode | |
898 | as directory entries. | |
899 | .TP 16 | |
900 | > 3c3:fragment,20:fill=0x20 | |
901 | get fragment 3c3 and fill 20 | |
902 | .IR type | |
903 | elements | |
904 | with 0x20. | |
905 | .TP 16 | |
906 | > 2050=0xffff | |
907 | set the contents of address 2050 to 0xffffffff. | |
908 | 0xffffffff may be truncated depending on the current | |
909 | .IR type. | |
910 | .TP 16 | |
911 | > 1c92434="this is some text" | |
912 | will place the | |
913 | .IR ASCII | |
914 | for the string at | |
915 | 1c92434. | |
916 | .SH SEE ALSO | |
917 | fsck(8), dir(4), fs(5). | |
918 | .SH BUGS | |
919 | .PP | |
920 | Extreme caution is advised in | |
921 | determining the availability | |
922 | of | |
923 | .IR fsdb | |
924 | on the system. | |
925 | Suggested permissions are 600 and | |
926 | owned by bin. |