Ch5-File System PDF
Document Details
Uploaded by EasygoingLimit
University of Hail
Tags
Summary
This document discusses different types of file systems, including disk-based, network-based, and pseudo file systems. It also covers concepts like mounting, unmounting, and administering file systems.
Full Transcript
A file system is a structure of directories used to locate and store files. The term “file system” is used in several different ways: ◦ To describe the entire file tree from the root directory downward ◦ To describe a particular type of file system: disk-based, n...
A file system is a structure of directories used to locate and store files. The term “file system” is used in several different ways: ◦ To describe the entire file tree from the root directory downward ◦ To describe a particular type of file system: disk-based, network-based, or pseudo ◦ To describe the data structure of a disk slice or other media storage device ◦ To describe a portion of a file tree structure that is attached to a mount point on the main file tree so that it is accessible Usually, you can tell from context which meaning is intended. The Solaris system software uses the virtual file system (VFS) architecture, which provides a standard interface for different file system types. The kernel handles basic operations, such as reading, writing, and listing files, without requiring the user or program to know about the underlying file system type. The file system administrative commands provide a common interface that allows you to maintain file systems of differing types. These commands have two components: a generic component and a component specific to each type of file system. The generic commands apply to most types of file systems, while the specific commands apply to only one type of file system. Administering the file system is one of your most important system administration tasks. The file system story is a complex one, and understanding it can help you more effectively administer file systems. Making local and remote files available to users. ◦ “Mounting and Unmounting File Systems,” for detailed information. Connecting and configuring new storage devices when needed. Designing and implementing a backup schedule and restoring files and file systems as needed. ◦ “Planning a Backup Strategy,” for information on designing a backup schedule. ◦ “Backing Up Files and File Systems,” for detailed information about doing backups. ◦ “Restoring Files and File Systems,” for detailed information about restoring files and file systems. Checking for and correcting file system damage. File systems are usually checked and corrected at boot time. ◦ “Checking File System Integrity,” for detailed information on how to proceed if the automatic checking fails. The system software supports three types of file systems: ◦ Disk-based ◦ Network-based ◦ Pseudo USF sunos HSFS Disk-based file systems are stored on physical media such as hard disks, CD-ROMs, and diskettes. Disk-based file systems can be written in different formats. The available formats are: ◦ UFS – UNIX® file system (based on the BSD Fat Fast File system). UFS is the default disk-based file system in SunOS system software. ◦ HSFS – High Sierra and ISO 9660 file system. High Sierra is the first CD-ROM file system; ISO 9660 is the official standard version of the High Sierra File System. ◦ The HSFS file system is used on CD-ROM, and is a readonly file system. SunOS HSFS supports Rock Ridge extensions to ISO 9660, which, when present on a CD-ROM, provide all UFS file system semantics and file types except for writability and hard links. ◦ PCFS – PC file system, which allows read/write access to data and programs on DOS-formatted disks written for DOS-based personal computers. ◦ Each type of disk-based file system is customarily associated with a particular media device: UFS with hard disk HSFS with CD-ROM PCFS with diskette s5 with hard disk ◦ These associations are not, however, restrictive. For example, CD-ROMs and diskettes can have UFS file systems put on them. Network-based file systems are file systems accessed over the network. Typically, network-based file systems are file systems that reside on one system and are accessed by other systems across the network. NFS is the only available network-based file system. NFS is the default SunOS distributed file system. You administer distributed file systems by exporting them from a server and mounting them on individual systems. Pseudo file systems are virtual or memory- based file systems that provide access to special kernel information and facilities. Most pseudo file systems do not use file system disk space. Cache File Systems use a file system to contain the cache. Some pseudo file systems, such as the temporary file system, may use the swap space on a physical disk. The Cache File System can be used to improve performance of remote file systems or slow devices such as CD-ROM. When a file system is cached, the data read from the remote file system or CD-ROM is stored in a cache on the local system. The TMPFS file system uses local memory for file system reads and writes. Access to files in a TMPFS file system is typically much faster than to files in a UFS file system. Files in the temporary file system 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 SunOS system software. You can copy or move files into or out of the /tmp directory, just as you would in a UFS /tmp file system. Using TMPFS file systems 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. The operating system generates a lot of disk or network activity while manipulating these files. Using TMPFS to hold these temporary files may significantly speed up their creation, manipulation, and deletion. 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 a regular file system can fill up Because TMPFS allocates swap space to save file data (if necessary), some programs may not be able to execute because there is not enough swap space. The LOFS file system lets you create a new virtual file system. You can access files using an alternative path name. For example, you can create a loopback mount of / onto /tmp/newroot. The entire file system hierarchy looks like it is duplicated under /tmp/newroot, including any file systems mounted from NFS servers. All files are accessible either with a path name starting from /, or with a path name starting from /tmp/newroot. The PROCFS file system resides in memory. It 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 using file system calls. The following example shows a partial listing of the contents of the /proc directory: These additional types of pseudo file systems are listed for your information. They do not require administration. 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 NAMEFS – Used mostly by STREAMS for dynamic mounts of file descriptors on top of files Most file system administration commands have a generic and a file system– specific component. Use the generic commands, which call the file system– specific component. Table lists the generic file system administrative commands, which are located in the /usr/bin directory. NFS is a distributed file system that can be used to “tie together” computers that are running different operating systems. For example, systems running DOS can share files with systems running UNIX. NFS makes the actual physical location of the file system irrelevant to the user. You can use NFS to allow users to see all the relevant files, regardless of location. Instead of placing copies of commonly used files on every system, When you share a resource, you make it available for mounting by remote systems. You can share a resource in these ways: Using the share or shareall command Adding an entry to the /etc/dfs/dfstab (distributed file system table) Add one entry to the /etc/dfs/dfstab file for each resource that you want to have shared automatically. Each entry must be on a separate line, using this syntax: share [-F nfs] [-o specific-options] [-d "description"] pathname resource Thank You