Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fsck(8)

dir(4)

fs(4)



  fsdb(8)                             CLIX                             fsdb(8)



  NAME

    fsdb - Runs a file system debugger

  SYNOPSIS

    /etc/fsdb special [-]

  FLAGS

    -   Turns off the verification mode.

  DESCRIPTION

    The fsdb command is used to debug a damaged file system, and can be used
    to patch up a damaged file system after a crash.  It has conversions to
    translate block and i-numbers into their corresponding disk addresses.
    Also included are mnemonic offsets to access different parts of an inode.
    These greatly simplify the process of correcting control block entries or
    descending the file system tree.

    The fsdb command contains several error-checking functions to verify inode
    and block addresses.  These can be disabled if necessary by invoking the
    fsdb command with the optional - argument or by the use of the O symbol.
    The fsdb command reads the isize and fsize entries from the superblock of
    the file system as the basis for these checks.

    Numbers are considered decimal by default.  Octal numbers must be prefixed
    with a zero.  During any assignment operation, numbers are checked for a
    possible truncation error due to a size mismatch between source and
    destination.

    The fsdb reads a block at a time and will therefore work with raw as well
    as block input/output (I/O).  A buffer management function is used to
    retain commonly used blocks of data in order to reduce the number of read
    functions.  All assignment operations result in an immediate write-through
    of the corresponding block.

    The symbols recognized by the fsdb command are:

    #       Absolute address

    i       Convert from i-number to inode address

    b       Convert to block address

    d       Directory slot offset

    + , -   Address arithmetic

    q       Quit



  2/94 - Intergraph Corporation                                              1






  fsdb(8)                             CLIX                             fsdb(8)



    > , <   Save, restore an address

    =       Numerical assignment

    =+      Incremental assignment

    =-      Decremental assignment
    =       Character string assignment

    O       Error checking flip flop

    p       General print facilities

    f       File print facility

    B       Byte mode

    W       Word mode

    D       Double word mode

    !       Escape to shell

    The print facilities generate a formatted output in various styles.  The
    current address is normalized to an appropriate boundary before printing
    begins.  It advances with the printing and is left at the address of the
    last item printed.  The output can be terminated at any time by typing the
    delete character.  If a number follows the p symbol, that many entries are
    printed.  A check is made to detect block boundary overflows since
    logically sequential blocks are generally not physically sequential.  If a
    count of zero is used, all entries to the end of the current block are
    printed.  The print options available are:

    i   Print as inodes

    d   Print as directories

    o   Print as octal words

    e   Print as decimal words

    c   Print as characters

    b   Print as octal bytes

    The f symbol is used to print data blocks associated with the current
    inode.  If followed by a number, that block of the file is printed.
    (Blocks are numbered from zero.)  The desired print option letter follows
    the block number, if present, or the f symbol.  This print facility works
    for small as well as large files.  It checks for special devices and that
    the block pointers used to find the data are not zero.



  2                                              Intergraph Corporation - 2/94






  fsdb(8)                             CLIX                             fsdb(8)



    Dots, tabs, and spaces may be used as function delimiters, but are not
    necessary.  A line with just a newline character will increment the
    current address by the size of the data type last printed.  That is, the
    address is set to the next byte, word, double word, directory entry or
    inode, allowing the user to step through a region of a file system.
    Information is printed in a format appropriate to the data type.  Bytes,
    words and double words are displayed with the octal address followed by
    the value in octal and decimal.  A ``.B'' or ``.D'' is appended to the
    address for byte and double word values, respectively.  Directories are
    printed as a directory slot offset followed by the decimal i-number and
    the character representation of the entry name.  Inodes are printed with
    labeled fields describing each element.

    The following mnemonics are used for inode examination and refer to the
    current working inode:

    md    Mode

    ln    Link count

    uid   User number

    gid   Group number

    sz    File size

    a#    Data block numbers (0 - 12)

    at    Access time

    mt    Modification time

    maj   Major device number

    min   Minor device number

  EXAMPLES

    1.  To print i-number 386 in an inode format, making this the current
        working inode:

        386i


    2.  To change the link count for the working inode to 4:

        ln=4


    3.  To increment the link count by 1:




  2/94 - Intergraph Corporation                                              3






  fsdb(8)                             CLIX                             fsdb(8)



        ln=+1


    4.  To print, in ASCII, block zero of the file associated with the working
        inode:

        fc


    5.  To print the first 32 directory entries for the root inode of this
        file system:

        2i.fd


    6.  To change the current inode to that associated with the 5th directory
        entry (numbered from zero) found from the above command and print the
        first logical block of the file in ASCII:

        d5i.fc


    7.  To print the superblock of this file system in octal:

        512B.p0o


    8.  To change the i-number for the seventh directory slot in the root
        directory to 3, combining several operations on one command line:

        2i.a0b.d7=3


    9.  To change the name field in the directory slot to the given string:

        d7.nm=``name''

        Quotes are optional when used with nm if the first character is
        alphabetic.

    10. To print the third block of the current inode as directory entries.

        a2b.p0d


  FILES

    /dev/dsk/*

  NOTES




  4                                              Intergraph Corporation - 2/94






  fsdb(8)                             CLIX                             fsdb(8)



    The fsdb command will not work with fast file systems.

  DIAGNOSTICS

    device: Invalid File System Type
           The file system is not a regular System V file system.

  EXIT VALUES

    The fsb command exits with a value of 1 if a fatal error occurred.
    Otherwise, this command will exit with a value of 0.

  RELATED INFORMATION

    Commands:  fsck(8)

    Files:  dir(4), fs(4)





































  2/94 - Intergraph Corporation                                              5




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026