Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
37.  Managing File Systems (Overview) Types of File Systems Virtual File Systems The Universal Disk Format (UDF) File System   Previous   Contents   Next 
   
 

Temporary File System

The temporary file system (TMPFS) uses local memory for file system reads and writes, which is typically much faster than a UFS file system. Using TMPFS can improve system performance by saving the cost of reading and writing temporary files to a local disk or across the network. For example, temporary files are created when you compile a program, and the operating system generates a lot of disk activity or network activity while manipulating these files. Using TMPFS to hold these temporary files can significantly speed up their creation, manipulation, and deletion.

Files in TMPFS file systems are not permanent. They are deleted when the file system is unmounted and when the system is shut down or rebooted.

TMPFS is the default file system type for the /tmp directory in the Solaris operating environment. You can copy or move files into or out of the /tmp directory, just as you would in a UFS file system.

The TMPFS file system uses swap space as a temporary backing store. If a system with a TMPFS file system does not have adequate swap space, two problems can occur:

  • The TMPFS file system can run out of space, just as regular file systems do.

  • Because TMPFS allocates swap space to save file data (if necessary), some programs might not execute because of insufficient swap space.

For information about creating TMPFS file systems, see Chapter 38, Creating File Systems (Tasks). For information about increasing swap space, see Chapter 41, Configuring Additional Swap Space (Tasks).

The Loopback File System

The loopback file system (LOFS) lets you create a new virtual file system so that you can access files by using an alternative path name. For example, you can create a loopback mount of root (/) on /tmp/newroot, which will make the entire file system hierarchy look like it is duplicated under /tmp/newroot, including any file systems mounted from NFS servers. All files will be accessible either with a path name starting from root (/), or with a path name that starts from /tmp/newroot.

For information on how to create LOFS file systems, see Chapter 38, Creating File Systems (Tasks).

Process File System

The process file system (PROCFS) resides in memory and contains a list of active processes, by process number, in the /proc directory. Information in the /proc directory is used by commands like ps. Debuggers and other development tools can also access the address space of the processes by using file system calls.


Caution - Do not delete the files in the /proc directory. The deletion of processes from the /proc directory does not kill them. Remember, /proc files do not use disk space, so there is little reason to delete files from this directory.


The /proc directory does not require administration.

Additional Virtual File Systems

These additional types of virtual file systems are listed for your information. They do not require administration.

Virtual File System

Description

FIFOFS (first-in first-out)

Named pipe files that give processes common access to data

FDFS (file descriptors)

Provides explicit names for opening files using file descriptors

MNTFS

Provides read-only access to the table of mounted file systems for the local system

NAMEFS

Used mostly by STREAMS for dynamic mounts of file descriptors on top of files

SPECFS (special)

Provides access to character special devices and block devices

SWAPFS

Used by the kernel for swapping

Commands for File System Administration

Most commands for file system administration have both a generic component and a file system-specific component. Whenever possible, you should use the generic commands, which call the file system-specific component. The following table lists the generic commands for file system administration, which are located in the /usr/sbin directory.

Table 37-1 Generic Commands for File System Administration

Command

Man Page

Description

clri

clri(1M)

Clears inodes

df

df(1M)

Reports the number of free disk blocks and files

ff

ff(1M)

Lists file names and statistics for a file system

fsck

fsck(1M)

Checks the integrity of a file system and repairs any damage found

fsdb

fsdb(1M)

Debugs the file system

fstyp

fstyp(1M)

Determines the file system type

labelit

labelit(1M)

Lists or provides labels for file systems when they are copied to tape (for use by the volcopy command only)

mkfs

mkfs(1M)

Creates a new file system

mount

mount(1M)

Mounts local and remote file systems

mountall

mountall(1M)

Mounts all file systems that are specified in the virtual file system table (/etc/vfstab)

ncheck

ncheck(1M)

Generates a list of path names with their inode numbers

umount

mount(1M)

Unmounts local and remote file systems

umountall

mountall(1M)

Unmounts all file systems that are specified in a virtual file system table (/etc/vfstab)

volcopy

volcopy(1M)

