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_udfs.1m.man.txt
+++ new/usr/src/man/man1m/fsdb_udfs.1m.man.txt
1 1 FSDB_UDFS(1M) Maintenance Commands FSDB_UDFS(1M)
2 2
3 3
4 4
5 5 NAME
6 6 fsdb_udfs - udfs file system debugger
7 7
8 8 SYNOPSIS
9 9 fsdb [-F] udfs [generic_option] [-o specific_option] special
10 10
11 11
12 12 DESCRIPTION
13 13 The fsdb_udfs command is an interactive tool that can be used to patch
14 14 up a damaged udfs file system. fsdb_udfs has conversions to translate
15 15 block and i-numbers into their corresponding disk addresses. Mnemonic
16 16 offsets to access different parts of an inode are also included.
17 17 Mnemonic offsets greatly simplify the process of correcting control
18 18 block entries or descending 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 using the o command.
24 24
25 25
26 26 fsdb reads one block at a time, and therefore works with raw as well as
27 27 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. In order to modify any portion of
31 31 the disk, fsdb must be invoked with the -w option.
32 32
33 33
34 34 Wherever possible, adb-like syntax has been adopted to promote the use
35 35 of fsdb through familiarity.
36 36
37 37 OPTIONS
38 38 The following options are supported:
39 39
40 40 -o specific_option
41 41 Specify udfs file system specific options in a
42 42 comma-separated list with no intervening spaces.
43 43 The following specific options are supported:
44 44
45 45 o
46 46 Override some error conditions.
47 47
48 48
49 49 p=string
50 50 Set prompt to string.
51 51
52 52
53 53 w
54 54 Open for write.
55 55
↓ open down ↓ |
55 lines elided |
↑ open up ↑ |
56 56
57 57 ?
58 58 Display usage.
59 59
60 60
61 61
62 62 USAGE
63 63 Numbers are considered hexadecimal by default. The user has control
64 64 over how data is to be displayed or accepted. The base command displays
65 65 or sets the input and output base. Once set, all input defaults to this
66 - base and all output displays in this base. The base can be overriden
66 + base and all output displays in this base. The base can be overridden
67 67 temporarily for input by preceding hexadecimal numbers by 0x, preceding
68 68 decimal numbers with a 0t, or octal numbers with a 0. Hexadecimal
69 - numbers beginning with a-f or A -F must be preceded with a 0x to
69 + numbers beginning with a-f or A-F must be preceded with a 0x to
70 70 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, and so
75 75 forth, to a byte address. After the address has been calculated, fsdb
76 76 records the result in the current address (dot).
77 77
78 78
79 79 Several global values are maintained by fsdb:
80 80
81 81 o Current base (referred to as base)
82 82
83 83 o Current address (referred to as dot)
84 84
85 85 o Current inode (referred to as inode)
86 86
87 87 o Current count (referred to as count)
88 88
89 89 o 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 > 2:inode
96 96
97 97
98 98
99 99
100 100 first sets the value of dot (.) to 2, colon (:), signifies the start of
101 101 a command, and the inode command sets inode to 2. A count is specified
102 102 after a comma (,). Once set, count remains at this value until a new
103 103 command is encountered that resets the value back to 1 (the default).
104 104
105 105
106 106 So, if
107 107
108 108 > 2000,400/X
109 109
110 110
111 111
112 112
113 113 is entered, 400 hex longs are listed from 2000, and when completed, the
114 114 value of dot is 2000 + 400 * sizeof (long). If a RETURN is then
115 115 entered, the output routine uses the current values of dot, count, and
116 116 type and displays 400 more hex longs. An asterisk (*) causes the entire
117 117 block to be displayed. An example showing several commands and the use
118 118 of RETURN would be:
119 119
120 120 > 2:ino; 0:dir?d
121 121
122 122
123 123
124 124
125 125 or
126 126
127 127 > 2:ino; 0:db:block?d
128 128
129 129
130 130
131 131
132 132 The two examples are synonymous for getting to the first directory
133 133 entry of the root of the file system. Once there, subsequently entering
134 134 a RETURN, plus (+), or minus (-) advances to subsequent entries.
135 135 Notice that
136 136
137 137 > 2:inode; :ls
138 138
139 139
140 140
141 141
142 142 or
143 143
144 144 > :ls /
145 145
146 146
147 147
148 148
149 149 is again synonymous.
150 150
151 151 Expressions
152 152 The following symbols are recognized by fsdb:
153 153
154 154 RETURN
155 155 Update the value of dot by the current value of type and
156 156 display using the current value of count.
157 157
158 158
159 159 #
160 160 Update the value of dot by specifying a numeric
161 161 expression. Specify numeric expressions using addition,
162 162 subtraction, multiplication, and division operators ( +,
163 163 -, *, and %). Numeric expressions are evaluated from left
164 164 to right and can use parentheses. After evaluation, the
165 165 value of dot is updated.
166 166
167 167
168 168 , count
169 169 Update the count indicator. The global value of count is
170 170 updated to count. The value of count remains until a new
171 171 command is run. A count specifier of * attempts to show a
172 172 blocks's worth of information. The default for count is 1.
173 173
174 174
175 175 ? f
176 176 Display in structured style with format specifier f. See
177 177 Formatted Output.
178 178
179 179
180 180 / f
181 181 Display in unstructured style with format specifier f. See
182 182 Formatted Output.
183 183
184 184
185 185 .
186 186 Display the value of dot.
187 187
188 188
189 189 +e
190 190 Increment the value of dot by the expression e. The amount
191 191 actually incremented is dependent on the size of type: dot
192 192 = dot + e * sizeof (type) The default for e is 1.
193 193
194 194
195 195 -e
196 196 Decrement the value of dot by the expression e . See +.
197 197
198 198
199 199 *e
200 200 Multiply the value of dot by the expression e.
201 201 Multiplication and division don't use type. In the above
202 202 calculation of dot, consider the sizeof (type) to be 1.
203 203
204 204
205 205 %e
206 206 Divide the value of dot by the expression e. See *.
207 207
208 208
209 209 < name
210 210 Restore an address saved in register name. name must be a
211 211 single letter or digit.
212 212
213 213
214 214 > name
215 215 Save an address in register name. name must be a single
216 216 letter or digit.
217 217
218 218
219 219 = f
220 220 Display indicator. If f is a legitimate format specifier
221 221 (see Formatted Output), then the value of dot is displayed
222 222 using format specifier f. Otherwise, assignment is
223 223 assumed. See = [s] [e].
224 224
225 225
226 226 = [s] [e]
227 227 Change the value of dot using an assignment indicator. The
228 228 address pointed to by dot has its contents changed to the
229 229 value of the expression e or to the ASCII representation
230 230 of the quoted (") string s. This can be useful for
231 231 changing directory names or ASCII file information.
232 232
233 233
234 234 =+ e
235 235 Change the value of dot using an incremental assignment.
236 236 The address pointed to by dot has its contents incremented
237 237 by expression e.
238 238
239 239
240 240 =- e
241 241 Change the value of dot using a decremental assignment.
242 242 Decrement the contents of the address pointed to by dot by
243 243 expression e.
244 244
245 245
246 246 Commands
247 247 A command must be prefixed by a colon (:). Only enough letters of the
248 248 command to uniquely distinguish it are needed. Multiple commands can be
249 249 entered on one line by separating them by a SPACE, TAB, or semicolon
250 250 (;).
251 251
252 252
253 253 To view a potentially unmounted disk in a reasonable manner, fsdb
254 254 supports the cd, pwd, ls, and find commands. The functionality of each
255 255 of these commands basically matches that of its UNIX counterpart. See
256 256 cd(1), pwd(1), ls(1), and find(1) for details. The *, ,, ?, and -
257 257 wildcard characters are also supported.
258 258
259 259
260 260 The following commands are supported:
261 261
262 262 base[=b]
263 263
264 264 Display or set the base. All input and output is governed by the
265 265 current base. Without the = b, displays the current base.
266 266 Otherwise, sets the current base to b. Base is interpreted using
267 267 the old value of base, so to ensure correctness use the 0, 0t, or
268 268 0x prefix when changing the base. The default for base is
269 269 hexadecimal.
270 270
271 271
272 272 block
273 273
274 274 Convert the value of dot to a block address.
275 275
276 276
277 277 cd [dir]
278 278
279 279 Change the current directory to directory dir. The current values
280 280 of inode and dot are also updated. If dir is not specified, changes
281 281 directories to inode 2, root (/).
282 282
283 283
284 284 directory
285 285
286 286 If the current inode is a directory, converts the value of dot to a
287 287 directory slot offset in that directory, and dot now points to this
288 288 entry.
289 289
290 290
291 291 file
292 292
293 293 Set the value of dot as a relative block count from the beginning
294 294 of the file. The value of dot is updated to the first byte of
295 295 this block.
296 296
297 297
298 298 find dir [-name n] | [-inum i]
299 299
300 300 Find files by name or i-number. Recursively searches directory dir
301 301 and below for file names whose i-number matches i or whose name
302 302 matches pattern n. Only one of the two options (-name or -inum) can
303 303 be used at one time. The find -print is not necessary or accepted.
304 304
305 305
306 306 fill=p
307 307
308 308 Fill an area of disk with pattern p. The area of disk is delimited
309 309 by dot and count.
310 310
311 311
312 312 inode
313 313
314 314 Convert the value of dot to an inode address. If successful, the
315 315 current value of inode is updated as well as the value of dot. As a
316 316 convenient shorthand, if :inode appears at the beginning of the
317 317 line, the value of dot is set to the current inode and that inode
318 318 is displayed in inode format.
319 319
320 320
321 321 ls [ -R ] [-l ] pat1 pat2...
322 322
323 323 List directories or files. If no file is specified, the current
324 324 directory is assumed. Either or both of the options can be used
325 325 (but, if used, must be specified before the filename specifiers).
326 326 Wild card characters are available and multiple arguments are
327 327 acceptable. The long listing shows only the i-number and the name;
328 328 use the inode command with ?i to get more information.
329 329
330 330
331 331 override
332 332
333 333 Toggle the value of override. Some error conditions might be
334 334 overridden if override is toggled to on.
335 335
336 336
337 337 prompt "p"
338 338
339 339 Change the fsdb prompt to p. p must be enclosed in quotes.
340 340
341 341
342 342 pwd
343 343
344 344 Display the current working directory.
345 345
346 346
347 347 quit
348 348
349 349 Quit fsdb.
350 350
351 351
352 352 tag
353 353
354 354 Convert the value of dot and if this is a valid tag, print the
355 355 volume structure according to the tag.
356 356
357 357
358 358 !
359 359
360 360 Escape to the shell.
361 361
362 362
363 363 Inode Commands
364 364 In addition to the above commands, several other commands deal with
365 365 inode fields and operate directly on the current inode (they still
366 366 require the colon (:). They can be used to more easily display or
367 367 change the particular fields. The value of dot is only used by the :db
368 368 and :ib commands. Upon completion of the command, the value of dot is
369 369 changed so that it points to that particular field. For example,
370 370
371 371 > :ln=+1
372 372
373 373
374 374
375 375
376 376 increments the link count of the current inode and sets the value of
377 377 dot to the address of the link count field.
378 378
379 379
380 380 The following inode commands are supported:
381 381
382 382 at
383 383 Access time
384 384
385 385
386 386 bs
387 387 Block size
388 388
389 389
390 390 ct
391 391 Creation time
392 392
393 393
394 394 gid
395 395 Group id
396 396
397 397
398 398 ln
399 399 Link number
400 400
401 401
402 402 mt
403 403 Modification time
404 404
405 405
406 406 md
407 407 Mode
408 408
409 409
410 410 maj
411 411 Major device number
412 412
413 413
414 414 min
415 415 Minor device number
416 416
417 417
418 418 nm
419 419 This command actually operates on the directory name field.
420 420 Once poised at the desired directory entry (using the
421 421 directory command), this command allows you to change or
422 422 display the directory name. For example,
423 423
424 424 > 7:dir:nm="foo"
425 425
426 426
427 427 gets the 7th directory entry of the current inode and changes
428 428 its name to foo. Directory names cannot be made larger than the
429 429 field allows. If an attempt is made to make a directory name
430 430 larger than the field allows,, the string is truncated to fit
431 431 and a warning message is displayed.
432 432
433 433
434 434 sz
435 435 File size
436 436
437 437
438 438 uid
439 439 User ID
440 440
441 441
442 442 uniq
443 443 Unique ID
444 444
445 445
446 446 Formatted Output
447 447 Formatted output comes in two styles and many format types. The two
448 448 styles of formatted output are: structured and unstructured. Structured
449 449 output is used to display inodes, directories, and so forth.
450 450 Unstructured output displays raw data.
451 451
452 452
453 453 Format specifiers are preceded by the slash (/) or question mark (?)
454 454 character. type is updated as necessary upon completion.
455 455
456 456
457 457 The following format specifiers are preceded by the ? character:
458 458
459 459 i
460 460 Display as inodes in the current base.
461 461
462 462
463 463 d
464 464 Display as directories in the current base.
465 465
466 466
467 467
468 468 The following format specifiers are preceded by the / character:
469 469
470 470 b
471 471 Display as bytes in the current base.
472 472
473 473
474 474 c
475 475 Display as characters.
476 476
477 477
478 478 o | O
479 479 Display as octal shorts or longs.
480 480
481 481
482 482 d | D
483 483 Display as decimal shorts or longs.
484 484
485 485
486 486 x | X
487 487 Display as hexadecimal shorts or longs.
488 488
489 489
490 490 EXAMPLES
491 491 Example 1 Using fsdb as a calculator for complex arithmetic
↓ open down ↓ |
412 lines elided |
↑ open up ↑ |
492 492
493 493
494 494 The following command displays 2010 in decimal format, and is an
495 495 example of using fsdb as a calculator for complex arithmetic.
496 496
497 497
498 498 > 2000+400%(20+20)=D
499 499
500 500
501 501
502 - Example 2 Using fsdb to display an i-number in idode fomat
502 + Example 2 Using fsdb to display an i-number in inode fomat
503 503
504 504
505 505 The following command displays the i-number 386 in inode format.386
506 506 becomes the current inode.
507 507
508 508
509 509 > 386:ino?i
510 510
511 511
512 512
513 513 Example 3 Using fsdb to change the link count
514 514
515 515
516 516 The following command changes the link count for the current inode to
517 517 4.
518 518
519 519
520 520 > :ln=4
521 521
522 522
523 523
524 524 Example 4 Using fsdb to increment the link count
525 525
526 526
527 527 The following command increments the link count by 1.
528 528
529 529
530 530 > :ln=+1
531 531
532 532
533 533
534 534 Example 5 Using fsdb to display the creation time as a hexadecimal long
535 535
536 536
537 537 The following command displays the creation time as a hexadecimal long.
538 538
539 539
540 540 > :ct=X
541 541
542 542
543 543
544 544 Example 6 Using fsdb to display the modification time in time format
545 545
546 546
547 547 The following command displays the modification time in time format.
548 548
549 549
550 550 > :mt=t
551 551
552 552
553 553
554 554 Example 7 Using fsdb to display in ASCII
555 555
556 556
557 557 The following command displays, in ASCII, block 0 of the file
558 558 associated with the current inode.
559 559
560 560
561 561 > 0:file/c
562 562
563 563
564 564
565 565 Example 8 Using fsdb to display the directory enteries for the root
566 566 inode
567 567
568 568
569 569 The following command displays the first block's directory entries for
570 570 the root inode of this file system. This command stops prematurely if
571 571 the EOF is reached.
572 572
573 573
574 574 > 2:ino,*?d
575 575
576 576
577 577
578 578 Example 9 Using fsdb to change the current inode
579 579
580 580
581 581 The following command changes the current inode to that associated
582 582 with the 5th directory entry (numbered from 0) of the current inode.
583 583 The first logical block of the file is then displayed in ASCII.
584 584
585 585
586 586 > 5:dir:inode; 0:file,*/c
587 587
588 588
589 589
590 590 Example 10 Using fsdb to change the i-number
591 591
592 592
593 593 The following command changes the i-number for the 7th directory slot
594 594 in the root directory to 3.
595 595
596 596
597 597 > 2:inode; 7:dir=3
598 598
599 599
600 600
601 601 Example 11 Using fsdb to change the name field
602 602
603 603
604 604 The following command changes the name field in the directory slot to
605 605 name.
606 606
607 607
608 608 > 7:dir:nm="name"
609 609
610 610
611 611
612 612 Example 12 Using fsdb to display the a block
613 613
614 614
615 615 The following command displays the 3rd block of the current inode as
616 616 directory entries.
617 617
618 618
619 619 Example 13 Using fsdb to set the contents of address
620 620
621 621
622 622 The following command sets the contents of address 2050 to 0xffffffff.
623 623 0xffffffff can be truncated, depending on the current type.
624 624
625 625
626 626 > 2050=0xffff
627 627
628 628
629 629
630 630 Example 14 Using fsdb to place an ASCII string at an address
631 631
632 632
633 633 The following command places the ASCII string this is some text at
634 634 address 1c92434.
635 635
636 636
637 637 > 1c92434="this is some text"
638 638
639 639
640 640
641 641 SEE ALSO
642 642 clri(1M), fsck_udfs(1M), dir(4), attributes(5)
643 643
644 644
645 645
646 646 November 26, 2017 FSDB_UDFS(1M)
↓ open down ↓ |
134 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX