Certification Objective 4.02Understanding Solaris File Systems


Certification Objective 4.02—Understanding Solaris File Systems

Exam Objective 2.5: Explain the Solaris 10 OS file system, including disk-based, distributed, devfs, and memory file systems related to SMF, and create a new UFS file system using options for <1Tbyte and >1Tbyte file systems.

A file system is a structure of directories that an operating system uses to store and organize files. The Solaris directory tree, although it looks like one file system, consists of several file systems connected to the tree, which is called mounting a file system. You will learn more about mounting in the next chapter. When we refer to a file system, we may mean any of the following:

  • A specific type of file system, such as a disk-based file system or a distributed file system, which we will discuss in this section

  • The entire directory tree on the system, beginning with the root (/) directory

  • A subtree that is mounted to a point in the main directory tree

  • The data structure of a storage medium, such as a disk

The Solaris operating system uses the virtual file system (VFS) architecture, which enables the kernel to handle basic file operations such as reading, writing, and listing files within a specific file system. A user can work issuing the same commands across the file systems—that is, the user does not have to know which specific file system is being used, hence the name virtual file system. In addition to the VFS, Solaris can also use the memory-based virtual file systems, which we discuss further on in this section.

There are several types of file systems supported by Solaris. Let's begin our exploration with disk-based file systems.

Disk-Based File Systems

Disk-based file systems reside on, well, disks: hard disks, diskettes, and CD-ROMs. Solaris supports the following disk-based file systems:

  • High Sierra file system (HSFS). High Sierra is the first file system for CD-ROMs. Its official standard version is ISO9660 with the Rock Ridge extensions, which provide all the UFS features and file types except the write and the hard links features. It is a read-only file system.

  • PC file system (PCFS). The personal computer file system is used to gain read and write access to disks formatted for the disk operating system (DOS) running on the PCs.

  • Universal disk format (UDF). The universal disk format file system is used to store information on digital versatile disk or digital video disk (DVD).

  • UNIX file system (UFS). The UNIX file system, based on the traditional UNIX file system known as the BSD fast file system, is the default for Solaris. We will explore this file system further on in this chapter.

image from book
Exam Watch

Note the general association of a file system with the specific media device: HSFS with CD-ROM, PCFS with diskette, UDF with DVD, and UFS with hard disk. However, these associations are not hard and fast; you can also create UFS on CD-ROMs and diskettes.

image from book

A disk-based file system can be accessed by logging on to the machine to which the disk is attached. (Everything is connected these days.) So, how can we access files across systems over the network, or the Internet, which is just a big network? Solaris has the answer to this question using the distributed file systems, which we explore next.

Distributed File Systems

The distributed file systems, also called network-based file systems, are used to store data that can be accessed across systems over a network. For example, the files could be stored on a Solaris system called a server and can be accessed from other Solaris systems over the network. Solaris 10 supports version 4 of the network file system (NFS), which improves security by integrating file access, file locking, and mount protocols into a single unified protocol. We explore NFS in further detail in Chapter 11.

So far, we have considered file systems that reside on a disk—that is, the permanent storage medium. One can imagine storing files in a volatile storage medium—that is, memory. There are file systems that do exactly that, and those files systems are called memory-based file systems, which we discuss next.

Memory-Based File Systems

Memory-based file systems use the physical memory rather than the disk and hence are also called virtual file systems or pseudo file systems. Note, however, that some virtual file systems may make use of disk space. For example, a cache file system uses a local disk for cache, and a temporary file system may use a disk for swap space. In general, virtual file systems provide access to special kernel information and facilities. Virtual file systems supported by Solaris are listed here:

  • Cache file system (CacheFS). The cache file system uses the local disk drives to cache the data from slow file systems such as CD-ROM drives or network file systems. This helps improve system performance.

  • Loopback file system (LOFS). Let's assume that for some reason you want to make a file system available under an alternative path name. For example, you want to call the root (/) directory /tmp/newroot. Solaris lets you do that by creating a new virtual file system called loopback file system, which will make the entire root (/) file system (in this example) appear as if it were duplicated under /tmp/newroot. In this example, all the files in the root file system could be accessed by using a path name that begins with either a / (forward slash) or /tmp/newroot.

  • Process file system (PROOFS). The process file system is used to contain a list of active processes on the Solaris system by their process ID numbers, in the /proc directory. This information in the /proc directory is used by commands such as ps. Other tools such as debuggers can access the address space of the processes by making system calls. The PROCFS resides in memory.

  • Temporary file system (TEMPFS). When programs are executed, files are created and manipulated that may involve significant reads and writes. The temporary file system is designed to improve the performance of these programs by using the local memory (and not the disk) for reads and writes. TEMPFS is the default file system for the /tmp directory on Solaris, As a result, the files in the /tmp directory are deleted when the file system is unmounted, or when the Solaris system is rebooted or shutdown. You can, however, move these file elsewhere (just like any other file) if you want to save them.

  • Other virtual file systems. There are other virtual file systems that do not require administration. Some of them are listed here:

    • FIFOFS. First in first out file system. Contains named pipe files that are used to give processes access to data.

    • MNTFS. Contains information about the mounted file systems.

    • SWAPFS. This file system is used by the kernel for swapping.

image from book
Exam Watch

The files in the /proc directory are used by the system to maintain the active processes on the system; do not delete these files. Even if you want to kill a process, deleting a file in the /proc directory is not going to do it. Furthermore, remember that these files take no disk space.

image from book

As you now know, everything in Solaris is a file. Solaris treats devices as files too, and those files are managed by the device file system (devfs), which we discuss next.

Device File System (devfs)

The device file system (devfs) manages devices in Solaris 10 and is mounted to the mount point/devices. Therefore, the content in the /devices directory is controlled by the devfs, and the files in the /dev directory are symbolic links to the files in the /devices directory. This way, you can continue to access all devices through entries in the /dev directory.

However, the /devices directory contains files only for the currently accessible devices on the system and dynamically represents the current state of these devices without requiring any system administration. Note the following two features:

  • When a driver is loaded and attached to a device instance, a file is created in the /devices directory. A symbolic link is created in the /dev directory and attached to the file in the devices directory. Unused device entries are detached.

  • The devfs improves the system performance because only those device entries that are needed to boot the system are attached. New entries are attached as new devices are accessed.

On the Job 

The files under the /devices directory are entirely controlled by the devfs, and you cannot change that. Also, the /devices namespace cannot be unmounted.

Although Solaris supports several file systems discussed in this section, the default file system for Solaris is called UNIX file system (UFS). Most of the time you will be creating a UFS as opposed to any other file system. Let's now explore creating UFS file systems.

Creating UFS File Systems

UNIX file system (UFS) is a disk-based file system, which is a default for Solaris. As a system administrator, you will spend a considerable amount of your time with this system. UFS offers the following features:

  • Extended Fundamental Types (EFTs). Provides a 32-bit user ID (UID), a group ID (GID), and device numbers.

  • Large file systems. This file system can be up to 1 terabyte in size, and the largest file size on a 32-bit system can be about 2 gigabytes.

  • Logging. Offers logging that is enabled by default in Solaris 10. This feature can be very useful for auditing, troubleshooting, and security purposes.

  • Multiterabyte file systems. Solaris 10 provides support for mutiterabyte file systems on machines that run a 64-bit Solaris kernel. In the previous versions, the support was limited to approximately 1 terabyte for both 32-bit and 64-bit kernels. You can create a UFS up to 16 terabytes in size with an individual file size of up to 1 terabyte.

  • State flags. Indicate the state of the file system such as active, clean, or stable. We explore the state flags further on in this chapter.

On the Job 

In Solaris 10, logging is enabled by default for all UFS file systems unless there is insufficient file system space for the log.

A multiple number of UFSs are created on your system disk during the installation of Solaris. These default Solaris file systems are organized in a hierarchy with the root (/) file system at the top; they are described in Table 4-3.

Table 4-3: Default file systems created during Solaris installation

File System

Type

Description

/ (root)

UFS

Contains directory and files critical for system operations: kernel, device drivers, and programs to boot the system. Contains mount point directories for other (local and remote) file systems.

/etc/mnttab

MNTFS

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

/export/home or /home

NFS, UFS

Mount point for user home directories.

/lib

NFS, UFS

Provides mount point for directories that contains shared libraries such as Service Management Facility (SMF) executable files.

/opt

NFS, UFS

Provides optional mount point, usually for third-party software.

/proc

PROCFS

Contains a list of active processes on the system by their ID numbers.

/system/contract

CTFS

Provides a virtual file system that contains the contract information.

/system/object

OBJFS

Used by debuggers to access the information about kernel symbols without accessing the kernel directly.

/tmp

TMPFS

Contains temporary non-system files that will be deleted when the system is rebooted.

/usr

UFS

Contains system files and directories that all users share.

/var

UFS

Contains system files and directories that will likely grow, such as system logs.

/var/run

TMPFS

Contains temporary system files that will be deleted when the system is rebooted.

image from book
Exam Watch

Make sure you understand what kind of files each file system shown in Table 4-2 contains.

image from book

Note the following additional points about these file systems:

  • Owing to their content, the root (/) and /usr file systems are required to run the Solaris system on your machine, as they contain the system commands and programs.

  • You will notice that some of the commands in the /usr file system (such as mount) are also included in the root file system because they will be needed during boot or in the single-user mode, when the /usr file system has not been mounted yet.

  • There are two temporary file systems: /tmp for non-system files, probably created by programs that are running, and /var/run for the system files.

In addition to the file systems created during installation, you can create new UFSs. Before creating a UFS on the disk, you may need to perform the following tasks:

  • Format the disk and divide it into slices, if that has not already been done.

  • In case you are re-creating an existing UFS file system, unmount it.

  • Find out the device name of the slice that will contain the file system.

  • Make a backup of the disk as a protection against loss of data. Backups are discussed in Chapter 9.

Exercise 4-1: Creating a UFS File System

image from book
  1. Become superuser.

  2. Issue the following command:

        # newfs /dev/rdsk/<deviceName> 

  3. The system asks for confirmation. Make sure you have specified the correct <deviceName>. If you specify the wrong device, you will end up erasing the data from that device.

  4. Verify your newly created system with the following command:

        # fsck /dev/rdsk/<deviceName> 

  5. Mount your newly created file system.

image from book

Files, and hence file systems, hold data, and the operations are made on the data: addition, deletion, and modification. During these operations, or for other reasons, inconsistencies can occur, which we explore next.




Sun Certified System Administrator for Solaris 10 Study Guide Exams 310-XXX & 310-XXX
Sun Certified System Administrator for Solaris 10 Study Guide Exams 310-XXX & 310-XXX
ISBN: N/A
EAN: N/A
Year: 2005
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net