Print this page
10057 Man page misspellings ouput particuliar overriden
Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1m/fsdb_ufs.1m.man.txt
+++ new/usr/src/man/man1m/fsdb_ufs.1m.man.txt
1 1 FSDB_UFS(1M) Maintenance Commands FSDB_UFS(1M)
2 2
3 3
4 4
5 5 NAME
6 6 fsdb_ufs - ufs file system debugger
7 7
8 8 SYNOPSIS
9 9 fsdb -F ufs [generic_options] [specific_options] special
10 10
11 11
12 12 DESCRIPTION
13 13 The fsdb_ufs command is an interactive tool that can be used to patch
14 14 up a damaged UFS file system. It has conversions to translate block and
15 15 i-numbers into their corresponding disk addresses. Also included are
16 16 mnemonic offsets to access different parts of an inode. These greatly
17 17 simplify the process of correcting control block entries or descending
18 18 the file system tree.
19 19
20 20
21 21 fsdb contains several error-checking routines to verify inode and block
22 22 addresses. These can be disabled if necessary by invoking fsdb with the
23 23 -o option or by the use of the o command.
24 24
25 25
26 26 fsdb reads a block at a time and will therefore work with raw as well
27 27 as block I/O devices. A buffer management routine is used to retain
28 28 commonly used blocks of data in order to reduce the number of read
29 29 system calls. All assignment operations result in an immediate write-
30 30 through of the corresponding block. Note that in order to modify any
31 31 portion of the disk, fsdb must be invoked with the w option.
32 32
33 33
34 34 Wherever possible, adb-like syntax was adopted to promote the use of
35 35 fsdb through familiarity.
36 36
37 37 OPTIONS
38 38 The following option is supported:
39 39
40 40 -o
41 41 Specify UFS file system specific options. These options can be
42 42 any combination of the following separated by commas (with no
43 43 intervening spaces). The options available are:
44 44
45 45 ?
46 46 Display usage
47 47
48 48
49 49 o
50 50 Override some error conditions
51 51
52 52
53 53 p='string'
54 54 set prompt to string
55 55
56 56
57 57 w
58 58 open for write
59 59
60 60
61 61
62 62 USAGE
63 63 Numbers are considered hexadecimal by default. However, the user has
64 64 control over how data is to be displayed or accepted. The base command
65 65 will display or set the input/output base. Once set, all input will
66 66 default to this base and all output will be shown in this base. The
67 67 base can be overridden temporarily for input by preceding hexadecimal
68 68 numbers with '0x', preceding decimal numbers with '0t', or octal
69 69 numbers with '0'. Hexadecimal numbers beginning with a-f or A-F must
70 70 be preceded with '0x' to distinguish them from commands.
71 71
72 72
73 73 Disk addressing by fsdb is at the byte level. However, fsdb offers many
74 74 commands to convert a desired inode, directory entry, block, superblock
75 75 and so forth to a byte address. Once the address has been calculated,
76 76 fsdb will record the result in dot (.).
77 77
78 78
79 79 Several global values are maintained by fsdb:
80 80
81 81 o the current base (referred to as base),
82 82
83 83 o the current address (referred to as dot),
84 84
85 85 o the current inode (referred to as inode),
86 86
87 87 o the current count (referred to as count),
88 88
89 89 o and the current type (referred to as type).
90 90
91 91
92 92 Most commands use the preset value of dot in their execution. For
93 93 example,
94 94
95 95
96 96 > 2:inode
97 97
98 98
99 99 will first set the value of dot to 2, ':', will alert the start of a
100 100 command, and the inode command will set inode to 2. A count is
101 101 specified after a ','. Once set, count will remain at this value until
102 102 a new command is encountered which will then reset the value back to 1
103 103 (the default). So, if
104 104
105 105
106 106 > 2000,400/X
107 107
108 108
109 109 is typed, 400 hex longs are listed from 2000, and when completed, the
110 110 value of dot will be 2000 + 400 * sizeof (long). If a RETURN is then
111 111 typed, the output routine will use the current values of dot, count,
112 112 and type and display 400 more hex longs. A '*' will cause the entire
113 113 block to be displayed.
114 114
115 115
116 116 End of fragment, block and file are maintained by fsdb. When displaying
117 117 data as fragments or blocks, an error message will be displayed when
118 118 the end of fragment or block is reached. When displaying data using the
119 119 db, ib, directory, or file commands an error message is displayed if
120 120 the end of file is reached. This is mainly needed to avoid passing the
121 121 end of a directory or file and getting unknown and unwanted results.
122 122
123 123
124 124 An example showing several commands and the use of RETURN would be:
125 125
126 126 > 2:ino; 0:dir?d
127 127 or
128 128 > 2:ino; 0:db:block?d
129 129
130 130
131 131
132 132
133 133 The two examples are synonymous for getting to the first directory
134 134 entry of the root of the file system. Once there, any subsequent
135 135 RETURN (or +, -) will advance to subsequent entries. Note that
136 136
137 137 > 2:inode; :ls
138 138 or
139 139 > :ls /
140 140
141 141
142 142
143 143
144 144 is again synonymous.
145 145
146 146 Expressions
147 147 The symbols recognized by fsdb are:
148 148
149 149 RETURN
150 150 update the value of dot by the current value of type and
151 151 display using the current value of count.
152 152
153 153
154 154 #
155 155 numeric expressions may be composed of +, -, *, and %
156 156 operators (evaluated left to right) and may use
157 157 parentheses. Once evaluated, the value of dot is updated.
158 158
159 159
↓ open down ↓ |
159 lines elided |
↑ open up ↑ |
160 160 , count
161 161 count indicator. The global value of count will be updated
162 162 to count. The value of count will remain until a new
163 163 command is run. A count specifier of '*' will attempt to
164 164 show a blocks's worth of information. The default for
165 165 count is 1.
166 166
167 167
168 168 ? f
169 169 display in structured style with format specifier f. See
170 - FormattedOutput.
170 + Formatted Output.
171 171
172 172
173 173 / f
174 - display in unstructured style with format specifier f See
175 - FormattedOutput.
174 + display in unstructured style with format specifier f. See
175 + Formatted Output.
176 176
177 177
178 178 .
179 179 the value of dot.
180 180
181 181
182 182 +e
183 183 increment the value of dot by the expression e. The amount
184 184 actually incremented is dependent on the size of type:
185 185
186 186 dot = dot + e * sizeof (type)
187 187
188 188 The default for e is 1.
189 189
190 190
191 191 -e
192 - decrement the value of dot by the expression e. See +.
192 + decrement the value of dot by the expression e. See +.
193 193
194 194
195 195 *e
196 196 multiply the value of dot by the expression e.
197 197 Multiplication and division don't use type. In the above
198 198 calculation of dot, consider the sizeof(type) to be 1.
199 199
200 200
201 201 %e
202 - divide the value of dot by the expression e. See *.
202 + divide the value of dot by the expression e. See *.
203 203
204 204
205 205 < name
206 206 restore an address saved in register name. name must be a
207 207 single letter or digit.
208 208
209 209
210 210 > name
211 211 save an address in register name. name must be a single
212 212 letter or digit.
213 213
214 214
215 215 = f
216 - display indicator. If f is a legitimate format specifier.
216 + display indicator. If f is a legitimate format specifier,
217 217 then the value of dot is displayed using the format
218 - specifier f. See FormattedOutput. Otherwise, assignment is
219 - assumed See =.
218 + specifier f. See Formatted Output. Otherwise, assignment
219 + is assumed. See =.
220 220
221 221
222 222 = [s] [e]
223 223 assignment indicator. The address pointed to by dot has
224 224 its contents changed to the value of the expression e or
225 225 to the ASCII representation of the quoted (") string s.
226 226 This may be useful for changing directory names or ASCII
227 227 file information.
228 228
229 229
230 230 =+ e
231 231 incremental assignment. The address pointed to by dot has
232 232 its contents incremented by expression e.
233 233
234 234
235 235 =- e
236 236 decremental assignment. The address pointed to by dot has
237 237 its contents decremented by expression e.
238 238
239 239
240 240 Commands
241 241 A command must be prefixed by a ':' character. Only enough letters of
242 242 the command to uniquely distinguish it are needed. Multiple commands
243 243 may be entered on one line by separating them by a SPACE, TAB or ';'.
244 244
245 245
246 246 In order to view a potentially unmounted disk in a reasonable manner,
247 247 fsdb offers the cd, pwd, ls and find commands. The functionality of
248 248 these commands substantially matches those of its UNIX counterparts.
249 249 See individual commands for details. The '*', '?', and '[-]' wild card
250 250 characters are available.
251 251
252 252 base=b
253 253
254 254 display or set base. As stated above, all input and output is
255 255 governed by the current base. If the =b is omitted, the current
256 256 base is displayed. Otherwise, the current base is set to b. Note
257 257 that this is interpreted using the old value of base, so to ensure
258 258 correctness use the '0', '0t', or '0x' prefix when changing the
259 259 base. The default for base is hexadecimal.
260 260
261 261
262 262 block
263 263
264 264 convert the value of dot to a block address.
265 265
266 266
267 267 cd dir
268 268
269 269 change the current directory to directory dir. The current values
270 270 of inode and dot are also updated. If no dir is specified, then
271 271 change directories to inode 2 ("/").
272 272
273 273
274 274 cg
275 275
276 276 convert the value of dot to a cylinder group.
277 277
278 278
279 279 directory
280 280
281 281 If the current inode is a directory, then the value of dot is
282 282 converted to a directory slot offset in that directory and dot now
283 283 points to this entry.
284 284
285 285
286 286 file
287 287
288 288 the value of dot is taken as a relative block count from the
289 289 beginning of the file. The value of dot is updated to the first
290 290 byte of this block.
291 291
292 292
293 293 find dir [ -name n] [-inum i]
294 294
295 295 find files by name or i-number. find recursively searches directory
296 296 dir and below for filenames whose i-number matches i or whose name
297 297 matches pattern n. Note that only one of the two options (-name or
298 298 -inum) may be used at one time. Also, the -print is not needed or
299 299 accepted.
300 300
301 301
302 302 fill=p
303 303
304 304 fill an area of disk with pattern p. The area of disk is delimited
305 305 by dot and count.
306 306
307 307
308 308 fragment
309 309
310 310 convert the value of dot to a fragment address. The only difference
311 311 between the fragment command and the block command is the amount
312 312 that is able to be displayed.
313 313
314 314
315 315 inode
316 316
317 317 convert the value of dot to an inode address. If successful, the
318 318 current value of inode will be updated as well as the value of dot.
319 319 As a convenient shorthand, if ':inode' appears at the beginning of
320 320 the line, the value of dot is set to the current inode and that
321 321 inode is displayed in inode format.
322 322
323 323
324 324 log_chk
325 325
326 326 run through the valid log entries without printing any information
327 327 and verify the layout.
328 328
329 329
330 330 log_delta
331 331
332 332 count the number of deltas into the log, using the value of dot as
333 333 an offset into the log. No checking is done to make sure that
334 334 offset is within the head/tail offsets.
335 335
336 336
337 337 log_head
338 338
339 339 display the header information about the file system logging. This
340 340 shows the block allocation for the log and the data structures on
341 341 the disk.
342 342
343 343
344 344 log_otodb
345 345
346 346 return the physical disk block number, using the value of dot as an
347 347 offset into the log.
348 348
349 349
350 350 log_show
351 351
352 352 display all deltas between the beginning of the log (BOL) and the
353 353 end of the log (EOL).
354 354
355 355
356 356 ls
357 357
358 358 [ -R ] [ -l ] pat1 pat2... list directories or files. If no file
359 359 is specified, the current directory is assumed. Either or both of
↓ open down ↓ |
130 lines elided |
↑ open up ↑ |
360 360 the options may be used (but, if used, must be specified before the
361 361 filename specifiers). Also, as stated above, wild card characters
362 362 are available and multiple arguments may be given. The long listing
363 363 shows only the i-number and the name; use the inode command with
364 364 '?i' to get more information.
365 365
366 366
367 367 override
368 368
369 369 toggle the value of override. Some error conditions may be
370 - overriden if override is toggled on.
370 + overridden if override is toggled on.
371 371
372 372
373 373 prompt p
374 374
375 375 change the fsdb prompt to p. p must be surrounded by (")s.
376 376
377 377
378 378 pwd
379 379
380 380 display the current working directory.
381 381
382 382
383 383 quit
384 384
385 385 quit fsdb.
386 386
387 387
388 388 sb
389 389
390 390 the value of dot is taken as a cylinder group number and then
391 391 converted to the address of the superblock in that cylinder group.
392 392 As a shorthand, ':sb' at the beginning of a line will set the value
393 393 of dot to the superblock and display it in superblock format.
394 394
395 395
396 396 shadow
397 397
398 398 if the current inode is a shadow inode, then the value of dot is
399 399 set to the beginning of the shadow inode data.
400 400
401 401
402 402 !
403 403
404 404 escape to shell
405 405
406 406
407 407 Inode Commands
408 408 In addition to the above commands, there are several commands that deal
409 409 with inode fields and operate directly on the current inode (they still
410 410 require the ':'). They may be used to more easily display or change the
411 411 particular fields. The value of dot is only used by the ':db' and ':ib'
412 412 commands. Upon completion of the command, the value of dot is changed
413 413 to point to that particular field. For example,
414 414
415 415
416 416 > :ln=+1
417 417
418 418
419 419 would increment the link count of the current inode and set the value
420 420 of dot to the address of the link count field.
421 421
422 422 at
423 423 access time.
424 424
425 425
426 426 bs
427 427 block size.
428 428
429 429
430 430 ct
431 431 creation time.
432 432
433 433
434 434 db
↓ open down ↓ |
54 lines elided |
↑ open up ↑ |
435 435 use the current value of dot as a direct block index, where
436 436 direct blocks number from 0 - 11. In order to display the block
437 437 itself, you need to 'pipe' this result into the block or
438 438 fragment command. For example,
439 439
440 440 > 1:db:block,20/X
441 441
442 442
443 443 would get the contents of data block field 1 from the inode and
444 444 convert it to a block address. 20 longs are then displayed in
445 - hexadecimal. See FormattedOutput.
445 + hexadecimal. See Formatted Output.
446 446
447 447
448 448 gid
449 449 group id.
450 450
451 451
452 452 ib
453 453 use the current value of dot as an indirect block index where
454 454 indirect blocks number from 0 - 2. This will only get the
455 455 indirect block itself (the block containing the pointers to the
456 456 actual blocks). Use the file command and start at block 12 to
457 457 get to the actual blocks.
458 458
459 459
460 460 ln
461 461 link count.
462 462
463 463
464 464 mt
465 465 modification time.
466 466
467 467
468 468 md
469 469 mode.
470 470
471 471
472 472 maj
473 473 major device number.
474 474
475 475
476 476 min
477 477 minor device number.
478 478
479 479
480 480 nm
481 481 although listed here, this command actually operates on the
482 482 directory name field. Once poised at the desired directory entry
483 483 (using the directory command), this command will allow you to
484 484 change or display the directory name. For example,
485 485
486 486 > 7:dir:nm="foo"
487 487
488 488 will get the 7th directory entry of the current inode and change
489 489 its name to foo. Note that names cannot be made larger than the
490 490 field is set up for. If an attempt is made, the string is
491 491 truncated to fit and a warning message to this effect is
492 492 displayed.
493 493
494 494
495 495 si
496 496 shadow inode.
497 497
498 498
499 499 sz
500 500 file size.
501 501
502 502
503 503 uid
504 504 user id.
505 505
506 506
507 507 Formatted Output
508 508 There are two styles and many format types. The two styles are
509 509 structured and unstructured. Structured output is used to display
510 510 inodes, directories, superblocks and the like. Unstructured displays
511 511 raw data. The following shows the different ways of displaying:
512 512
513 513 ?
514 514
515 515 c
516 516 display as cylinder groups
517 517
518 518
519 519 i
520 520 display as inodes
521 521
522 522
523 523 d
524 524 display as directories
525 525
526 526
527 527 s
528 528 display as superblocks
529 529
530 530
531 531 S
532 532 display as shadow inode data
533 533
534 534
535 535
536 536 /
537 537
538 538 b
539 539 display as bytes
540 540
541 541
542 542 c
543 543 display as characters
544 544
545 545
546 546 o O
547 547 display as octal shorts or longs
548 548
549 549
550 550 d D
551 551 display as decimal shorts or longs
552 552
553 553
554 554 x X
555 555 display as hexadecimal shorts or longs
556 556
557 557 The format specifier immediately follows the '/' or '?' character.
558 558 The values displayed by '/b' and all '?' formats are displayed in
559 559 the current base. Also, type is appropriately updated upon
560 560 completion.
561 561
562 562
563 563 EXAMPLES
564 564 Example 1 Displaying in Decimal
565 565
566 566
567 567 The following command displays 2010 in decimal (use of fsdb as a
568 568 calculator for complex arithmetic):
569 569
570 570
571 571 > 2000+400%(20+20)=D
572 572
573 573
574 574
575 575 Example 2 Displaying an i-number in Inode Format
576 576
577 577
578 578 The following command displays i-number 386 in an inode format. This
579 579 now becomes the current inode:
580 580
581 581
582 582 > 386:ino?i
583 583
584 584
585 585
586 586 Example 3 Changing the Link Count
587 587
588 588
589 589 The following command changes the link count for the current inode to
590 590 4:
591 591
592 592
593 593 > :ln=4
594 594
595 595
596 596
597 597 Example 4 Incrementing the Link Count
598 598
599 599
600 600 The following command increments the link count by 1:
601 601
602 602
603 603 > :ln=+1
604 604
605 605
606 606
607 607 Example 5 Displaying the Creation Time
608 608
609 609
610 610 The following command displays the creation time as a hexadecimal long:
611 611
612 612
613 613 > :ct=X
614 614
615 615
616 616
617 617 Example 6 Displaying the Modification Time
618 618
619 619
620 620 The following command displays the modification time in time format:
621 621
622 622
623 623 > :mt=t
624 624
625 625
626 626
627 627 Example 7 Displaying in ASCII
628 628
629 629
630 630 The following command displays in ASCII, block zero of the file
631 631 associated with the current inode:
632 632
633 633
634 634 > 0:file/c
635 635
636 636
637 637
638 638 Example 8 Displaying the First Block's Worth of Directorty Entries
639 639
640 640
641 641 The following command displays the first block's worth of directory
642 642 entries for the root inode of this file system. It will stop
643 643 prematurely if the EOF is reached:
644 644
645 645
646 646 > 2:ino,*?d
647 647
648 648
649 649
650 650 Example 9 Displaying Changes to the Current Inode
651 651
652 652
653 653 The following command displays changes the current inode to that
654 654 associated with the 5th directory entry (numbered from zero) of the
655 655 current inode. The first logical block of the file is then displayed in
656 656 ASCII:
657 657
658 658
659 659 > 5:dir:inode; 0:file,*/c
660 660
661 661
662 662
663 663 Example 10 Displaying the Superblock
664 664
665 665
666 666 The following command displays the superblock of this file system:
667 667
668 668
669 669 > :sb
670 670
671 671
672 672
673 673 Example 11 Displaying the Cylinder Group
674 674
675 675
676 676 The following command displays cylinder group information and summary
677 677 for cylinder group 1:
678 678
679 679
680 680 > 1:cg?c
681 681
682 682
683 683
684 684 Example 12 Changing the i-number
685 685
686 686
687 687 The following command changes the i-number for the seventh directory
688 688 slot in the root directory to 3:
689 689
690 690
691 691 > 2:inode; 7:dir=3
692 692
693 693
694 694
695 695 Example 13 Displaying as Directory Entries
696 696
697 697
698 698 The following command displays the third block of the current inode as
699 699 directory entries:
700 700
701 701
702 702 > 2:db:block,*?d
703 703
704 704
705 705
706 706 Example 14 Changing the Name Field
707 707
708 708
709 709 The following command changes the name field in the directory slot to
710 710 name:
711 711
712 712
713 713 > 7:dir:nm="name"
714 714
715 715
716 716
717 717 Example 15 Getting and Filling Elements
718 718
719 719
720 720 The following command gets fragment 3c3 and fill 20 type elements with
721 721 0x20:
722 722
723 723
724 724 > 3c3:fragment,20:fill=0x20
725 725
726 726
727 727
728 728 Example 16 Setting the Contents of an Address
729 729
730 730
731 731 The following command sets the contents of address 2050 to 0xffffffff.
732 732 0xffffffff may be truncated depending on the current type:
733 733
734 734
735 735 > 2050=0xffff
736 736
737 737
738 738
739 739 Example 17 Placing ASCII
740 740
741 741
742 742 The following command places the ASCII for the string at 1c92434:
743 743
744 744
745 745 > 1c92434="this is some text"
746 746
747 747
748 748
749 749 Example 18 Displaying Shadow Inode Data
750 750
751 751
752 752 The following command displays all of the shadow inode data in the
753 753 shadow inode associated with the root inode of this file system:
754 754
755 755
756 756 > 2:ino:si:ino;0:shadow,*?S
757 757
758 758
759 759
760 760 SEE ALSO
761 761 clri(1M), fsck_ufs(1M), dir_ufs(4), attributes(5), ufs(7FS)
762 762
763 763 WARNINGS
764 764 Since fsdb reads the disk raw, extreme caution is advised in
765 765 determining its availability of fsdb on the system. Suggested
766 766 permissions are 600 and owned by bin.
767 767
768 768 NOTES
769 769 The old command line syntax for clearing i-nodes using the ufs-specific
770 770 '-z i-number' option is still supported by the new debugger, though it
771 771 is obsolete and will be removed in a future release. Use of this flag
772 772 will result in correct operation, but an error message will be printed
773 773 warning of the impending obsolesence of this option to the command. The
774 774 equivalent functionality is available using the more flexible clri(1M)
775 775 command.
776 776
777 777
778 778
779 779 April 14, 2003 FSDB_UFS(1M)
↓ open down ↓ |
324 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX