JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 1M: System Administration Commands     Oracle Solaris 10 1/13 Information Library
search filter icon
search icon

Document Information

Preface

Introduction

System Administration Commands - Part 1

6to4relay(1M)

accept(1M)

acct(1M)

acctadm(1M)

acctcms(1M)

acctcon1(1M)

acctcon(1M)

acctcon2(1M)

acctdisk(1M)

acctdusg(1M)

acctmerg(1M)

accton(1M)

acctprc1(1M)

acctprc(1M)

acctprc2(1M)

acctsh(1M)

acctwtmp(1M)

adbgen(1M)

add_allocatable(1M)

addbadsec(1M)

add_drv(1M)

add_install_client(1M)

add_to_install_server(1M)

afbconfig(1M)

aliasadm(1M)

apache(1M)

arp(1M)

aset(1M)

aset.restore(1M)

atohexlabel(1M)

audit(1M)

auditconfig(1M)

auditd(1M)

auditreduce(1M)

audit_startup(1M)

auditstat(1M)

audit_warn(1M)

automount(1M)

automountd(1M)

autopush(1M)

bart(1M)

bdconfig(1M)

boot(1M)

bootadm(1M)

bootconfchk(1M)

bootparamd(1M)

bsmconv(1M)

bsmrecord(1M)

bsmunconv(1M)

busstat(1M)

cachefsd(1M)

cachefslog(1M)

cachefspack(1M)

cachefsstat(1M)

cachefswssize(1M)

captoinfo(1M)

catman(1M)

cfgadm(1M)

cfgadm_ac(1M)

cfgadm_cardbus(1M)

cfgadm_fp(1M)

cfgadm_ib(1M)

cfgadm_pci(1M)

cfgadm_sata(1M)

cfgadm_sbd(1M)

cfgadm_scsi(1M)

cfgadm_shp(1M)

cfgadm_sysctrl(1M)

cfgadm_usb(1M)

cfsadmin(1M)

chargefee(1M)

chat(1M)

check(1M)

check-hostname(1M)

check-permissions(1M)

chk_encodings(1M)

chroot(1M)

cimworkshop(1M)

ckpacct(1M)

clear_locks(1M)

clinfo(1M)

closewtmp(1M)

clri(1M)

comsat(1M)

configCCR(1M)

consadm(1m)

conv_lp(1M)

conv_lpd(1M)

coreadm(1M)

cpustat(1M)

cron(1M)

cryptoadm(1M)

cvcd(1M)

datadm(1M)

dcopy(1M)

dcs(1M)

dd(1M)

devattr(1M)

devfree(1M)

devfsadm(1M)

devfsadmd(1M)

device_remap(1M)

devinfo(1M)

devlinks(1M)

devnm(1M)

devreserv(1M)

df(1M)

dfmounts(1M)

dfmounts_nfs(1M)

dfshares(1M)

dfshares_nfs(1M)

df_ufs(1M)

dhcpagent(1M)

dhcpconfig(1M)

dhcpmgr(1M)

dhtadm(1M)

dig(1M)

directoryserver(1M)

diskinfo(1M)

disks(1M)

diskscan(1M)

dispadmin(1M)

dladm(1M)

dmesg(1M)

dmi_cmd(1M)

dmiget(1M)

dminfo(1M)

dmispd(1M)

dnssec-dsfromkey(1M)

dnssec-keyfromlabel(1M)

dnssec-keygen(1M)

dnssec-signzone(1M)

dodisk(1M)

domainname(1M)

drd(1M)

drvconfig(1M)

dsvclockd(1M)

dtrace(1M)

dumpadm(1M)

editmap(1M)

edquota(1M)

eeprom(1M)

efdaemon(1M)

embedded_su(1M)

emCCR(1M)

emocmrsp(1M)

etrn(1M)

fbconfig(1M)

fcinfo(1M)

fdetach(1M)

fdisk(1M)

ff(1M)

ffbconfig(1M)

ff_ufs(1M)

fingerd(1M)

fiocompress(1M)

flar(1M)

flarcreate(1M)

fmadm(1M)

fmd(1M)

fmdump(1M)

fmstat(1M)

fmthard(1M)

format(1M)

fpsd(1M)

fruadm(1M)

fsck(1M)

fsck_cachefs(1M)

fsck_pcfs(1M)

fsck_udfs(1M)

fsck_ufs(1M)

fsdb(1M)

fsdb_udfs(1M)

fsdb_ufs(1M)

