[ Team LiB ] Previous Section Next Section

File System Administrative Commands

This section lists the file system administrative commands and describes the syntax.

Most file system administrative commands have a generic and a file system-specific component. Use the generic commands, which use the file system-specific component. Table 46 lists the generic file system administrative commands, which are located in the /usr/sbin directory. Most of these commands also have file system-specific counterparts.

Table 46. Generic File System Administrative Commands

Command

Description

clri(1M)

Clear inodes.

df(1M)

Report the number of free disk blocks and files.

ff(1M)

List file names and statistics for a file system.

fsck(1M)

Check the integrity of a file system and repair any damage found.

fsdb(1M)

File-system debugger.

fstyp(1M)

Determine the file system type.

labelit(1M)

List or provide labels for file systems when copied to tape (for use by the volcopy command only).

mkfs(1M)

Make a new file system.

mount(1M)

Mount file systems and remote resources.

mountall(1M)

Mount all file systems specified in a file system table.

ncheck(1M)

Generate a list of path names with their i-numbers.

umount(1M)

Unmount file systems and remote resources.

umountall(1M)

Unmount all file systems specified in a file system table.

volcopy(1M)

Make an image copy of a file system.

CAUTION. Do not use the file-system–specific commands directly. If you specify an operation on a file system that does not support it, the generic command displays the error message command: Operation not applicable for FSType type.


Syntax of Generic Commands

Most of the generic file system commands use the following syntax.


command [-F FStype] [-V][generic-options][-o specific-options]
   [special|mount-point] [operands]

The options and arguments to the generic commands are shown in Table 47.

Table 47. Generic File System Command Syntax

Option

Description

-F FStype

Specify the type of file system. If you do not use this option, the command looks for an entry that matches the special, raw device, or mount point field in the /etc/vfstab file. Otherwise, the default is taken from the file /etc/default/fs for local file systems and from the file /etc/dfs/fstypes for remote file systems.

-V

Echo the completed command line. The echoed line may include additional information derived from /etc/vfstab. Use this option to verify and validate the command line. It does not execute the command.

generic-options

 

Options common to different types of file systems.

-o specific-options

 

A list of options specific to the type of file system. The list must have the following format: -o followed by a space, followed by a series of keyword [= value] pairs separated by commas with no intervening spaces.

special| mount-point

 

Identify the file system. Name either the mount-point or the special device file for the slice holding the file system. For some commands, the special file must be the raw (character) device, and for other commands it must be the block device. See Chapter 8, "Administering Devices," for more information about disk device names. In some cases, this argument is used as a key to search the /etc/vfstab file for a matching entry from which to obtain other information. In most cases, this argument is required and must come immediately after specific-options. However, it is not required when you want a command to act on all the file systems (optionally limited by type) listed in the /etc/vfstab file.

operands

Arguments specific to a type of file system. See the specific manual page of the command (for example, mkfs_ufs) for a detailed description.

Manual Pages for Generic and Specific Commands

Both the generic and specific commands have manual pages. The specific manual page is a continuation of the generic manual page. To look at a specific manual page, append an underscore and the file system type abbreviation to the generic command name. For example, to see the specific manual page for mounting an HSFS file system, type man mount_hsfs and press Return. LOFS, PCFS, and PROCFS do not have specific manual pages for the mount command.

How File System Commands Determine File System Type

The generic file system commands determine the file system type with the following sequence.

  1. From -F if supplied.

  2. By matching a special device with an entry in /etc/vfstab (if special is supplied). For example, fsck first looks for a match against the fsck device field; if no match is found, it then checks against the special device field.

  3. By using the default specified in /etc/default/fs for local file systems and in /etc/dfs/fstypes for remote file systems.

Types of File Systems

If you want to determine the type of a file system, you can obtain the information from the same files that the generic commands use.

  • The FS type field in the file system table (/etc/vfstab).

  • The /etc/default/fs file for local file systems.

  • The /etc/dfs/fstypes file for remote file systems.

  • The fstyp(1M) command.

To find a file system's type in the /etc/vfstab file, type grep mount-point /etc/vfstab and press Return. Information for the mount point is displayed, as shown in the following example.


drusilla% grep /tmp /etc/vfstab
swap            -               /tmp                tmpfs   -             yes -
drusilla%

If vfstab does not have an entry for a file system, use one of the following procedures to determine the file system's type.

To identify a mounted file system's type, type grep mount-point /etc/mnttab and press Return. Information on the mount point is displayed, as shown in the following example.


drusilla% grep /home /etc/mnttab
drusilla:(pid129)     /home nfs  ro,ignore,map=/etc/auto_home,indirect,dev=21c0004
   693606637
bigriver:/export/home/bigriver      /tmp_mnt/home/bigriver nfs     rw,dev=21c0005
   695409833
drusilla%

NOTE. Starting with the Solaris 8 release, the /etc/mnttab file is no longer a text file, but you can still use the grep command to search it for specific entries.


Or, type mount and press Return. A list of the mounted file systems is displayed, as shown in the following example.


drusilla% mount
/ on /dev/dsk/c0t3d0s0 read/write on Tue Dec 24 12:29:22 1999
/usr on /dev/dsk/c0t1d0s6 read/write on Tue Dec 24 12:29:22 1999
/proc on /proc read/write on Tue Dec 24 12:29:22 1999
/usr/man on swsvr4-50:/export/svr4/man read/write/remote on Mon Dec 30 12:49:11
   1999
/usr/openwin on swsvr4-50:/export/svr4/openwinV3 read/write/remote on Mon Dec 30
   13:50:54 1999
/tmp on swap o on Wed Jan 8 13:38:45 1992
/mnt on swsvr4-50:/export/svr4 read/write/remote on Fri Jan 10 15:51:23 1992
/tmp_mnt/home on bigriver:/export/home read/write/remote on Tue Jan 14   09:23:53
   1992
drusilla%

Or, use the following steps.

  1. Type devnm mount-point and press Return.

    The raw device name is displayed.

  2. Become superuser.

  3. Type fstyp/dev/rdsk/cntndnsn and press Return.

    The type of the file system is displayed, as shown in the following example.


drusilla% devnm /usr
/dev/dsk/c0t1d0s6 /usr
drusilla% su
Password:
# fstyp /dev/rdsk/c0t3d0s0
ufs
#



    [ Team LiB ] Previous Section Next Section