An Example Shutdown Procedures

The System V shutdown command has the following syntax: shutdown −gn −ilevel [−y] where n Number of seconds to wait for the shutdown to begin the default value is 60 s level Run−level in which system should be placed: 0 — to turn off power • 1 — administrative state • S — single−user mode default • 5 — firmware state • 6 — reboot to initdefault state in etcinittab • y Optional preanswered query for shutdown confirmation yes; otherwise the command will prompt for confirmation just before the system goes down Older System V flavors required input to the shutdown command from the system console. However, this could be easily bypassed by executing the command from any terminal and redirecting the standard input to the console, with the −y option included: shutdown −g120 −i6 −y devconsole devconsole 21 To shutdown a system immediately and reboot automatically: shutdown −g0 −i6 −y To shutdown and halt a system after 60 s − default time: shutdown −i5 −y

4.5.3 An Example

An example from the Solaris 2.x platform is presented to illustrate a system shutdown process. Even though Solaris 2.x belongs to the System V category, the shutdown command is more BSD−like. Once the command to halt the system is entered, a series of messages about the systems behavior appears on the console until the final halt has been reached. shutdown −h now Broadcast message from root tty1 Thu Sep 21 10:38:59 2000 ... The system is going down NOW Sep 21 10:39:01 getty [61]: exiting on TERM signal halt: sending all processes the TERM signal .................... halt: sending all processes the KILL signal .. Unmounting filesystems ..... Done The system is halted 108

Chapter 5: UNIX Filesystem Management

5.1 Introduction to the UNIX Filesystem

The UNIX filesystem is the widely accepted name for UNIXs hierarchical tree−structured directory organization, which holds all files merged together, enabling equal access to them regardless of their nature or type. Any file in the UNIX filesystem can be identified by its position in the tree in two ways: by an absolute file name, a full−path file name that starts from the root directory represented by ; or by a relative file name, which is relative to the current working directory. Since everything in UNIX is either a file or file−like, UNIX filesystem management is one of the most important administrative tasks. Good filesystem management is the key issue for successful UNIX administration; since most activities are related, in some way, to the filesystems, most problems are related to the filesystems, too. Sufficient knowledge and understanding of this topic is crucial for administration. The purpose of the following text is to help readers better understand UNIX filesystem issues. The system administrator is responsible for ensuring that users have access to the files they need, as well as for keeping those files uncorrupted and secure. Basically, administering the filesystem includes the following tasks: Making local and remote files available to users • Monitoring and managing file corruption, hardware failures, and user errors • Monitoring and preventing filesystem overloading and unrestricted file growths • Ensuring data confidentiality by limiting file and system access • Checking for, and correcting, filesystem corruption • Enabling a full data restore via a well−planned backup schedule • Connecting and configuring new storage devices when needed • Some of these tasks can be performed automatically like checking for filesystem corruption, while others are usually done manually on an as−needed basis. Some of these tasks are also discussed in greater detail in other chapters. When discussing the UNIX filesystem, two basic issues should be made clear: Filesystem visibility, i.e., how the UNIX filesystem is seen by users. The administrators duty is to provide this visibility. We will refer to this topic as UNIX Filesystem Directory Organization, and discuss it in this chapter. 1. Filesystem layout, i.e., how the UNIX filesystem is seen by the operating system itself, and how a selected file is found, opened, modified, or stored within the available disk space. How this jungle of files functions at all, and how to ensure that it works well at any time. We will refer to this topic as UNIX Filesystem Layout, and discuss it in the next chapter. 2. As with everything in UNIX, both filesystem topics are BSD or System V colored and the main UNIX filesystem types originate from the two basic UNIX platforms. However, the differences between the two platforms are such that the corresponding filesystem types are mutually incompatible. They differ in the way directories are organized, as well as in the filesystem layout; they differ also performance−wise. Despite differences, the filesystem layout and filesystem directory organization are relatively independent issues, and UNIX vendors are free to select the best of each filesystem type and combine and improve them, thereby making new higher−performance hybrid solutions. The 109