fsirand(1M)

fssnap(1M)

fssnap_ufs(1M)

fsstat(1M)

fstyp(1M)

ftpaddhost(1M)

ftpconfig(1M)

ftpd(1M)

ftprestart(1M)

ftpshut(1M)

fuser(1M)

fwflash(1M)

fwtmp(1M)

getdev(1M)

getdevpolicy(1M)

getdgrp(1M)

getent(1M)

gettable(1M)

getty(1M)

getvol(1M)

GFXconfig(1M)

gkadmin(1M)

groupadd(1M)

groupdel(1M)

groupmod(1M)

growfs(1M)

grpck(1M)

gsscred(1M)

gssd(1M)

halt(1M)

hextoalabel(1M)

host(1M)

hostconfig(1M)

hotplug(1M)

hotplugd(1M)

htable(1M)

ickey(1M)

id(1M)

idsconfig(1M)

ifconfig(1M)

if_mpadm(1M)

ifparse(1M)

ikeadm(1M)

ikecert(1M)

ilomconfig(1M)

imqadmin(1M)

imqbrokerd(1M)

imqcmd(1M)

imqdbmgr(1M)

imqkeytool(1M)

imqobjmgr(1M)

imqusermgr(1M)

in.chargend(1M)

in.comsat(1M)

in.daytimed(1M)

in.dhcpd(1M)

in.discardd(1M)

in.echod(1M)

inetadm(1M)

inetconv(1M)

inetd(1M)

in.fingerd(1M)

infocmp(1M)

in.ftpd(1M)

in.iked(1M)

init(1M)

init.sma(1M)

init.wbem(1M)

inityp2l(1M)

in.lpd(1M)

in.mpathd(1M)

in.named(1M)

in.ndpd(1M)

in.rarpd(1M)

in.rdisc(1M)

in.rexecd(1M)

in.ripngd(1M)

in.rlogind(1M)

in.routed(1M)

in.rshd(1M)

in.rwhod(1M)

install(1M)

installboot(1M)

installer(1M)

installf(1M)

installgrub(1M)

install_scripts(1M)

install-solaris(1M)

in.stdiscover(1M)

in.stlisten(1M)

in.talkd(1M)

in.telnetd(1M)

in.tftpd(1M)

in.timed(1M)

in.tnamed(1M)

intrstat(1M)

in.uucpd(1M)

iostat(1M)

ipaddrsel(1M)

ipf(1M)

ipfs(1M)

ipfstat(1M)

ipmon(1M)

ipnat(1M)

ippool(1M)

ipqosconf(1M)

ipsecalgs(1M)

ipsecconf(1M)

ipseckey(1M)

iscsiadm(1M)

iscsitadm(1M)

iscsitgtd(1M)

itu(1M)

k5srvutil(1M)

kadb(1M)

kadmin(1M)

kadmind(1M)

kadmin.local(1M)

kcfd(1M)

kclient(1M)

kdb5_ldap_util(1M)

kdb5_util(1M)

kdmconfig(1M)

kernel(1M)

keyserv(1M)

killall(1M)

kmscfg(1M)

kprop(1M)

kpropd(1M)

kproplog(1M)

krb5kdc(1M)

ksslcfg(1M)

kstat(1M)

ktkt_warnd(1M)

labeld(1M)

labelit(1M)

labelit_hsfs(1M)

labelit_udfs(1M)

labelit_ufs(1M)

lastlogin(1M)

ldapaddent(1M)

ldap_cachemgr(1M)

ldapclient(1M)

ldmad(1M)

link(1M)

listdgrp(1M)

listen(1M)

llc2_loop(1M)

localeadm(1M)

localectr(1M)

locator(1M)

lockd(1M)

lockfs(1M)

lockstat(1M)

lofiadm(1M)

logadm(1M)

logins(1M)

lpadmin(1M)

lpfilter(1M)

lpforms(1M)

lpget(1M)

lpmove(1M)

lpsched(1M)

lpset(1M)

lpshut(1M)

lpsystem(1M)

lpusers(1M)

lu(1M)

luactivate(1M)

lucancel(1M)

lucompare(1M)

lucreate(1M)

lucurr(1M)

ludelete(1M)

ludesc(1M)

lufslist(1M)

lumake(1M)

lumount(1M)

lupc(1M)

lurename(1M)

lustatus(1M)

luumount(1M)

luupgrade(1M)

luxadm(1M)

m64config(1M)

mail.local(1M)