Creates an image copy of a file system

How File System Commands Determine the File System Type

The generic file system commands determine the file system type by following this sequence:

  1. From the -F option, if supplied.

  2. By matching a special device with an entry in the /etc/vfstab file (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 the special device field.

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

Manual Pages for Generic and Specific Commands

Both the generic commands and specific commands have manual pages in the man Pages(1M): System Administration Commands. The manual page for the generic file system commands provide information about generic command options only. The manual page for a specific file system command has specific information about options for that file system. To look at a specific manual page, append an underscore and the abbreviation for the file system type to the generic command name. For example, to see the specific manual page for mounting a UFS file system, type the following:

$ man mount_ufs

The Default Solaris File Systems

The Solaris UFS file system is hierarchical, starting with the root directory (/) and continuing downwards through a number of directories. The Solaris installation process enables you to install a default set of directories and uses a set of conventions to group similar types of files together. The following table provides a summary of the default Solaris file systems.

Table 37-2 The Default Solaris File Systems

File System or Directory

File System Type

Description

root (/)

UFS

The top of the hierarchical file tree. The root directory contains the directories and files that are critical for system operation, such as the kernel, the device drivers, and the programs used to boot the system. The root directory also contains the mount point directories where local and remote file systems can be attached to the file tree.

/usr

UFS

System files and directories that can be shared with other users. Files that run only on certain types of systems are in the /usr file system (for example, SPARC executables). Files that can be used on all types of systems, such as the man pages, are in the /usr/share directory.

/export/home or /home

NFS, UFS

The mount point for users' home directories, which store user work files. By default the /home directory is an automounted file system. On standalone systems, the /home directory might be a UFS file system on a local disk slice.

/var

UFS

System files and directories that are likely to change or grow over the life of the local system. These include system logs, vi and ex backup files, and uucp files.

/opt

NFS, UFS

Optional mount point for third-party software. On some systems, the /opt directory might be a UFS file system on a local disk slice.

/tmp

TMPFS

Temporary files, which are cleared each time the system is booted or the /tmp file system is unmounted.

/proc

PROCFS

A list of active processes, by number.

/etc/mnttab

MNTFS

A file system that provides read-only access to the table of mounted file systems for the local system.

/var/run

TMPFS

A file system for storing temporary files that are not needed after the system is booted.

The root (/) and /usr file systems are needed to run a system. Some of the most basic commands in the /usr file system (like mount) are included in the root (/) file system so that they are available when the system boots or is in single-user mode and /usr is not mounted. For more detailed information on the default directories for the root (/) and /usr file systems, see Chapter 43, UFS File System (Reference).

Swap Space

The Solaris operating environment uses some disk slices for temporary storage rather than for file systems. These slices are called swap slices, or swap space. Swap space is used as virtual memory storage areas when the system does not have enough physical memory to handle current processes.

Since many applications rely on swap space, you should know how to plan for, monitor, and add more swap space when needed. For an overview about swap space and instructions for adding swap space, see Chapter 41, Configuring Additional Swap Space (Tasks).

The UFS File System

UFS is the default disk-based file system in Solaris operating environment. Most often, when you administer a disk-based file system, you will be administering UFS file systems. UFS provides the following features:

UFS Feature

Description

State flags

Show the state of the file system: clean, stable, active, logging, or unknown. These flags eliminate unnecessary file system checks. If the file system is "clean," "stable," or "logging," file system checks are not run.

Extended fundamental types (EFT)

Provides 32-bit user ID (UID), group ID (GID), and device numbers.

Large file systems

Allows 1 Tbyte (terabyte) files in a UFS file system. The Solaris operating environment does not provide striping, which is required to make a logical slice large enough for a 1-Tbyte file system. However, Solaris Volume Manager provides this capability.

Large files

Allows 2 Gbytes (gigabytes) files in a UFS file system by default. You must explicitly use the nolargefiles mount option to enforce a 2-Gbyte maximum file size limit.

For detailed information about the UFS file system structure, see Chapter 43, UFS File System (Reference).

 
 
 
  Previous   Contents   Next