acfsdbg

Purpose

Debugs an Oracle ACFS file system.

Syntax and Description

acfsdbg -h
acfsdbg [-r] [-l] volume_device

Table 16-86 contains the options available with the acfsdbg command.


Table 16-86 Options for the acfsdbg command

Option Description

-h

Prints out the usage message which displays the various options that are available when invoking the acfsdbg command, then exits.

-r

Operates in read-only mode. No data is modified on the file system and all write commands are disabled. If the device is mounted anywhere, acfsdbg may not display the latest data because some data is cached by the file system mounts.

-l

Processes kernel log files. The default is to not process the log files.

volume_device

Specifies the device name of the volume.


acfsdbg is an extension to fsck and acfschkdsk, and is an interactive program that views and modifies on disk structures of the file system. This command is intended for experienced development and support engineers to examine on disk structures to diagnose problems. Use with caution.

When acfsdbg is started, it displays a command prompt. At the command prompt, you can enter the subcommands listed in Table 16-87.

You can also use acfsdbg for scripts by echoing acfsdbg subcommands with a shell pipe to the acfsdbg binary.

By default the file system is not modified when running the tool. If the -l option is used, the file system metadata in the transaction logs is applied before the interactive disk block dump session. The volume device must specify a volume with a dismounted Oracle ACFS file system. If the volume device has a mounted Oracle ACFS file system, acfsdbg displays an error message and exits.

You must be the administrator or a member of the Oracle ASM administrator group to run acfsdbg.

Subcommands

Table 16-87 lists the subcommands of acfsdbg.


Table 16-87 Subcommands for acfsdbg

Option Description Syntax

calculate

Calculates simple arithmetic expressions

Valid operators: + - * / % & | ^ ~ << >>

White space starts a new expression

0-1 represents a negative 1

calculate [-v] expr […]

  • -v Verbose mode
  • expr Simple 2+2 expression

cksum

Generates and replaces checksum in header

Header offset can be an expression as used by the calculate subcommand

White space starts a new header offset

Command is disabled in read-only mode

cksum [-C | -CE] header_offset […]

  • -C Regenerate for normal structure checksum
  • -CE Re-generate for Extent structure checksum
  • header_offset Offset of the on disk structure header. The value can be an expression as used by the calculate subcommand

close

Closes the open handle to the device

close

echo

Echoes text on command line to stdout

echo

fenum

Displays the specified File Entry TAble (FETA) entry

fenum [-f | -e | -d] FETA_entry_number

  • -f Displays all on disk structures related to this structure
  • -e Displays all on disk extent information related to this structure
  • -d Casts the structure as a directory and displays its contents
  • FETA_entry_number The File Entry Table number used to identify a file on the file system

help

Displays help message

help

offset

Displays structure at disk offset

offset [-c cast] [-f | -d] disk_offset

  • -f Displays all on disk structures related to this structure
  • -d Casts the structure as a directory and displays its contents
  • disk_offset Disk offset to display. The value can be an expression as used by the calculate subcommand

open

Opens a handle to a device. The default is the volume device name entered on the command line

open [volume_device]

primary

Sets the context of commands to the primary file system

primary

prompt

Sets the prompt to the specified string

prompt "prompt_string"

quit

Exits the acfsdbg debugger command

quit

read

Reads value from offset

The default size to read in is 8 bytes

The default count to read is 1

read [-1 | -2 | -4 | -8 | -s] [count] offset

  • -1 Read byte value
  • -2 Read 2 byte (short) value
  • -4 Read 4 byte (int) value
  • -8 Read 8 byte (long) value
  • -s Read null- terminated string
  • count Number of values to read. If not specified, the default is 1
  • offset Disk offset to read. The value can be an expression as used by the calculate subcommand

snapshot

Sets the context of commands to the specified snapshot

snapshot snapshot_name

write

Writes hexadecimal, octal, or decimal values at the disk offset, estimating how many bytes to write based on value size or number of digits in leading 0 hexadecimal values

The disk offset can be an expression used by the calculate subcommand

Numeric values can also be an expression as used by the calculate subcommand

This command is disabled in read-only mode

write [-1 | -2 | -4 | -8 | -c | -s] [-C | -CE] offset value

  • -1 Write byte value
  • -2 Write 2 byte (short) value
  • -4 Write 4 byte (int) value
  • -8 Write 8 byte (long) value
  • -c Write text (no null termination). Enclose string in single-quotes (')
  • -s Write null-terminated string. Enclose string in quotes (")
  • -C Regenerate normal structure checksum
  • -CE Regenerate extent structure checksum
  • offset Disk offset to write. The value can be an expression used by the calculate subcommand
  • value The value to write. If numeric, the value can be an expression as used by the calculate subcommand

Examples

Example 16-78 shows the use of the acfsdbg subcommand.

Example 16-78 Using the acfsdbg command

$ /sbin/acfsdbg /dev/asm/voume1-123
acfsdbg: version                   = 11.2.0.3.0
Oracle ASM Cluster File System (ACFS) On-Disk Structure Version: 39.0
The ACFS volume was created at  Mon Mar  2 14:57:45 2011
acfsdbg> 

acfsbdg> calculate 60*1024
    61,440
    61440
    61440
    0xf000
    0170000
    1111:0000:0000:0000

acfsdbg> prompt "acfsdbg test>"
acfsdbg test>

echo "offset 64*1024" | acfsdbg /dev/asm/volume1-123