makedbm(1M)

makemap(1M)

makeuuid(1M)

masfcnv(1M)

mdlogd(1M)

mdmonitord(1M)

medstat(1M)

metaclear(1M)

metadb(1M)

metadetach(1M)

metadevadm(1M)

System Administration Commands - Part 2

System Administration Commands - Part 3

fsdb_ufs

- ufs file system debugger

Synopsis

fsdb -F ufs [generic_options] [specific_options] special

Description

The fsdb_ufs command is an interactive tool that can be used to patch up a damaged UFS file system. 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.

fsdb contains several error-checking routines to verify inode and block addresses. These can be disabled if necessary by invoking fsdb with the -o option or by the use of the o command.

fsdb reads a block at a time and will therefore work with raw as well as block I/O devices. A buffer management routine is used to retain commonly used blocks of data in order to reduce the number of read system calls. All assignment operations result in an immediate write-through of the corresponding block. Note that in order to modify any portion of the disk, fsdb must be invoked with the w option.

Wherever possible, adb-like syntax was adopted to promote the use of fsdb through familiarity.

Options

The following option is supported:

-o

Specify UFS file system specific options. These options can be any combination of the following separated by commas (with no intervening spaces). The options available are:

?

Display usage

o

Override some error conditions

p='string'

set prompt to string

w

open for write

Usage

Numbers are considered hexadecimal by default. However, the user has control over how data is to be displayed or accepted. The base command will display or set the input/output base. Once set, all input will default to this base and all output will be shown in this base. The base can be overridden temporarily for input by preceding hexadecimal numbers with '0x', preceding decimal numbers with '0t', or octal numbers with '0'. Hexadecimal numbers beginning with a-f or A-F must be preceded with '0x' to distinguish them from commands.

Disk addressing by fsdb is at the byte level. However, fsdb offers many commands to convert a desired inode, directory entry, block, superblock and so forth to a byte address. Once the address has been calculated, fsdb will record the result in dot (.).

Several global values are maintained by fsdb:

Most commands use the preset value of dot in their execution. For example,

> 2:inode

will first set the value of dot to 2, ':', will alert the start of a command, and the inode command will set inode to 2. A count is specified after a ','. Once set, count will remain at this value until a new command is encountered which will then reset the value back to 1 (the default). So, if

> 2000,400/X

is typed, 400 hex longs are listed from 2000, and when completed, the value of dot will be 2000 + 400 * sizeof (long). If a RETURN is then typed, the output routine will use the current values of dot, count, and type and display 400 more hex longs. A '*' will cause the entire block to be displayed.

End of fragment, block and file are maintained by fsdb. When displaying data as fragments or blocks, an error message will be displayed when the end of fragment or block is reached. When displaying data using the db, ib, directory, or file commands an error message is displayed if the end of file is reached. This is mainly needed to avoid passing the end of a directory or file and getting unknown and unwanted results.

An example showing several commands and the use of RETURN would be:

> 2:ino; 0:dir?d
      or
> 2:ino; 0:db:block?d

The two examples are synonymous for getting to the first directory entry of the root of the file system. Once there, any subsequent RETURN (or +, -) will advance to subsequent entries. Note that

> 2:inode; :ls
      or
> :ls /

is again synonymous.

Expressions

The symbols recognized by fsdb are:

RETURN

update the value of dot by the current value of type and display using the current value of count.

#

numeric expressions may be composed of +, -, *, and % operators (evaluated left to right) and may use parentheses. Once evaluated, the value of dot is updated.

, count

count indicator. The global value of count will be updated to count. The value of count will remain until a new command is run. A count specifier of '*' will attempt to show a blocks's worth of information. The default for count is 1.

? f

display in structured style with format specifier f. See FormattedOutput.

/ f

display in unstructured style with format specifier f See FormattedOutput.

.

the value of dot.

+e

increment the value of dot by the expression e. The amount actually incremented is dependent on the size of type:

dot = dot + e * sizeof (type)

The default for e is 1.

-e

decrement the value of dot by the expression e. See +.

*e

multiply the value of dot by the expression e. Multiplication and division don't use type. In the above calculation of dot, consider the sizeof(type) to be 1.

%e

divide the value of dot by the expression e. See *.

< name

restore an address saved in register name. name must be a single letter or digit.

> name

save an address in register name. name must be a single letter or digit.

= f

display indicator. If f is a legitimate format specifier. then the value of dot is displayed using the format specifier f. See FormattedOutput. Otherwise, assignment is assumed See =.

= [s] [e]

assignment indicator. The address pointed to by dot has its contents changed to the value of the expression e or to the ASCII representation of the quoted (") string s. This may be useful for changing directory names or ASCII file information.

=+ e

incremental assignment. The address pointed to by dot has its contents incremented by expression e.

=- e

decremental assignment. The address pointed to by dot has its contents decremented by expression e.

Commands

A command must be prefixed by a ':' character. Only enough letters of the command to uniquely distinguish it are needed. Multiple commands may be entered on one line by separating them by a SPACE, TAB or ';'.

In order to view a potentially unmounted disk in a reasonable manner, fsdb offers the cd, pwd, ls and find commands. The functionality of these commands substantially matches those of its UNIX counterparts. See individual commands for details. The '*', '?', and '[-]' wild card characters are available.

base=b

display or set base. As stated above, all input and output is governed by the current base. If the =b is omitted, the current base is displayed. Otherwise, the current base is set to b. Note that this is interpreted using the old value of base, so to ensure correctness use the '0', '0t', or '0x' prefix when changing the base. The default for base is hexadecimal.

block

convert the value of dot to a block address.

cd dir

change the current directory to directory dir. The current values of inode and dot are also updated. If no dir is specified, then change directories to inode 2 ("/").

cg

convert the value of dot to a cylinder group.

directory

If the current inode is a directory, then the value of dot is converted to a directory slot offset in that directory and dot now points to this entry.

file

the value of dot is taken as a relative block count from the beginning of the file. The value of dot is updated to the first byte of this block.

find dir [ -name n] [-inum i]

find files by name or i-number. find recursively searches directory dir and below for filenames whose i-number matches i or whose name matches pattern n. Note that only one of the two options (-name or -inum) may be used at one time. Also, the -print is not needed or accepted.

fill=p

fill an area of disk with pattern p. The area of disk is delimited by dot and count.

fragment

convert the value of dot to a fragment address. The only difference between the fragment command and the block command is the amount that is able to be displayed.

inode

convert the value of dot to an inode address. If successful, the current value of inode will be updated as well as the value of dot. As a convenient shorthand, if ':inode' appears at the beginning of the line, the value of dot is set to the current inode and that inode is displayed in inode format.

log_chk

run through the valid log entries without printing any information and verify the layout.

log_delta

count the number of deltas into the log, using the value of dot as an offset into the log. No checking is done to make sure that offset is within the head/tail offsets.

log_head

display the header information about the file system logging. This shows the block allocation for the log and the data structures on the disk.

log_otodb

return the physical disk block number, using the value of dot as an offset into the log.

log_show

display all deltas between the beginning of the log (BOL) and the end of the log (EOL).

ls

[ -R ] [ -l ] pat1 pat2 . . . list directories or files. If no file is specified, the current directory is assumed. Either or both of the options may be used (but, if used, must be specified before the filename specifiers). Also, as stated above, wild card characters are available and multiple arguments may be given. The long listing shows only the i-number and the name; use the inode command with '?i' to get more information.

override

toggle the value of override. Some error conditions may be overriden if override is toggled on.

prompt p

change the fsdb prompt to p. p must be surrounded by (")s.

pwd

display the current working directory.

quit

quit fsdb.

sb

the value of dot is taken as a cylinder group number and then converted to the address of the superblock in that cylinder group. As a shorthand, ':sb' at the beginning of a line will set the value of dot to the superblock and display it in superblock format.

shadow

if the current inode is a shadow inode, then the value of dot is set to the beginning of the shadow inode data.

!

escape to shell

Inode Commands

In addition to the above commands, there are several commands that deal with inode fields and operate directly on the current inode (they still require the ':'). They may be used to more easily display or change the particular fields. The value of dot is only used by the ':db' and ':ib' commands. Upon completion of the command, the value of dot is changed to point to that particular field. For example,

> :ln=+1

would increment the link count of the current inode and set the value of dot to the address of the link count field.

at

access time.

bs

block size.

ct

creation time.

db

use the current value of dot as a direct block index, where direct blocks number from 0 - 11. In order to display the block itself, you need to 'pipe' this result into the block or fragment command. For example,

 > 1:db:block,20/X

would get the contents of data block field 1 from the inode and convert it to a block address. 20 longs are then displayed in hexadecimal. See FormattedOutput.

gid

group id.

ib

use the current value of dot as an indirect block index where indirect blocks number from 0 - 2. This will only get the indirect block itself (the block containing the pointers to the actual blocks). Use the file command and start at block 12 to get to the actual blocks.

ln

link count.

mt

modification time.

md

mode.

maj

major device number.

min

minor device number.

nm

although listed here, this command actually operates on the directory name field. Once poised at the desired directory entry (using the directory command), this command will allow you to change or display the directory name. For example,

> 7:dir:nm="foo"

will get the 7th directory entry of the current inode and change its name to foo. Note that names cannot be made larger than the field is set up for. If an attempt is made, the string is truncated to fit and a warning message to this effect is displayed.

si

shadow inode.

sz

file size.

uid

user id.

Formatted Output

There are two styles and many format types. The two styles are structured and unstructured. Structured output is used to display inodes, directories, superblocks and the like. Unstructured displays raw data. The following shows the different ways of displaying:

?
c

display as cylinder groups

i

display as inodes

d

display as directories

s

display as superblocks

S

display as shadow inode data

/
b

display as bytes

c

display as characters

o O

display as octal shorts or longs

d D

display as decimal shorts or longs

x X

display as hexadecimal shorts or longs

The format specifier immediately follows the '/' or '?' character. The values displayed by '/b' and all '?' formats are displayed in the current base. Also, type is appropriately updated upon completion.

Examples

Example 1 Displaying in Decimal

The following command displays 2010 in decimal (use of fsdb as a calculator for complex arithmetic):

> 2000+400%(20+20)=D

Example 2 Displaying an i-number in Inode Format

The following command displays i-number 386 in an inode format. This now becomes the current inode:

> 386:ino?i

Example 3 Changing the Link Count

The following command changes the link count for the current inode to 4:

> :ln=4

Example 4 Incrementing the Link Count

The following command increments the link count by 1:

> :ln=+1

Example 5 Displaying the Creation Time

The following command displays the creation time as a hexadecimal long:

> :ct=X

Example 6 Displaying the Modification Time

The following command displays the modification time in time format:

> :mt=t

Example 7 Displaying in ASCII

The following command displays in ASCII, block zero of the file associated with the current inode:

> 0:file/c

Example 8 Displaying the First Block's Worth of Directorty Entries

The following command displays the first block's worth of directory entries for the root inode of this file system. It will stop prematurely if the EOF is reached:

> 2:ino,*?d

Example 9 Displaying Changes to the Current Inode

The following command displays changes the current inode to that associated with the 5th directory entry (numbered from zero) of the current inode. The first logical block of the file is then displayed in ASCII:

> 5:dir:inode; 0:file,*/c

Example 10 Displaying the Superblock

The following command displays the superblock of this file system:

> :sb

Example 11 Displaying the Cylinder Group

The following command displays cylinder group information and summary for cylinder group 1:

> 1:cg?c

Example 12 Changing the i-number

The following command changes the i-number for the seventh directory slot in the root directory to 3:

> 2:inode; 7:dir=3

Example 13 Displaying as Directory Entries

The following command displays the third block of the current inode as directory entries:

> 2:db:block,*?d

Example 14 Changing the Name Field

The following command changes the name field in the directory slot to name:

> 7:dir:nm="name"

Example 15 Getting and Filling Elements

The following command gets fragment 3c3 and fill 20 type elements with 0x20:

> 3c3:fragment,20:fill=0x20

Example 16 Setting the Contents of an Address

The following command sets the contents of address 2050 to 0xffffffff. 0xffffffff may be truncated depending on the current type:

> 2050=0xffff

Example 17 Placing ASCII

The following command places the ASCII for the string at 1c92434:

> 1c92434="this is some text"

Example 18 Displaying Shadow Inode Data

The following command displays all of the shadow inode data in the shadow inode associated with the root inode of this file system:

> 2:ino:si:ino;0:shadow,*?S

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
SUNWcsu

See Also

clri(1M), fsck_ufs(1M), dir_ufs(4), attributes(5), ufs(7FS)

Warnings

Since fsdb reads the disk raw, extreme caution is advised in determining its availability of fsdb on the system. Suggested permissions are 600 and owned by bin.

Notes

The old command line syntax for clearing i-nodes using the ufs-specific '-z i-number' option is still supported by the new debugger, though it is obsolete and will be removed in a future release. Use of this flag will result in correct operation, but an error message will be printed warning of the impending obsolesence of this option to the command. The equivalent functionality is available using the more flexible clri(1M) command.