Directory Chapter 1, Preface 1.1 Understanding Super User Status 1.1.1 Become a Super User (SU) 1.1.2 Exit Super User Status 1.1.3 Taking ROOT Registration 1.2 and User Communication 1.2.1 Display System Dedicated Information in Registration 1.2.2 Send the information to a single user 1.2.2.1 Send a short message to a separate user 1.2.2.2 will send a message as a file to individual users 1.2.3 Send the message to all users in a system or network 1.2.4 Email Send Message 1.3 Startup and Close System 1.3.1 Select Init Status 1.3.1.1 Viewing System Run 1.3.1.2 Using power-down status, running grade 0 1.3.1.3 Using system administrator status, running level 1 1.3.1.4 User status, running level 2 1.3.1.5 Using remote resource sharing status, running level 3 1.3.1.6 Use replacement multi-user status, running level 4 1.3.1.7 Using interactive reproduction status, running level 5 1.3.1.8 Using heavy boot state, Running level 6 1.3.1.9 Use single user status, running level S or S 1.3.1.10 Changing Run 1.3.2 Select the shutdown command used 1.3.2.1 Shutdown 1.3.2.2 Telinit and init 1.3.2.3 Halt 1.3.2.4 Reboot 1.3. 3 Guidance System 1.3.3.1 Guide to Multi-User Status 1.3.3.2 Guide to Single User Status 1.3.3.3 Interactive Boot 1.3.3.4 View Boot Information 1.3.3.5 Adding New Hardware After Boot System 1.3.3.6 Return Boot Process 1.3.4 Turning off system 1.3.4.1 Close a multi-user system 1.3.4.2 Close system: Option 1.4 Monitor process 1.4.1 PS command report 1.4.2 Using PS Report 1.4.3 Kill Process 1.5 Basic Management Tool 1.5.1 often Used command 1.5.1.1 Move 1.5.1.2 in the file system 1.5.1.3 Change the directory 1.5.1.4 View file 1.5.1.5 Display file information 1.5.1.7 Find a file 1.5.1.7 View a file Type 1.5.1.8 Viewing the information in the file 1.5.1.9 Strings in the Find file 1.5.1.10 View file 1.5.1.11 Browse file 1.5.1.12 View file end 1.5.1.13 View file header 1.5.1.14 change file Ownership and Permissions 1.5.1.15 Change file group 1.5.1.16 Setting or display system environment 1.5.1.17 Define Bourne and Korn Shell Environment Variable 1.5.1.18 Define C Shell Environment Variables 1.5.1.19 Setting Environment Variables 1.5.1.20 Using Path Variables 1.5.1.2 Set Bourne and Korn Shell Path 1.5.1.22 Set C Shell Path 1.5.2 Using Management Tools Chapter 2, Basic OS Command 2.1 Find User Information 2.1.1 Determining Who Registration in the System 2.1.1.1 Using WHO Commands 2.1.1.3 Using the Finger Command 2.1.1.4 Using the whodo command 2.1.2 Check the user number and Group number (ID command) 2.2 Logging Environment Information 2.3 Creating and Editing File 2.3.1 Using CAT Commands 2.3.3 Using Touch Commands 2.3.3 File Copy (CP) or Renaissance 2.3.3. 5 VI Use 2.4 Command combination and output reordering 2.4.1 Type multiple commands in the same command line 2.4.2 Output Redirection (<>) 2.4.3 Combination Command (|) 2.5 User Manual 2.5.1 Display Manual ( MAN) 2.5.2 Looking for a Command Number (WHATIS, MAN) 2.6 Check Disk Information 2.6.1 Display Disk Space Information (DF -K) 2.6.2 Discriminating Whether a file system is a local file system (DF) 2.6.3 Out a type of file system (DF -F) installed
Chapter 3, Equipment Management 3.1 Using Tape 3.1.1 Name Habits of Tape Devices 3.1.1.1 Using Default Density Specification Drive Number 3.1.1.2 for the Tape Machine Specified Density 3.1.1.3 Specify "Don't Relve" option 3.1.1.4 Tape controller and media device name abbreviation 3.1.1.5 1/2-inch wound non-SCSI internal (RACK MOUNTED) Tape machine 3.1.1.6 1/4 inch SCSI cassette and 1/2-inch front loaded volume Wire Tape Machine 3.1.1.7 Soot Scanning Machine 3.1.2 Read and write tape Command 3.1.2.1 Tightening Tape 3.1.2.2 Retrofit 3.1.2.3 List of Tape Machine Status 3.2 Tape and Soft Discharge 3.2.1 Tar Command 3.2 .1.1 List the file (TAR) 3.2.1.3 on the tape (TAR) 3.2.1.3 to the tape (TAR) 3.2.1.4 from the tape (TAR) 3.2.2cpio command 3.2.2.2cpio command 3.2.2.2.2.2. 2.1 Disproportionate all files in a directory to Tape (CPIO) 3.2.2.2 List the file (CPIO) 3.2.2.3 on the tape 3.2.2.2.2.2.4 Differential files from the tape (CPIO) 3.2.2.5 Soft disk use 3.2.3 Flop-driven device name 3.2.4ufs file system floppy disk 3.2.4.1 Format UFS floppy disk 3.2.4.2 Since the floppy disk 3.2.4.3 will copy UFS file to single formatted floppy disk 3.2 .4.4 List the files on the floppy disk 3.2.4.4 on a formatted floppy disk (TAR) 3.2.4.6 from the floppy disk (TAR) 3.2.4 on the floppy disk to copy out the Bar format (CPIO) 3.2.5 Using multiple floppy disk archives 3.2.5.1 Create a UFS file system (Newfs / dev / rdiskette) 3.2.6PCFS (DOS) file system on the floppy disk 3.2.6.1 Format PCFS (DOS) file system floppy disk 3.2 .6.2 Installing the PCFS floppy disk 3.2.6.3 Remove the PCFS floppy disk 3.3 Hard disk naming management 3.3.1 Hard disk Naming habits 3.3.1.1 Using the hard disk with a bus controller 3.3.1.2 Use the hard disk with direct drive 3.3.2 Check the hard disk Use 3.3.3 Check Hard Disk Information (PRTVTOC) 3.3.3.1 Put the file 3.3.3.2 to copy the file on the hard disk 3.3.3.3 repair bad block 3.3.3.4 Re-format the hard disk 3.3.3.5 to change the old hard drive 3.3.3.6 Error Table Format, Partition, and Tag 3.3.3.7 Reconstruction of Hard Disks 3.3.3.7 System (NEWFS) 3.3.3.8 At the Interim Mounting Point Installation File System (Mount) 3.3.3.9 UFSRESTORE 3.3.3.10 From Temporary Load Point Removal File System (UMOUNT) The method is as follows: 3.3. 3.11 Checking the Document System (FSCK) 3.3.3.12 Do a 0-level backup of the recovery file system 3.3.3.13 In Permanent Installation Point Installation File System (MOUNT) Chapter 4, File System Management 4.1 File System Type 4.1.1 Disk file System 4.1.2 Network File System 4.1.3 Pseudo File System 4.1.3.1 Temporary File System (TMPFS) 4.1.3.2 Cyclic File System (LOFS) 4.1.3.3 Process File System (Procfs) 4.1.3.4 Other Pseudo File System 4.2 Sunos 5.X Default File System 4.3 Virtual File System Table (/ etc / vfstab) 4.3.1 File System Entries Establishment 4.4 File Management Command 4.4.1 Normal Command Syntax Rules 4.4.2 Ordinary File System Commands and Special File System Command Manual 4.4.3 Using File System Commands Determines File System Type 4.4.5 File System Type 4.5 How to make file system valid 4.5.1 Installation and disassembly 4.5.1.1 Installation and Removal File System Command 4.5.1.2 Find installed file system 4.5 .1.3 All file systems in installation / etc / vfstab file 4.5.1.4 Install a specific type of file system 4.5.1.5 Install a single file system (MOUNT) 4.5.1.6 Remove all remote file systems (UmountAll -f NFS)
4.5.1.7 Disassembly of Individual File System (Umount) 4.5.2 Automated Setup 4.5 Shared Server File 4.6 Checking Data Consolidation (FSCK) of File System (FSCK) 4.6.1 Deciding whether the file system needs to detect 4.6.2 to detect interactively File System 4.7 Backup and Recovery File System 4.7.1 Using QiC-150 Box Tape Backup File System (UFSDUMP) 4.7.1.1 Implementing Incremental Backup 4.7.2 Recovery Backup File System 4.7.2.1 Which backup with 4.7.2.2 Restore all backups 4.7.2.3 Interactive Recovery File 4.7.2.4 Recovering a single file (UFSRESTORE) from the backup tape 5.1 Checking Remote System Status 5.1.1 Determining a remote system has run more than 5.1. 2 Determine if a remote system is running (Ping / RUP / RPCINFO-P) 5.2 registration to a remote system (RLogin) 5.3 system transfer file (RCP, FTP) 5.3.1 Using RCP Commands 5.3.2 Using File Transfer Procedure (ftp) Chapter 6, Managing User Accounts and User Groups 6.1 Adding and Managing User Accounts 6.1.1 Adding User Group 6.1.1.1 Editing PasswD Database 6.1.1.2 Defining User Group 6.1.1.3 Establishing Home Director 6.1.1.4 Automatic installation directory 6.1.1.5 Install the primary file 6.1.1.7 Define Members 6.1.1.8 Create a message 6.1.1.9 Create a password 6.1.2 Manage User Account 6.1.2.1 Cancel User Account 6.1.2.2 Cancel User Account 6.1 .2.3 Frozen User Account 6.2 Settings and Managing User Groups 6.2.1 Setting the domain value in the group database 6.2.1.1 Setting Group Name Domain 6.2.1.2 Setting Group ID Domain 6.2.1.3 Settings Message 6.2.2 Default UNIX User Group 6.2.3 Creating New Group 6.2.4 Modifying or Deleting User Group 6.2.4.1 Modifying a Group 6.2.4.2 Deleting a Group Chapter 7, UNIX SHELL Command 7.1 Various Shell Public Commands 7.1.1 Setting a certain default shell 7.1.2 Change the shell type (SHLL type in the command line (SHEAR) 7.1.4 from the Shell Interpreter (Exit) 7.1.4 Clear a shell window (CLEAR) 7.2 Standard shell7 .2.1 Standard shell's initial file 7.2.2 Defining a standard shell environment variable 7.3 c shell7.3.1c shell Substation 7.3.2c Shell Environment Variable Definition 7.3.3 Creating C Shell Alias 7.3.4 Setting C Shell History 7.3.5 Using C Shell History 7.3.6 Setting C Shell Returning ORSE 7.3 .7 new commands Embed 7.3.8cshell History Commands Edit 7.4 Korn shell7.4.1korn shell's initialization file 7.4.2Korn shell selection 7.4.3 Creating a Korn Shell alias 7.4.4 With Korn Shell's online editor editing command 7.4.5 Setting Korn Shell History 7.4.6 Displaying the Historical Command of Korn Shell 7.4.7 Historical Command Using Korn Shell 7.4.8 Editing the Historical Command of Korn Shell Chapter 8, Management System 8.1 Display System 8.1.1 Determine the host ID number (Sysdef -h) 8.1.2 Determine the hardware type (uname -M) 8.1.3 Determine the processor type (uname -P) 8.1.4 Determine the OS version number (uname -r) 8.1.5 Display system configuration Information (PRTCONF) 8.1.6 Determine how long is the system has run 8.1.7 Determine the date and time of the system (Date) 8.1.8 Setting the system's date and time 8.1.9 Change the system's time zone (/etc/timezone) 8.2 Configure additional swap space (MKFILE, SWAP) 8.3 Creating a local mail alias (/ etc / mail / aliases)
Chapter 9 Setting path 9.1.5source c shell Initialization file 9.1.6 Checking the current lookup path 9.1.7 Executing a command 9.2 Analysis with permissions and ownership 9.2.1 Change the ownership of the file 9.2.2 Change files 9.2.3 Changes Chapter 1 of the File Group Ownership Chapter 1, Preface This manual is mainly used by the Solaris system administrator, and the content provided contains the installation of the Sun OS operating system system, the establishment of the environment and the creation of important documents, and the system administrator in the network system environment. How to establish, maintain, manage the working environment under network systems, but also the daily use commands of system management, main commands, indexes of files. This chapter will introduce: System administrators' responsibilities, understand the superuser status, how to communicate, start and turn off system, process management, and basic management tools with users. SunOS 5.x operating system, the main component of the Solaris 2.x software system environment launched by Sun, Solaris 2.x can run in the SPARC and Intel hardware platform, a UNIX system that supports a symmetrical multiprocessor surroundings. The responsibility of the system administrator's duties system administrator is to ensure that a set of systems on a Standalone system or network can run normally (mainly finger software). System administrators in different fields, their responsibilities are also different, and a system administrator may be an expert in one or more fields, but in other fields, it is developing. The following is listed in this manual's work: 1. Manage device * Use * Format Disk * Monitor disk Using 2, understand the service access mechanism * Create a two-way modem (MODEM) 3, manage files System * Installation or Removal of File System * Backup and Recovery File or File System 4, Manage Network Services * Find Network Information * System Transfer Document * Manage NIS Database 5, Manage Print Services * Set a Print Customer and Print Server * Using Print Commands 6. Manage users and user groups * Add users * Delete users * Change user information * Create new group account 7, learn shell * using generic shell command * Use c shell command * Using Korn shell command 8, management system * Find system information * Establish local mail alias * Configuring additional exchange space (SWAP SPACE) * Manage system date and time * Identify file Access Failure * Search path issues * Access rights and ownership issues * Network access issues * Access all file systems and resources * Obtaining User Communications * Close and Start System * Monitoring Process This manual is arranged in the title order given, you must also understand when and how to manage the following management: (This manual Does not include the following system management: Install system software, install third manufacturers software, establish and manage network services, establish and manage mail services, expand, and delete hardware, manage security and accounting, monitoring systems, and network performance.) This chapter The rest will describe how to complete the system administrator and introduce some basic commands and management tools. 1.1 Understanding Super User Status Super User is a privileged user, which can use all files and commands without any restrictions, superusers have a specific UID (= 0), this account is named root (actually as a UID Users with 0 are superusers).
Many system management tasks must be completed under superuser, such as installing and disassembling file systems, changing access rights, backup and recovery file systems, backup, and closing the system. We can use the following way to enter the super user: 1. In other users, use the su command without any parameters, and type the password of root as needed. 2. Type the root and its password under login prompt. After entering the super user, the shell will give a special prompt "#", reminding you to have a high access to the system, do anything to be careful, by querying file / var / adm / sulog, you can Track who is using a super user account. It is best to enter the super user if necessary, should avoid making a general thing under the super user. If a task requires you to be a super user, it will prompt you to enter the super user. When you complete the necessary work, go back to the general user state. Since the super user is not protected access rights, the root account always has a password, and to replace the password frequently in order to increase security. 1.1.1 Become a super user (SU) only when the root permission is required to complete a certain job, you enter the super user, below is a method from ordinary users to root: 1. In the $ or% prompt of the shell, enter SU. If the root account has a password, the system will prompt you to type the port. 2, type the super user password, if the password is correct, you have superuser privileges, the system displays the "#" prompt. GTXA% Su Password: # If you want to use the environment variable of the root itself, type Su -. 1.1.2 Exiting the Super User Status To exit the superuser status, simply type EXIT. #exit gtxa% 1.1.3 Registration to ROOT to register directly into root, you must complete: 1. In Login Tips, enter root, so you are prompted to enter the root password. 2, enter the password of root, if the password is correct, the system will appear ROOT prompt #: login: root password: # 1. An important part of the user communication system administrator work is to communicate with the user, the user understands the administrator. Things have the impact of system feature, let users know how you do management (such as rebooting the system, installing new software, or changing the system environment in some way) will have an impact on them. The administrator can communicate verbally with the user, but the most common way is:?; Display the current system-specific information when registering.?; Send the message directly to a user terminal with the WRite command.?; Send message to a message with WALL Give all users on a system.?; Send the message to all users on the network with the rwall command.?; Send a message by email. 1.2.1 Display system dedicated information at registration Every user Register the system, the system message is displayed on the screen, and this message is stored in file / etc / motd. You have already registered the system and the user who is using the system. You can use the MOTD command to view this message, including: operating system version number, system software change, new installation (or deleted) third manufacturer file name , Or system scheduling schedule. Must ensure that the MOTD file is the latest. If the MOTD shows an outdated message, the user will lose a critical message, the message should be as short, if the length exceeds a screen, the user does not read the beginning.
/ etc / motd file The person of the ETC / MOTD file should be root, and the root should be the only user who has write permissions on this file. GTXA% LS -1 / ETC / MOTD -RW-R - R - ROOT SYS 49 JAN 1 1970 / etc / motord gtxa% Note: After system software installation, there are several files (including / etc / motd) The update time is "Jan 1 1970" this date is the start date of UNIX. When you edit these files, this time will change. 1.2.1.1 Establishing Date Messages Use the following steps to establish a date message: 1, become a superuser 2, edit the / etc / motord file 3 with editing tools (such as vi), remove unused messages, enter new messages 4, save the modified File, these messages Display 1.2.2 when the user logs into the system next time, send information to a single user to send information to the user's terminal, when using window systems (such as Open Windows), each window There is a separate account, if the user logs in multiple times, the information will be displayed directly in the console window. 1.2.2.1 Send a short message to a separate user sends a one-time short message to a single user: 1. Type Write UserName, username is the user's registration name. 2. Type the message you want to send. 3. After entering the message, type control-d. The content you typed in the console window of the UserName user. The following is an example of the system administrator to send a message: gtxa% write ignatz @ Elm I'll coming by at 12:00 to look at your problem. Gtxa% The following is a message displayed in the user console window: Message from Fred @ gtxa On TTYPL 11:20 ... I'll com by at 12:00 to look at your problem. EOF 1.2.2.2 will be sent to a message as a file to individual users If you want to send a message to some users, build a message file , Use the parameters of Write command to implement, one of the parameters is the message file name. Create a file, this file contains messages you want to send. Type Write UserName 1.2.3 Send messages to all users in a system or network can use the Wall command (WRITE ALL) to send messages to each user in the system, using the RWALL (Remote Write All) command to send the message to the network simultaneously All users. To send a message to all users in the system: 1, type Wall 2. Type Messages you want to send 3, after entering the message, type Control-D, the message will display in the console window of each user in the system . Here is an example: gtxa% Wall System Will Be Rebooted AT 12:00 GTXA% Show Message in User Console Window: Broadcast Message from Root On Console ... System Will Be Rebooted At 12:00 EOF Note: Use rwall commands Be very careful, so this command consumes a lot of system and network resources, to send messages to all users on the network: Type RWALL-N 2, type messages you want to send 3, after the message is input, type control-d The message is displayed in the console window of each user of the network system. Below is an example: gtxa% rwall-n eng system gtxa will be rebooted at 12:00 gtxa% Show Messages in User Console Windows Yes: Broadcast Message from Root on Console ... System Will Be Rebooted At 12:00 You can also use the rwall command to send the message to all users in a system, and its command format is: RWALL HOSTNAME 1.2.4 E-mail is an effective way to disseminate some system management information via email, but this The manual does not introduce how to use email, see Mail (1), Mailtool (1) and Mailx (1) for details on mail information. 1.3 Starting and Off System Launch and Close System is an integral part of the system management work, this section describes the process of normal startup and shutting down the system, if the system starts an error, see How to diagnose boot problems in the system documentation. SunOS 5.x system software is always in continuous operation, so email and network software work normally, but in the following cases, the system must turn off or stop. • Turn off the system power supply? Install a new version of the operating system?; Power aging?; System expand hardware ?; File System Maintenance 1.3.1 Select Init Status Solaris System Software Biit Stat Statistics: Default Init Stat Stat Stat State / ETC OK in / inittab. The default init status of the Solaris system software is running level 3. Table 1.1 lists 7 possible run levels and systems in each stage. Table 1.1 System Initial State Initial Status Function 0 Power-down Status 1. Ss System Administrator Status (Single User) More Multiple User Status (No Resources, No NFS) 3 Multiple User Status (Output Resources, Start NFS Process) 4 Replacement Multi-user status (currently not only) 5 Software Heavy Status (currently not available) 6 System Reboot Status / Sbin / init program is responsible for ensuring that the system is running normally, or it can be used to change the init status command, and you can also use the init status ( Tape -i selection item) as a parameter of the shutdown command. The following is four system state types: 1, power down (running level 0) 2, single user (running level 1 and s or s) 3, multi-user (running level 2 and 3) 4, heavy guidance (running 5 and 6) If you are ready to do system management, it must be determined which init status is suitable for the system and what you need. 1.3.1.1 Viewing System Rows To view the run level of a system, type WHO -R: that is, the run level, date, time, process termination, process ID, process exit status. In the following example, the system GTXA is at the default multi-user run level (3), the date and time is in Feb 6 15:46, the final state of the process is 3, the process ID is 0, the process exit state is S: gtxa% WHO -R Run-Level 3 Feb 6 15:46 3 0 s GTXA% The following describes how to use each init status. 1.3.1.2 Use the power-down state to run the system with this level to shut down the power safely. 1.3.1.3 Using System Administrator Status, Run Level 1 When an administrative task requires that you are the unique user of the system, use this level, in this state, only the root and / usr file system is installed, only allowed At least the core utility, the terminal that issues the command becomes a console, no other user login. 1.3.1.4 Use multiple user status, running level 2 General operation In this state, multiple users can access the system and the entire file system in this state, except for NFS servers, syslog, and remote sharing processes, all The system management process is running. 1.3.1.5 Use a remote resource sharing status, running level 3 This state is usually valid together with NFS resource sharing. 1.3.1.6 Use replacement multi-user status, running level 4 This run level is not available. 1.3.1.7 Use this level when using the interactive reproduction state, running 5. When booting the system from a non-default boot device, use this level. You can also enter this status level with the reboot -a command. 1.3.1.8 Use the retransmission state, running level 6 Use this runtime closing system to make the system status to run grade 0, then reload to multi-user-level (or to the default running level specified in the initTab file). 1.3.1.9 Use a single user status, running level S or S using this level to make the system in a single user state, and all file systems are installed and accessible. 1.3.1.10 Change Running Level Use the Telinit or Init command to change the run level, the Telinit command requires a single-character parameter, this parameter is the run level used by INIT, although the user can use the init command directly, but it is best to use the Telinit command to change the system Run level. 1. Be superuser 2, type telinit n. The parameter n is the init stat state number to use. To turn off the system GTXA% Su Password: # Telinit 0 becomes a single user status: GTXA% Su Password: # Telinit 1 To become a multi-user status running without NFS server system management process: gtxa% supassword: # Telinit 2 To a multi-user status of the NFS server system management process: GTXA% Su Password: # Telinit 3 To turn off and reboot system to run level 3: gtxa% supassword: # Telinit 6 1.3.2 Select the shutdown command to be used to do system When you manage your work, you need to determine the right shutdown command, which describes how to use the shutdown mission provided by the system. / usr / sbin / shutdown / etc / telinit and / sbin / init / usr / sbin / halt / usr / sbin / reboot or above completed: initial shutdown process, kill all running processes, write new data to hard disk The Solaris system is turned off to properly run. 1.3.2.1 Shutdown Close the system in multi-user state, use the shutdown command, this command sends a warning message to the user used by the system, waiting for 60 seconds (default) to turn the system as a single user status, you can choose Different default wait time. 1.3.2.2 Telinit and Init Use the Telinit or init command to turn off a single user system or change the run level of this system, the init command changes the system's run level, Telinit command init you want the run level, both can be used alternate, but The Telinit command is better, and the system can be set to power-down status (init 0) or enter the single-user status (INIT). Note: Telinit / init and shutdown commands are a good way to change the system's running status, because they use the first-level RC shell program to kill the row process, so use these programs to shut down the system is the most reliable way. 1.3.2.3 HALT When the system must stop immediately and do not warn any user, use the HALT command. The HALT command does not have any delay when the system is turned off, does not give the user in any warning. The HALT command does not run any RC shell programs, so it is not a good way to turn off the system. 1.3.2.4 The Reboot System is not in a multi-user state, shut down the system with the reboot command and reboot to multiple user status, the reboot command does not warn the user in the system, not running the RC shell program, so it is not a good way to turn off the system. 1.3.3 Guidance System If the system power is cut, the power supply starts a multi-user boot process. Next, the method of booting the system to different states will be described below. If the PROM prompt is>, type n to display the OK prompt. 1.3.3.1 Guide to multi-user status To boot the system to multi-user status, on the OK prompt, type boot, start the automatic boot process on the default drive, display a series of boot information, and finally the system enters the multi-user status. 1.3.3.2 Guide to a single user status To boot the system to a single user status, in the OK prompt, type boot -s, the system boots to a single user status and prompt to enter the root password: ok boot -s init: Single User Mode Type Ctrl -D proceed with normal start-up (or give boot password for system maintenance) Type the root password. Note To continue to boot the system to multiple user status, type Control-D. 1.3.3.3 Interactive Guidance If you want to temporarily change system files or core, you can use interactive boot. In this case, you can test the change, and it is easy to recover when problems occur. 1. Under the OK> PROM prompt, type boot-a, the boot process will prompt you by interactively. 2. If you respond to the carriageway, that is, the default / kernel / UNIX core boot, if you do not have the default core, type the core name you want to use. 3. If you respond to the bus, you type the system file name used by the default / etc / system file. 4. If you respond to the bus, use the default module directory path, otherwise you type the module directory path name. 5. If you respond to the bus, you can type UFS from this site with a default root file system, or type UFS diskless customers. 6. If you respond to the default physical name of the ROOT device, you can type the name of the device. 7. If the response carries, use the default exchange file system type SWAPFS (Note: SWAPFS is the uniquely allowed swap file system type). In the following example, the default selection: OK boot -a (hardware configuration message) rebooting from -a boot device: / sbus / esp @ 0,800000 / sd @ 0, 0 file and args: -a enter [/ kernel / unix]: (Copyright notice) name of system file / system] [/ etc: name of default directory for modules []: root filesytem type [ufs] Enter physical name of root device [/ sbus @ 1, f8000000 / esp @ 0,80000 / sd @ 0,0: a]: swapfsystem type [swapfs] configuring network interface interfaces: Leo Hostname: gtxa (fsck messages) The system is coming up. Please wait. (More Messages) GTXA login: 1.3. 3.4 Viewing Boot Information Boot Information In / VAR / ADM / Messages file, guide the system to view this information, type / usr / sbin / dmesg or more / var / usr / mssages, display boot information. GTXA% / USR / SBIN / DMESG JAN 13 11:22 Sunos Release 5.0 Version [UNIX (R) System V Release 4.0] System File (etc / system) Error: Readline Error on line 1. root nexus = sun 4-60 MEM = 16384K (0x4000000) Avail Mem = 14688256 Ethernet Address = 8: 0: 20: 7: 83: 17 Sbuso At Obio 0xF8000000 DMA0 At Sbus Slot 0 0x400000 EXP0 At Sbus Slot 0 0x800000 SBUS Level 3 (SPARC IPL 3) SDL AT SEP0 Target 1 LUN 0 / SBUA @ 1, F8000000 / ESP @ 0,80000 / sd @ 1,0 (sd1): SD3 AT ESP0 Target 3 LUN 0 / SBUS @ 1, F8000000 / ESP @ 0,80000 / sd @ 3, 0 (SD3): root on / sbus @ 1, f8000000 / esp @ 0,800000 / sd @ 3,0: a fstype UFS SWAP ON SWAPFS FSTYPE SWAPFS SIZE 1348K Le0 At Sbus Slot 0 0xC00000 Sbus Level 4 (SPARC IPL 5) ZS0 AT OBIO 0XF1000000 SPARC IPL 12 ZS1 AT OBIO 0xF0000000 SPARC IPL 12 Dump On / DEV / DSK / C0T3D0SL Size 32748k Dec 24 12:30:01 Sendmail [82]: Alias Database Out of Date Dec 24 12:30:01 sendmail [ 82}: aa00082: Message- IN = <9112242030., @ Gtxa. ENG. Sun. com> DEC 24 12:30:01 sendmail [82]: AA00082: from = root, size = 592, class = 0, Received Form Local D EC 24 12:30:02, Stat = SENT DEC 24 12:30:58 Sendmail [153]: Network daemon starting dec 31 15:20:24 rlogind [734]: PCKTREAD: SUSPEET ZERO LEN FDO At Obio 0xF7200000 SPARE IPL 11 CGSIX0 At SBus Slot 1 0x0 SBUS Level 5 (Spare IPL 7) CGSIX0: Screen 1152x900, Single Buffered, IM Mappable 1 GTXA% 1.3.3.5 Adding new hardware After booting the system When new hardware is added, the boot command must use -R selection to enable the operating system to view and load new device drivers during booting. 1. Press the new device driver in the description of the hardware. 2. Turn off the system and install new hardware. 3. Type boot -r and enter, run the Shell program, load all the devices drivers in the module directory and establish the corresponding hardware node (NODES). 1.3.3.6 Returning the boot process In some cases, you may want to withdraw from or interrupt the boot process, the specific interrupt key is different from the keyboard type, for example, type STOP -A or L1 -A. On the TTY terminal, type the BREAK key. To interrupt the boot process, type the interrupt button corresponding to the system. When the boot process, the monitor will display the OK PROM prompt: OK Type the boot restart boot process, or type HELP to display a group of help. If the terminal is shown> prompt, type n to get the OK prompt. 1.3.4 Close Underline The following describes how to shut down the system with the shutdown and init commands. 1.3.4.1 Turning a multi-user system Before closing a multi-user system, you want to notify the user in the system to complete some processing procedures. 1. Type WHO and display all user lists of registered. 2. Type PS-EF and display the system activity process table. If the system process allows it to close, go to the next step. 3, become a super user. 4. Type CD /, must run the shutdown command in the root directory. 5. Type ShutDown, the system wants you to confirm whether you want to turn off the system. 6. Type Y, all users will receive a message, wait for 60 seconds, the system is turned off, enter the single user status and prompt Type the root password. 7. Type the root password, the system is in a single user status, and maintenance work can be maintained. 8. Type Control-D Return to the default running system level. # cd / # Shutdown Shutdown Started Fri Aug 6 10:50:35 Edt 1993 Broadcast Message from Root (Console) on Earth Fri Aug 9 10:59:35 The System Is Being Shut Down Now! ! ! LOG OFF now or RISK YOUR FILES BEING DAMAGED DO You Want To Continue? (Y OR N): Y The system is down. Changing to init state s-please wait: new run level type: ctrl-d to proceed with normal start-up, (or Give Root Password For system maintenance): 1.3.4.2 Close System: Optionally, if you want to change the default function of the shutdown command, select one of the six ways described below to complete. 1. Close the system in an unbearable: * Be superuser * Type CD / must run the shutdown command in the root directory. * Type a GRACE PERIOD 2, in order to change the shutdown waiting time (Grace Period), use the following steps: * Be superuser. * Type CD /, must run the shutdown command in the root directory. * Type ShutDown -T. The system is turned off after waiting for the user to determine. * Below is a CRACE PERIOD example: # CD / # shutdown -g 120 3, close and reboot multi-user system * becomes a super user. * Type CD /, must run the shutdown command in the root directory. * Type ShutDown -i6 to send a message to all users and execute the RE6 shell program; the system is turned off to power down, and then restore to multiple user status. 4. Close the single user system To turn off a single user system, type telinit 0 (or init 0) command to run the shell program so quickly, without warning information. 5, close and reboot the single user system to turn off and reboot the single user system, type Telinit 6 (or init 6). At this point, the system information is written to the hard disk, killing all the activity processes and the system returns to the power-down state. The system will reboot to the default level (usually a multi-user level). 6, the emergency shutdown system is urgently closed, type UADMIN 2 0. Write system information to the hard disk, the system returns to the power-down state, and the PROM prompt is displayed. 1.4 Monitoring Process A program running in the system at a certain time is called a process. The user can monitor the status of the process, control the CPU time obtained by a process, hang or terminate a process. The PS command is the main tool for obtaining process information. You can use the PS and GREP commands to find what you need, you can determine which process is in (or not) running, and you can get a process details, including: * PID -f display process startup program 1.4.1 PS command reported When typing PS-E, you can get the following information gtxa% / usr / bin / ps -e pid tty time COMD 0? 0:02 SCHED 1? 0:01 INIT 2? 0:00 Pageout 192? 0:00 SAC 79? 0:10 inetd 75? 0:01 in ROUTE 136? 0:04 Automoun 143? 0:01 CROM 123? 0:01 Statd 104? 0:01 RPCBIND 106? 0:01 RPC. Rwal 108? 0:01 RPC. RUSE 110? 0:01 RPC. SPRA 113? 0:01 YPBIND 115? 0:00 KeyServ 117? 0:01 Kerbd 127? 0:02 LockD 251 PTS / 0 0:00 PS 165? 0:00 SCNDMAIL 193? 0:01 TTYMON 174? 0:03 sysylogd 156? 0:01 LPSCHED 209? 0:02 in rlogi 211 PTS / 0 0:03 CSH 164? 0:00 LPNET GTXA% The contents of each column are as follows: * PID: Process identification number * TTY: Start the terminal of this process (or its parent process). If the process does not control the terminal this column shows a question mark > ─ The process of displaying the question mark is often a system process. * Time: The CPU time used in the process * COMD: The command name of this process is generated. Note: The PS-E command only shows the header of the file name. When typing ps -el, you can see the following display: gtxa% / usr / bin / ps -el fs uid ppid c Pri Ni Addr SZ WCHAN TTY TIME COMD 19 T 0 0 0 80 o SY F010F1C8 0? 0 : 02 SCHED 8 S 0 1 0 251 0 20 FFLAD800 48 FFLAD9C4? 0:01 Init 19 s 0 2 0 0 0 SY FFLAD000 0 FFLAD07D? 0:00 Pageout 8 S 0 192 1 49 1 20 FF1F7000 238 FF2DE348? 0:00 SAC 8 S 0 79 1 80 1 20 FF232800 258 F010FLA4? 0:10 inetd 8 s 0 75 1 80 1 20 F / 49000 327 FF2DE448? 0:01 in route 8 s 0 136 1 80 1 20 FF2C3000 287 F010FLA4? 0:04 Automoun 8 s 0 143 1 80 1 20 FF293000 270 F010FLA4? 0:01 Cron 8 s 0 123 1 49 1 20 FF28E800 258 F010FIA4? 0:01 Statd 8 S 0 104 1 80 1 20 FF25A000 301 F010FLA8? 0: 01 RPCBIND 8 S 0 106 1 77 1 20 ff258800 272 f010fia4? 0:01 rpc.rwal 8 s 0 108 1 80 1 20 F010800 272 F010DLA4? 0:01 RPC.RUSE 8 S 0 110 1 78 1 20 FF266800 272 F010FLA4? 0: 01 RPC . SPRA Table 1.3 is the description of the domains in the PS -EL long report, the field descriptions F hex indicates that the current status 00 process of the process has been terminated, and its corresponding process entry has been empty 01 This process is One process is always in memory 02 This process is being tracked by its parent process tracking 04 This process is tracked by its parent process, and has stopped running 08 This process cannot be used in signal activation 10 processes in memory and completed in one file. Before locked Stay 20 This process does not replace the current state of the S process, one of the following letters, indicates that O is running S sleep on the processor; waiting for the IO event to complete R operation Ready. I idle state, the process is creating a z zombie state; the process has terminated and the parent process is no longer waiting, but this death process remains in the process table. T Because the parent process is tracking it to stop executing X wait for more memory UID process owner's user ID number PID process identification number PPID parent's identification number C process used by the identification number C process (percentage estimation of CPU time used in this process) Value) PRI process scheduling priority, the larger the number, the lower the Ni process of the Ni process, affect its scheduling priority, improve the number of NICEs in the process to reduce its priority, use fewer CPU time SZ processes required The number of false memories, it highlights the process for the system memory. TTY launches the terminal of this process (or the parent process), or "?" Means no control terminal (usually representing the system process). The TIME process generates a command to generate this process from starting to the CPU time used in current. 1.4.2 Using the PS Report When you need to use the PS -E selection, use the PS -E selection if you want to get more details of the process, use the PS -EL selection. Detailed Description of Each Selection Reference PS (1) Command Manual. Here's how to find potential problems: * Viewing all the same jobs all by the same user, if there is, this may be because a user runs the shell program that starts a set of background jobs, but not waiting for the job to terminate, find users to talk Talk, see if it is this, if necessary, use the kill command to kill some of these processes, and see the detailed introduction of killing a process See Section Section. * View the Time domain to see which processes take up a lot of CPU time, such a process may cause a dead cycle. * View the C domain, find out the process that takes up a lot of CPU time and not important, if you think this process does not value so much CPU time, you can use the priocntl command to reduce its priority, detailed information about the priocntl command, refer to PriOentl (1) Manual. * View the SZ domain to find the process that occupies too much memory. If a process takes up excessive memory, kill it, if there are many processes in the system, you may need to expand memory. * Find more and more uncontrolled processes that occupy the CPU time, you can use the PS command with the -f option to see its excellent time (STIME), or directly look at the CPU accumulated time referred to in its TIME domain. 1.4.3 Killing Processes Sometimes users need to completely eliminate a process, at this time, the format of the kill command is kill-, here is a number or a name. Note: Use the kill command only when the process cannot exit normally. Sometimes the processes have not been dead with a kill command, the most common situation:?; The process is waiting for a device (such as a tape drive) to complete some action before exiting. • The process is waiting for resources that are invalid due to problems in NFS, in this case, should be used to kill a process with a kill-quit command. ?; The process is in a zombie state, as shown in the message report, the zombie process has released the resources it, but has not received the response from the parent process, generally receiving the response to delete the corresponding process entry, start next time When the system, the zombies process is eliminated, the zombies process does not affect system performance, so users don't have to delete them. To kill a process: 1, become a super user, you have to kill a process that is not your own, you must become a super user. 2. Type PS -E, a set of processes will be displayed, using the PID (process ID) number of the first column as the next input, if you know which process has a problem, you can type: ps -e | grep To find its process ID 3, type KILL-15, if only KILL is typed, no parameters, the default signal is 15. 4. Type PS -E, check if the process has terminated, if the process exists, then step 5. 5. Type KILL-9, this process should be terminated. Type Man -S5 Signal to see the signal description used by KILL. For example: If Open Windows on the GTXA system is dead, you must register from another system to kill this process. ELM% rlogin gtxa password: gtxa% PS-E │ grep openwin pid tty time comd 2212 PTS / 0 0:00 openwin 2213 PTS / 1 0:00 GREP OpenWIN GTXA # kill 2212 GTXA # EXIT GTXA% Logout ELM% 1.5 Basic Management Tools Solaris System Software provides the following two management tools: * A set of universal operating system commands * has an Administration Tool for graphical user interfaces. 1.5.1 Understand User Direction This section briefly introduces basic Solaris commands, you are likely to use them as part of the system management routine, more detailed introduction to "Basic OS Commands" and Appendix A in Chapter 2 The listed SunOS 4.x command is the comparison table of the SunOS 5.x command. 1.5.1.1 Moving the Solaris System Software in the file system is a hierarchical file system. When you manage the system, you need to know which location is currently in the file system, how to go to a different directory. 1.5.1.2 View location in the file system To know which layer is currently in the file system, type the PWD. PWD (Print Work Directory) Command Displays the current directory: GTXA & PWD / ETC gtxa% 1.5.1.3 Change the directory to change the directory, type the CD. CD (Change Directory) Command Enables you into the typed directory: gtxa% CD / USR gtxa %% PWD / usr gtxa% If you only type CD without typing the path name, you return to the registration directory. 1.5.1.4 Viewing the information about the file Use the LS command to display directory content and file permission, symbolic chain, owner, group, file length (number of bytes), modify the date and time and file name, many users access files The reason for the error, the charter is to have incorrect permissions or ownership, and see Chapter 10 "Identify File Access Problem" in detail for this problem. 1.5.1.5 Display File Information To display the information about a file, type LS -1, display the permission, symbolic chain, owner, group, file length (number of bytes), modify the date and time and file name. To see all files in the directory, type LS -1A, and see the command manual for the LS selection list. GTXA% ls -1 / etc / passed -r - r - r - lrootsys659 feb 24 17: 28 / etc / passed gtxa% 1.5.1.6 Find a file To start searching from the root directory to find a file, type Find $ home -name -print. $ home variable indicates that the lookup starts from the root directory. -Name option indicates that the specified file name is to be found, and the -print option requires the result of the lookup. If you don't find the file specified in it, the system returns to the prompt state. The following example is a lookup file Core: GTXA% Find $ home -name core -print / home / ignatz / core gtxa% Table 1.4 Options for the Find command Options Description -FSTYPE Find a file system for specified types, usually in UFS or NFS File -Prune restrictions Search for specified directory -Nouser Find users of users in / etc / passwd - NOGROUP Find files that do not belong to / etc / group in groups in the last day of the file - Mtime Find files in the last day-CTime finding files that have been changed in the last day, including changing the properties of the file. If the number of links, owners or group -XDEV restrictions are only for a file system search for a full instructions for the FIND command options for Find (1). 1.5.1.7 Viewing the type of a file In some cases, you need to determine the type of file. To view the type of file, type file. The output result is the file type of the specified file. For example: If a user tries to execute an ASCII file or empty file that does not perform permission, you can see the file type of this file is an ASCII file or an empty file and cannot be executed. The following is an empty file example: gtxa% File Junk Junk: Empty File gtxa% The following is an example of the ASCII file: GTXA% File Junk Junk: ASCII Text GTXA% The following example, file is a text file with executable permissions, so The file command reports that the file is executable and is a text file. GTXA% Chmod 777 JUNK GTXA% File Junk Junk: Commands text gtxa% You can also use the ls -1 command to see if a file has execution permission. You can use the file * command to view the type of all files in a directory. Documents listed in alphabetical order, followed by file type: gtxa% file * coterie: directory course: ascil text dead letter ascii text ksyms English text people:. Directory personal: directory showrev: ascii text status: directory text: directory toodo: ascii Text GTXA% 1.5.1.8 Viewing the information in the file Use the grep and egrep commands to find some specific information output from the file or command. 1.5.1.9 String in the Find file Type the GREP to find the specified string in the file, and the display file can contain the string of the string. For example: Find a line in the Passwd file: gtxa% grep csh / etc / passwd ignatz: 6693: 10: Ignatz 64607: / home / ignatz: / bin / csh fred: 14072: 10: Fred Lux: / home // HOME / FRED: / VIN / CSH GTXA% Method for finding multiple files simultaneously: Enter multiple file names in the command, which is separated between space; or use the unmanaged file name (or use with the file name) . To display rows that do not contain a string, you can type GREP -V. Finding the input row with a mode, you can use the GREP in a pipeline way to combine many management commands. For example: To find a certain user's current process, you can use the PS command and grep and find the username, type PS-E│GREP. That is, the user name is displayed. Use the following command to find all processes of Open Windows: gtxa% ps -e │GREP OpenWIN PID TTY TIME COMD 2212 PTS / 0 0:00 openwin gtxa% 1.5.1.10 Viewing the file is undoubted, people have to take a time to view the file Content, you need to view the entire file, you can use more commands when you only need to see the content of the file (such as a log (log) file), you can use the tail command to display the last 10 lines of the file, when important information is available in the file header, available The head command displays the top 10 lines of the file. 1.5.1.11 Browsing File You can type more to browse the file, the file only displays a screen at a time, press the space bar to display the next screen. When you use more to browse files, if you want to find a string in your file, you can type /. The screen rolls to the location of the string you want to find, and displays the "... skippin" information of the string you want to find on the top of the window. If not found, the screen does not scroll and display "Pattern Not Found". For example: To find the Local aliases string / etc / mail / aliasses file, you can type / Local aliases / Local aliases ... skipping # # # # # # # # # # # # # Local aliases below # # # #. # # # # # # # # Note: You must write letters with the correct case in the more command. In the above example, if you type / local aliases, you will tell you that you are not found. In order to find the next matching string, type n. Type Q to exit the more command to display the shell prompt. To display the Shell INTR character, type stty -a, display the device list of stty, the following: ^ h (retracting "is delete character: gtxa% speed 9600 Bau; rows = 35; columns = 80; Ypixel = 9 Xpixels = 0; EUCW 1: 0: 0: 0, SCRW 1: 0: 0: 0 INTR = ^ c; quit = ^ │; ERASE = ^ ?; kill = ^ u EOF = ^ D; EOL ^; EO12 =; SWTCH =; start = ^ D; STOP = ^ S; SUSP = ^ z; DSUSP = ^ y; rprnt = ^ r; flush = ^ O; werase = ^ W; LNEXT = ^ V; Parenb-Parodd CS- cstopb hupcl cread-clocal -loolk - crtscts-parext -ingbrk btkint ignpar-parmrk-inpck istrip -inncr - igncr icrnl-iucle ixon-ixany-ixoff imaxbel isig icanon-xcase echo echoe echok-echonl-noflsh -tostop echoctl -echoprt echoke -Defecho -flusho - Pendin Inxten Opost-Olcuc Onler -onoCr -Ofill-Ofdel 1.5.1.12 View file end To view file end, type tail, display the last 10 lines of the file (default), the following example shows / ETC / LP / SYSTEM file: gtxa% / usr / bin / tail / etc / lp / system # kepler: x: -: -: SVR4.0 OS # fubar: x : -BSD: 10: N -: -: BSD OS # Galialeo: x: -: S5: -30: 10 -: -: # # # # Billboard: x: Bsd: -: N: 10: -: Homeboyl: x -: -: -: -: -: -: -: -: -: -: -: : -: gtxa% default, head and tail commands displays 10 lines, reliably use -n option to control the number of lines, replace N by the number you want to display. For example: To display the last 20 line, type TAIL-20. Note: The TAIL command can display up to 4096 bytes (approximately 400 rows). 1.5.1.13 Viewing the file header To view the file header, type Head to display the header 10 Undergrade example display / etc / password file: gtxa% / usr / bin / head / etc / pasce: x: 0: 1 : 0000-admin (0000): /: sbin / sh daemon: x: 1: 1: 0000-admin (0000): /: bin: x: 2: 2: 0000-admin (0000): / var / adjm: Sys: x: 3: 3: 0000-admin (0000): /: adm: x: 4: 4: 0000-admin (0000): / var / adm: lp: x: 71: 8: 0000-lp (0000 : / usr / spool / lp: SMTP: x: 0: 0: Mail daemon user: /: uucp: x: 5: 5: 0000-uucp (0000): / usr / lib / uucp: nuucp: x: 9 : 9: 0000- UUCP (0000): / var / spool / uucppublic: / usr / lib / uucppublic: / usr / lib / uuCCCCI Listen: x: 37: 4: Network admin: / usr / net / nls: gtxa% 1.5.1.14 change file Many of the ownership and permission users may be generated by the ownership and permission issues of the file, with the LS command to view the ownership and permissions of the file, if you want to change them, available: chown, chmod, and chgrp commands. * Change the file ownership You must have a file or directory (or you are a superuser) you can become the owner 1> Type LS -1. The owner of the file is displayed in the third column 2> Enter Super User 3> Type Chown. Ownership Press the new home file by assigned a specified. GTXA% LS -1 Quest-RW-R - R - 1FRED Staff 6023 Aug5 12:06 Quest GTXA% Su Password: # chown ignarz Quest # LS-1 Quest -RW-R - R - Lignatzataff6023 Aug5 12: 06 Quest # More detailed introduction, please refer to Chapter 10. * Change the 8-envoidal value of the setup file permission list listed in the license table 1.5. You can use three such numbers to set the permission of the owner, group, and other users, respectively. For example: 644 shows that the owner has read / write permissions, the same group users and other users have read-only privileges. Table 1.5 File permission value value Description 0 No permission 1 can be executed 2 can be written 3 can be written, can perform 4 read only 5 readable, executable 6 readable, write 7 readable, write, execute 1> Type LS -1. The list shows the current permissions of the file. 2> Type Chmod. Change the permissions of the file change to your specified value. Note: You can replace file names (such as *?), Or use them to change the permissions of all files in multiple files or a directory. In the following example, a file will be changed from 666 to 644. GTXA% LS - 1 Quest -rw-rw-rw-lignatzstaff 6023 Aug5 12:06 Quest GTXA% CHMOD 644 QUEST GTXA% LS -1 Quest -RW-R - R - Lignatzstaff6023 AUG5 12:06 Quest GTXA% 1.5. 1.15 Changing the file group To change the file group, type ChGRP. Group ID $ ls -lg junk -rw-r - r - l Other 0 Oct 31 14:49 Junk $ CHGRP 10 JUNK $ LS -LG JUNK -RW-R - R - L ATAFF 0 OCT 31 14:49 JUNK $ Group ID number is defined in the Group database or local / etc / group file, see Chapter 7 for more information on the group. 1.5.1.16 Setting or Display System Environment SHELL Use a set of descriptions given in the shell initialization file to maintain the environment, and users can send them to the shell to modify the SHELL information about the environment from the environment variable. Solaris system software provides 7 default environment variables. * Psi: Defines the shell prompt. The default prompt of Bourne and Korn shell is $. The default prompt of C shell is%, and the default prompt of the root in any shell is #. Users can lower different shell prompts in .profile, .login or .cshrc files. * Home: Defines the absolute path of the user's home directory. As part of the registration process, automatically define the default value of HOME and set to the registration directory described in the / etc / passwd file. When you type a CD command and there is no parameters, the shell goes to the directory determined by the Home variable. * Logname: Define the user's registration name. As part of the registration process, the default value of the logname is automatically defined and set to the registered name described in the / etc / passwd file. * PATH: List a set of directories. When the user is knocked into the command, the shell looks up from these directories in order. If the directory where a command is located is not in the lookup path, the user must type all the paths of the command. As part of the registration process, the default value of PATH is set by pressing .profile (Bourne, and Korn shell) or .cshrc (c shell) file. The order of finding the path is very important. When the same name is in different directories, the first found command is executed. For example: assuming Path (in Bourne and Korn Shell) is defined as path = / bin: / usr / bin /: usr / sbin: $ home / bin, is known in the USR / BIN and / HOME / JEAN / BIN directory Sample program, when the user does not type the path, but only when the Sample command is typed, execute the Sample program in the / usr / bin directory. Other environment variables include: * LPDEST: Setting users' default printer * OpenWinHome: Setting Open Wimdows executable code * Deskset: Sets the DESKSET's licensored path * LANG: Setting up local language, possibly: ENGLISH, JAPANESE , German, French, Swedish and Italian, etc. * HZ: Setting Borne and Korn Shell History * TZ: Settings Time Zone * Shell: Setting Make, VI, or other tools used by the default shell * mail: Tell the shell to find new Email * Mansects: Setup Manual Effective Chapter User and System Administrators can additionally define the environment variables they use, when the user defines environment variables from the shell command, as long as the user does not quit the shell, the defined environment variable has always played . With the shell, it will no longer work. The "permanent" environment variable can exist. Profile, .login, or .cshrc file, define the syntax of the environment variable varies depending on the SHELL. 1.5.1.17 Defining Bourne and Korn shell Environment Variable To define Bourne and Korn shell environment variables, type =; export. $ Hz = 100; Export HZ $ 1.5.1.18 Define C shell Environment Variable If you define a C shell environment variable, type STenv .% STENV Dislay Rogue: 0% 1.5.1.19 Displaying the settings of the environment variable To display the current environment variable settings, type ENV. $ Env home = / home / irving hz = 100 logname = Irving mail = / var / mail / irving mansects = / 1: 1m: 1c: 1f: 1s: 1b; 2/3: 3c: 3i: 3N: 3M: 3K : 3g: 3E: 3X11: 3XT: 3W: 3B: 9: 4: 5: 7: 8 path = / usr / bin shell = / bin / sh term = sun tz = ESTS5EDT $ 1.5.1.20 Using Path Variable PATH environment variable is very important. When the user performs a command with a full path name, shell is looking for a command by a given full path. When the user only gives the command name, the shell looks out to find the directory by pressing the path given by the PATH environment variable. When you find this command in a directory, it is executed. The default root path (sbin: / usr / sbin: / usr / bin: / etc) is set by the system, but many users have added some other command catalogs, many of the users, such as the settings environment The incorrect version of the command or tool, etc., often due to the incorrect path settings. 1.5.1.21 Set Bourne and Korn Shell Path Bourne and Korn Shell's path is set in the user's $ home / .profile file: path =.: / Usr / bin: / $ home / bin 1.5.1.22 Set c shell The path C shell is to set the user's $ home / .cshrc file as follows: SET PATH = (./ USR / BIN $ HOME / BIN) For more detail, please refer to the instructions and Chapter 10. 1.5.2 Using the Administrative Tool Administration is a tool with a graphical user interface for Open Windows. It is used to manage 17 databases under host systems and / etc. Using this management tool can manage users and groups, manage files in Nis databases and local / etc directory. Chapter 2, Basic OS Commands This chapter will introduce: Find user information, find environmental information, create and edit files, command combination, and output orientations, and use the manual to find hard drive information. This chapter explains the basic operating system command to provide a method of finding the user and system environment information, and tell the establishment and editing file, command combination, input redirection, display manual, and various methods to find basic disk information. 2.1 Find User Information When you manage your system, you often need to know who is using the system and what they are doing. This section describes the commands of user information: WHO, Finger, Rusers -1, WhoDo, ID, etc. 2.1.1 Determine who is registered in the system (WHO, Finger, RUSERS -1, Whodo, ID) can use one of the four commands to find who registered into the system. Each command also displays a variety of additional additional information. 2.1.1.1 Use the who command who command to display the user list of registration into the system, register TTY port, and date and time, if a user is remotely registered, then this command also shows the user's remote system name, using the who command The method is: Type WHO. In the following example, user IRVING is remotely registered, and user Ignatz is the local user of the system GTXA. GTXA% WHO IRVING PTS / 1 OCT 31 14:33 (ELM) Ignatz Console Oct 31 12:22 GTXA% 2.1.1.2 Using the Finger Command Finger Command Displays the user registration name registered into the system, and display the user's full name (name / The INFORMATION field of the etc / passwd file, TTY port, week, registration time, if it is a remote registration user, the remote system name is also displayed. The method using the finger command is: Type Finger In this example, users Winsor Remote Registered GTXA% from the system Castle GTXA% Flogin @opENet OpenEN WHEN WHEN WHEN WHEN WINSOR JANICE WINSOR PTS / 0 11 THU 09:59 Castle gtxa% 2.1 .1.3 Using the RUSERS-1 Command RUSERS -1 (Remote User Registration) command, display the username registered from the remote system, and display the system name, TTY port, date, login time, and idle time (Idle Time). If the host is not idle, then the last column does not display, the method of using this command is to type RUSERS-1 and then enter. GTXA% RUSERSD Protocol Version 3 ... Sending Broadcast for rusersd protocol version 2 ... JAH Caps: Consloe Mar 3 13:03 22:03 Amber Facehole: Console Mar 2 07:40 Sebree OnDine: Consloe MAR 2 10:35 14 Tut Cairo: Consloe Mar 2 16:48 JRT Cairo: TTYP5 Mar 2 16:20 47:54 (GAP) Ramseyis MOWTHELAWN: Consloe Mar 2 16:33 28 Ramseyis MOWTHELAWN: TTPY6 Mar 3 14:20 25 : 14 (: 0.0) (more logins not shown) gtxa% 2.1.1.4 Use whodo command whodo command to display the date, time, and system name. It displays the device name, UID, registration time, and an activity process table associated with this UID. The contents of this table include device name, PID, CPU time (minutes, seconds), and process names. Type Whodo, you can see who is registered, and what the registrant is doing. GTXA% Whodo Tue Mar 12 15: 48: O3 1992 SUNOS TTY09 MEN 8:51 TTY09 28158 0: 9SH TTY52 BDR 15:23 TTY52 21688 0: 052222788 0: 01WHODO TTY52 22017 0: 03VI TTY52 22549 0: 01SH 2.1. 2 Check the user's user number and group number (id command) Use the id command to display the user ID and group ID number of the registered user, when the user cannot access their own files, use this information to find the wrong reason, accordingly Information can also be known as the group to which the user belongs. When using the ID command, the user is registered first, then type the id command. If the UID and UID do not match the UID or GID of the problem with the problem, you need to change the owner or group of the file, or add the user to the corresponding group. See Chapter 5 for details. GTXA% ID UID = 6693 (Winsor) GTXA% Su Password: #id uid = 0 (rood) GID = 1 (Other) # 2.2 Search Environment Information There is a running environment, these environments Description Defines environment variables directly by Shell to the .cshrc and .login, the user initialization file standard shell and the Korn shell. Login. Environment variables can specify such, such as user home directories, registration names, default printers, email addresses, and paths accessing the Open Windows environment. This talked about how to find the settings of the environment variable. For more details on this, see Chapter 8. In order to display the user's environment variable setting, type the ENV command. This systematically shows the list of environmental changes, and see the relevant content of Chapter 1 for the default settings for environment variables and how to set environment variables. GTXA% env Home = / path =: / home / ignatz: / usr / bin: / home / ignatz / bin: / bin: / home / bin: / etc: / usr / etc Lognanme = ignatz hz = 100 tz = PST8PDT Term = Sun shell = / bin / csh mail = var / mail / ignatz PWD = / mansects = / 1: 1m: 1c: 1F: 1S: 1B: 2: 3: 3 C: 3i: 3N: 3M: 3K: 3G: 3E: 3X11: 3XT: 3W: 3B: 9: 4: 5: 7: 8 GTXA% 2.3 Creating and Editing File This section describes how to create and edit using CAT, Touch, CP, MV, Text Editor and VI commands file. 2.3.1 Use the CAT command to create a short file or attach a small amount of text information to an existing file at the end of an existing file. Create a file with a CAT command: 1, type cat; 2, enter the text content; 3. Type Enter; 4. Type Control-D. Text is stored, the shell prompt reappears. Use the CAT command to attach the text to the existing file: 1, type cat; 2, enter the content; 3, type the Enter; 4, type control-d. The stylist is stored and the shell prompt reappears. 2.3.2 Use the touch command touch command to set the access and change time of each file to the current time. If the file does not exist, create a new file. You can create an empty file with the touch command to check the allowable right and the owner, or create a file for later entry text. To create an empty file, you only need to type a new empty file such a new empty file, if this file already exists, the modification time of the file becomes the current date and time. GTXA% LS -1 JUNK JUNK: NO Such File of Directory GTXA% Touch Junk GTXA% LS -1 JUNK-RW-R - R - Livringstaff 0 Sep 11 15:06 JUNK GTXA% 2.3.3 File Copy (CP) Or the rename (MV) can create a new file by copying or renovating a pair of existing files. The method of copying the existing file is: Type CP, so that the original file is copied, and the original file is retained. The MV original file is renamed, and the original name file no longer exists. GTXA% MV Quest / TMP / Quest. Old GTXA% 2.3.4 Text Editor can be created and edited using Open Windows style. However, ordinary users may have problems when using a text editor to edit files with root permission (Root pemissions). Select Program in the main menu of the Open Windows Workspace, and select Editor in the Programs menu to open the style editor, or type: Textedit & to open the Stylistic Editor on the command line. After opening, a text editor window is displayed. When editing, you can use the CUT, COPY, PASTE, and UNDO keys on the keyboard to speed up the editing speed of the text. 2.3.5 VI Use full screen editor VI, usually editing text files by the system administrator. Some special books tell VI usage. This section provides only the most common editing commands for users to refer. Just type VI. You can start VI if the file does not exist, then open a new file. When you copy content, this new file is created. If the file already exists, after the file is existing, then this file is displayed on the screen. Opening a part of the content. Table 2.1 Some basic VI command function commands are not stored in the disk: Q Departure after W: WQ stock After the ZZ left shift a character h right shifted one character i Move down to the file tail G inserted Text (insert) V (text) ESC Additional text after the cursor A (text) ESC At the end of the end of the text A (text) ESC How to exit the command mode ESC DD delete character X Delete word DW start joining new Text O At the next row, add a new text o Copy a row to the buffer y Prepperse P 2.4 command combination and output redirection after the buffer content in the current cursor before P 2.4 command combination and output redirection SUNOS 5.0 system allows for a variety of methods Combined commands, this section describes three methods of command combination. 2.4.1 Type multiple commands in the same command line With a semicolon (;), you can type multiple commands in the same command line, for example, can use CD / USR / BIN; LS command first Go to a directory, list the directories and files in this directory, and another example is set to the Bourne Shell to re-output the variable. Path =. : / usr / bin: $ home /; export path 2.4.2 Output reordering (<>) Unless otherwise stated, command results are usually displayed on the screen, using the re-oriented characters ("<" and ">"), The output result is reordered, for example, stores a file instead of displaying it on the screen, simply use the redirector ">", indicating that the shell puts the content into a file, the following example, the output of the Date command Among the Sample.file files: gtxa% date> Samle.File gtxa% below is Sample.File content: gtxa% more Sample.File Tue May 26 13:26:59 PDT 1992 GTXA% can also re-direction input . For example, send a file's content mail to the user ignatz @ gtxa, type Mail igzatz @ gtxa For example, display Open Windows process information: gtxa% ps-E│GREP OpenWin 260? 0:00 openwin gtxa% If you want to print the above information, you can add a pipe command (| LP) after the above command: gtxa% PS- EF │GREP OpenWIN │LP Request ID IS Castle-51 (Standard Input) GTXA% 2.5 User Manual SUNOS 5.x provides online reference manuals, the manual is divided into different sections, the same type The command is a section. For example, most user commands are (1), the system management is marked (IM). The manual can be stored on the local system or on the server, this section describes how to display the manual, and How to find a command in which section is. 2.5.1 Display Manual (MAN) Display Manual, just type the man, the man page is displayed. GTXA% Man Grep Grep (1) User Commands Grep (1) Name Grep -Search A File for a pattern synopsis grep [-bchilnsvw] limited -expression ... 2.5.2 Some commands of the command section (What, man) can appear in a few chapters, at which time you can use whatis to find the command in the manual Section Number. Note: Only when using Cat Man command to create a manual, the Whatiis command will only work. Type the #cat man in the Super User Status to create a man page, which is to create the section. In the following steps, you can find the section of the manual: 1, type whatis. The first line of this command manual is displayed. This line contains the nickname of the command manual. 2. Type Man -s and then enter, display the man page . GTXA% Whatis Chown Chown Chown (1) -change Owner of File Chown Chown (1B) -Change Owner Chown Chown (1M) -change Owner Chown Chown (2) -change Owner And Group of A File gtxa% man -s2 chown chown (2) SYSTEM CALLS Chown (2) Name Chown, LChown, Fchown-Change Owner And Group of a file synopsis # include # include int Chown (const char * path, uid-t oowner, gid-t group); int Chown Const char * path, uid-t ooner, gid-t group); int Fchown (int Fildes, udi --towner, gid); description chown () sets the outipe and group id of the file specified by Path OR Feferenced Ty The Open File Descriptor Fields To Owner and Group Respective. IF Owner or Group IS Specified AS-1, Chown () Does Not Change The Corresponding ID of The File. ... 2.6 View Disk Information The following command can be used to check disks Use information and point out that a file system is a local UFS or remote (NFS). 2.6.1 Display the information of the disk space (DF -K) Solaris DF commands, when the parameter is not used, the output result is different from the previous DF command. DF plus the -k selection, you can display disk information in the format in SunOS 4.x. Type the DF -K display file system name, total byte, number of bytes, number of residual bytes, percentage of use, and installation points. GTXA% DF -K / DEV / DSK / C0T0D0S0 30383 19926 7427 73% / / DEV / DSK / C0T0D0S6 189683 66503 104220 39% / USR / Proc 0 0 0 0% / Proc FD 0 0 0 0% / DEV / FD SWAP 44268 12 44256 0% / TMP / DEV / DSK / C0T0D0S7 331953 116133 182630 39% / OPT / DEV / DSK / C0T3D0S7 189858 24293 146585 14% / Export / Home OpenET: (PID146) 0 0 0 0% / NT OPENET :( PID146) 0 0 0% / Home .... 2.6.2 Discriminating whether a file system is a local file system (DF) Type DF can detect a file system is a local file system or a remote installation network file system (NFS) . Disk format information (including disk location or mount points) corresponding to the specified file system will also be displayed. In the following example, the file system is an NFS file system. GTXA% DF / HOME / IGNATZ BIGRIVER: Export / Home / Ignatz 53888980 399435 85647 82% / TMP-MMT / Home / Ignatz gtxa% in the following example, file system on local hard disk #df / / dev / dsk c0t0d0S0 30383 11885 15468 43% / 2.6.3 Find some types of installed file systems (DF -F) For all installed file systems of the same type, you can use the -f selection, the post file system type. The most common file system structure is the local file system UFS and network file system NFS. Type DF -F to list all specific types of installed file systems. In the following example, all installed NFS file systems are displayed: GTXA% DF -F NFS / NET (Cinderella: (PID153): 0 Blocks-1 Files / USR / DIST (CINDERLLA: (PIL53)): 1276248 Block.-1 Files / Home (Cinderella: (PID153): 0 Block-1 files / usr / man (OCAK: / Export / MAN): 272934 Blocks-1 Files GTXA% Displays the installed UFS file system. Cinderella% DF - F-FU / (/ DEV / DSK / C0T0D0SO): 36992 BlCoks 13558 Files / USR (/ DEV / DSK / CTOD6): 274346 Blocks 94403 FILES / EXPORT / Home / Cinderella (/ dev / dsk / cotdDDOS7): 379670 Blocks 96046 Files Cinderell% In the following, display the installed temporary file system information CineRella% DF -F TMPFS / TMP (SWAP): 88528 Block 3156 FILES Note: Due to the switching area file system (SWAPFS) never install, Display with the DF command. Chapter 3 The file system is the content of the fourth chapter, and the fourth chapter also describes the tape device name and used to manage disk commands, introduce the service access mechanism (SAF) of network devices that use SunOS 5.x system software - provided To print the port manager to the print server and print customers, join the steps with Hayes compatible modems to the system, describing how to manage printers in Chapter 6. 3.1 Using the Tape This section describes the tape device naming convention, read and write cassettes Command, and how to use TAR and CPIO commands to access files. Tar and cpio commands to copy files or file systems to tapes, according to copying flexibility and accuracy requirements, which command can be determined. Tar command will file and directory tree To copy it into a single tape, note: The tar command of SunOS 5.x can access special files (block devices, character device file FIFO files) but SUNOS 4.x's tar commands cannot access such files, CP Portability of the IO command is better. The cpio command is used to copy any file, special file, or file system that needs multi-volume tape, or it can be used to copy files in the SunOS 5.x system to the Sunos 4.x system, the cpio command is more efficient than the tar command. The data is loaded into the tape, and the bad area on the tape can be read, and the cpio command also provides the selection of different format heads (TAR, USTAR, CRC, DOC, BAR) when writing files to ensure different types. Portability between the system. Since the TAR and CPIO commands use the original device, it is not used to format or create new file systems to the tape before use, which use the tape drive and device names depend on the hardware and system configuration. 3.1.1 Naming Custom Tape Equipment for Tape Equipment Naming Habits Use Logic - rather than physically devices, tape machines are divided into two categories: •; Xylogics472 class, 1/2 inches installed on the rack ( Top loading) Reel to reel type drive (up to 4 drives per controller). •; SCSI class, 1/4 inch cassette, 1/2 inches frontally loaded into the roller, and 4mm or 8mm spiral scan drivers, (each control is up to 8 drives). In / dev / rmt subdirectory, there is a unique set of tape device files that support different output densities, usually specify the tape drive device as shown in Figure 3.1. / dev / rmt / xan optional no-rrwind Optional N no-rrwind; Density Omit for Rewind L Low Drive M Medium 0 h high 1 U Ultra 2 3 4 N Figure 3.1 Says of the tape drive equipment Test the drive letter, density selection and Do not retrofold the choice. 3.1.1.1 Using the default density specified that the drive letter is usually specified by its logic unit number, the unit number is 0 to n, if the density is not specified, the driver is prioritized (usually pointing the highest density it supports it. )write. Indicates the first drive, you can use: / dev / rmt / 0 to specify the second drive, you can use: / dev / rmt / 1 Note: The serial number of the most device name starts from 0, so when using the first tape or When the target is 0, the number is 0 instead of 1. 3.1.1.2 Specifying density for the tape drive Sometimes the tape drive of a system can only support a certain density. When copying the tape, you need to specify a device name written in this density, use the following rules: / dev / rmt / Table 3.1 lists the drive unit and density symbol, for example, indicating the first (0) driver using a medium-density raw tape drive, using: / dev / rmt / 0m Table 3.1 Driver unit and density symbol in the tape device name Equipment name = / dev / RMT / tape drive number (number), 0-n, independent density with the controller type (character), depending on the controller and drive type NULL default, priority (highest) density L is low M Secret H High Mini UEglement (ULTRA) 3.1.1.3 Specifying the "Do not ride" option command execution unless "non-riding" option as part of the device name, the tape drive will automatically rewind, specify "no With the option, just add "N" in the end of the device name. Such as: / DEV / RMT / 0MN 3.1.1.4 Different tape controller and media device name abbreviations, SCSI and non-SCST tape drives, SCSI controllers can be used with 8 SCSI tape drives, non-SCSI control At most 4 tape drives, the density symbols depend on the controller and drive type described later for a drive number (X). Table 3.2 Lists the device abbreviations of different tape controller drivers and media. Note: The driver number in the device abbreviation is not necessarily listed 0, can be 1, 2 or 3, etc., depending on how many tape drives are connected to the system. Table 3.2 Tape Controller / Drive and Media Equipment Name Abbreviation Controller Drive Unit Size Type Format Channel Device Abbreviation XYLOGICS 472 Fujitsu 1 / 2INCH Wound 1600BPI 9 / DEV / RMT / 0M M2444 1 / 2INCH Wound 800bpi 9 / DEV / RMT / 0H SCSI / Front Insert HP 1 / 2INCH Wound 1600BPI 9 / DEV / RMT / 0M 6250BPI 9 / DEV / RMT / 0H SCSI Sysgen 1 / 4INCH Case QIC-11 4 / DEV / RMT / 0L QiC-24 4 / DEV / RMT / 0M QIC-11 9 / DEV / RMT / 0L QIC-24 9 / DEV / RMT / 0M EMULEX 1 / 4INCH Case QIC-11 4 / DEV / RMT / 0L MT-02 QIC -24 4 / DEV / RMT / 0M QIC-11 9 / DEV / RMT / 0M QIC-24 9 / DEV / RMT / 0M Archive 1 / 4INCH Case QIC-150 18 / DEV / RMT / 0H QiC-15o Wangtek 1 / 4INCH cartridge QIC-150 18 / DEV / RMT / 0H QIC-150 Desktop 1 / 4INCH box QIC-150 18 / DEV / RMT / OH Backup Pack 3.1.1.5 1/2 inch wound non-SCSI interconnection ( Rack mounted) Tape machine This type of tape drive, whether TapeMaster or XYLOGICS472 controller, the device name / dev / rmt / xa is selected based on the density item in Table 3.3. Table 3.3 Specified Density Symbol Density NULL Default Density (6250BPI Non-compressed) 1800 BPI M1600 BPI H6250 BPI U6250 BPI, compression If the density symbol is saved, then the highest density of the tape And do not compress. 3.1.1.6 1/4 inch SCSI cassette and 1/2-inch front loaded wound tape drive For this type of tape drive, its device name (/ DEV / RMT / XA) represents the density A item based on Table 3.4. Table 3.4 Specified format and density character density (1/4 inch cassette) density (1/4 inch front load) NULL Default maximum density default highest density L QiC-11 format 800bpi M QiC-24 Format 1600BPI L QIC-150 6250BPI u Reserved For 1/4 inch cassette, density is the format of write data - QiC, QiC-11 and QiC-24 format tracks per inch About 1000 bytes, the QiC-150 is higher, the preferred density of 60MB 1/4 inch cassette machine is QiC-24, 150MB 1/4 inch cassette tape is QiC-150.150MB tape drive. You can only write according to the QIC-150 format, and cannot be written according to the QiC-24 or QIC-11 format. The selection of the format can only be meaningful according to the QiC-24 and QiC-11 tape drive. 3.1.1.7 Soot Scanning Belt Machine Soot Scanning Menue (for example: exabyte 8mm or Wang / Dat 4mm) is a special SCSI tape drive, which is only written according to the designated density, so it usually only needs to specify them through the magnetline number. For example: / dev / rmt / 0 3.1.2 Read and write tape command The following describes the command 3.1.2.1 Tightening the tape if the tape is pulled, it can be tightened to tighten the tape machine. Reread again. GTXA% MT -F / DEV / RMT / 1 RETENSION GTXA% 3.1.2.2 Type N tape drives specified by MT -F / DEV / RMT / REWIND. In the following example, the / DEV / RMT / 1 is reversed: GTXA% MT -F / DEV / RMT / 1 REWIND GTXA% 3.1.2.3 lists the MT-F / DEV / RMT / STATUS can be displayed Tape machine Status This example shows no tape in the tape drive / DEV / RMT / 1: gtxa% MT -F / DEV / RMT / 1 STATUS / DEV / RMT / 1: No Tape Loaded or Dri Offline gtxa% in this case , Show / DEV / RMT / <1>: gtxa% MT -F / DEV / RMT / 1 STATUS Archive QIC-150 TAPE DRIVE: SENSE Key (0x6) = Nuit Attention Residual = 0 Retries File No = 0 Block NO = 0 GTXA% 3.2 Tape and floppy disk operation 3.2.1 Tar command The following sections How to use the tar command to copy the file into the tape and list files from the tape, add files, and read files. 3.2.1.1 To the Tape Writing File (TAR) Reproduction to the Magical Paper: 1, enter the directory containing the desired file; 2. Insert the magnetic tape of writes to the tape drive; 3. Type TAR CVF / DEV / RMT / Note: Use the C options to destroy the original files on the tape. If you want to protect the original file on the tape, you will need to use the "R" selection option later to attach a file. The C option indicates that the file specified by the copy (Verbose) indicates that the file information is displayed during the copy, and the Files will be added to the tape device name, specify where the file is copied, and the file is copied to On the tape, the original file is covered on the tape. Note: You can use metamodes (? And *) as part of the file name. For example, in order to copy all files with a .doc suffix, type * .doc in the file name section, if the specified file name part is a directory name, then this directory and all the subdirectories are copied into the belt. 4, remove the tape from the bullet machine, fill in the label. In the following example, two files are copied into the magnetic tape GTXA% CD / home / winsor gtxa% ls evaction. Doc. On the 0-EvaluP gtxa% TAR CVF / DEV / RMT / 0 EVALUATION. * a Evaluation. DOC 86 Blocks a Evaluation. DOC Backup 84 Blocks GTXA% 3.2.1.2 List the files (TAR) on the tape lists the files on the tape according to the following column: 1, insert the tape into the tape drive; 2, type tar Tvf ./dev/rmt/ T option (Table) Represents the specified file, V option (vevbose) indicates that the file information is displayed in the LS -L, and the F Options (files) indicates after this option. The tape drive device name represents the device where the file is located. The contents of the magic tape amsenated in the 0 tape drive are gtxa% TAR TVF / DEV / RMT / 0 RM-RM-RM-6693/10 44032 APR 23 14:54 1991 Evaluation. DOC RM-RM-RM-6693 / 10 44008 APR 23 14:57 1991 Evaluation. DOC. BACKUP GTXA% From left to right, the first column of the above information Displays file access rights, the second column shows the owner and group of the file, the third column display file Bytes, fourth, fifth, sixth, seven columns are the month, day, time and year number of the file, day, time and year, the last column is the file name. 3.2.1.3 Adding a file (TAR) to the tape (TAR) According to the following steps, you can copy into the file and do not damage the tape. The original content: 1. Enter the subdirector of the copy file; 2, insert the tape with write permission into the tape drive; 3. Type TAR RVF / DEV / RMT / ...... The specified file is copied into the specified tape; Note: You can use metamorphic characters (and *) as part of the file. For example, copy all files with a .doc suffix, simply type * .doc in the specified file name section. 4, remove the tape from the bullet machine, fill in the label. In the following example, add files to the tape in the 0 tape drive: gtxa% CD / Home / Winsor gtxa% TAR RVF / DEV / RMT / 0 JUNK A JUNK 1 Blocks gtxa% TAR TVF / DEV / RMT / 0 RM- RM-RM-6693/10 44032 APR 23 14:54 1991 Evaluation. DOC RM-RM-RM-6693/10 44008 APR 23 14:57 1991 Evaluation. DOC. Backup RM-RM-RM-6693/1018 DEC 10 11 : 36 1991 JUNK GTXA% TAR command Using n option (no ride), allow users to copy files to the tape multiple times, for example: After copying the file, the next time I use this tape copy, The file is written behind the previous copy. 3.2.1.4 Decompose the file (TAR) 1 from the tape (TAR) 1, enter the subdirectory of the document; 2, insert the tape into the tape drive; 3. Type all the files on TAR XVF / DEV / RMT / tape to copy to the current directory . In this case, the magnetic tape content in the 0 tape is all copied: GTXA% CD / Home / Winsor / Evaluation GTXA% TAR XVF / DEV / RMT / 0 x Evaluation.doc, 44032 Bytes, 86 Tape Blocks x Evaluation.dos . backup, 43008 BYTES, 84 TAPE BLOCKS GTXA% Decomposing individual files from tape, just type TAR XVF / DEV / VMT / ..., specify files, copy out from the tape, and put it in the current directory, In this case, the prefix is a copy of the Evaluation file from the tape drive from the top 0: GTXA% CD / Home / Winsor / EEALUATION GTXA% TAR XVF / DEV / RMT / 0 Evaluation * X Evaluation.doc, 44032 Bytes, 86 Tape Blocks X Evaluation.dos, Backup, 43008 BYTES, 84 TAPE BLOCKS GTXA% The following steps indicate how to extract the entire subdirectory from the tape: 1, enter the directory of want to place the file, if the subdirectory that is copied, then it should be entered In the parent catalog of the subdirector, it should be ensured that the content in the atomic directory can overwrite, for example, in the tape, you should type the CD / Home / Sinsor; TAR XVF / DEV / RMT / Book, if you enter the / home / winsor / book, you will copy it in / home / winsor / book / book. 2. Type TAR XVF / DEV / RMT / then recursively copy out from all the subdirectories. Note: The file name that is copied from the tape is the name of the document file. If the name is unclear, you can list the file name on the tape, step more, "List the file (tar) on the tape" or tar (1) Manual. 3.2.2.2cpio Command When establishing a tape document using the CPIO command, it acquires a string file or path name from the standard input device, and then writes them on the standard output device, and the output is usually reversed to the file or device, and how to use the cpio command Use the file into the cassette tape, list the cassette file, and the subset of files on the tape. 3.2.2.1 Disproportionate all files in a directory Reproduces all files in a directory into the tape in a directory: 1, insert the tape with write permissions into the tape drive; 2, type LS L CPIO -OC > / dev / rmt / When all files in the directory are copied into the tape in the specified tape drive, cover the files on the tape, display the number of copies of the total block; 3, remove the tape, fill the label. In the following, the files of the / home.winsor / toi directory are copied into the 0 tape drive. GTXA% CD / HOME / WINSOR / TOI GTXA% LS -1 CPIO-IC> / DEV / RMT / 0 31 Blocks GTXA% 3.2.2.2 List of files (CPIO) on the tape is inserted by the following steps: 1, insert the tape into the tape Machine; 2. Type CPIO -CIT dev / rmt / where i option is self-tape read (IN) content, V option imitation LS -L format list file; T option lists the list of tapes in the specified tape drive. Note: The time used by the CPIO command list is as long as the time to read the entire document, because the cpio command needs to traverse the entire document. In this example, the magnetic belt in the 0 tape drive has four files: gtxa% CPIO -CIT dev / rmt / 0 100666 Winsor 3895 Feb 24 15:13:02 1992 Boot.chapter 100666 Winsor 3895 Feb 24 15: 13:23 1992 Directory.Chapter 100666 Winsor 6491 Feb 24 15:13:52 1992 Install.chapter 100666 Winsor 1299 Feb 24 15:14:02 1992 Intro.chapter 31 Biocks GTXA% The first column is an access authority indicated by an octa; The second column shows the file owner; the third column lists the number of bytes of the file; the fourth, five, six, seven columns display the last change of the file, day, time, and year; the last column is the file name. 3.2.2.3 Decanition Tape All Files (CPIO) If (Tape) Document is established using the relative path name, enter the file in the current directory, if the document is established using the absolute path name, then the same absolute path Regenerate this file. Note: Use absolute path names to copy tape files to be dangerous because this will overwrite the original files in the file system. Copy files according to the following steps: 1, enter the subdirectory to be placed; 2, insert the tape into the tape drive; 3. Type the CPIO -ICV GTXA% CD / HOME / WINSOR / BOOK GTXA% CPIO -ICV "* chapter" Boot.chapter Directory.chapter Install.chapter Intro.chaoter 31 Blocks GTXA% For more details, please refer to the CPIO (1) manual. 3.2.2.5 Soft Dish This section describes the use of double-sided (DS) high-density (HD) 3.5-inch floppy disk, which must format the floppy disk before copying UFS files or file systems on the floppy disk, copy UFS file into a single floppy disk Table needs to use the tar command; if you copy to multiple flopers, CPIO should be used. The CPIO command can find that the media has been used and reminds the user into the next disk. You can also create a DOS file system on a floppy disk. To use a floppy disk in a DOS format, you can put the floppy disk as a PCFS file system, and then use the basic OS command such as CP, MV or so on to save / take the file. 3.2.3 Soft Purdish Equipment Soft Drive Device Name in SunOS 5.x System Software Compared with the former Version, the current floppy drive device is named / dev / diskette; the original device file named / dev / rdiskette . 3.2.4UFS File System Soft Dish This section describes how to format the floppy disk for UFS files, and how to use TAR and CPIO commands to copy files, and describe how to copy out the files created using the bar command in SunOS 4.x. 3.2.4.1 Formatting UFS Floppy SUNOS 5.x UFS file The floppy disk used by the UFS file is formatted by the following steps: 1. Remove the floppy disk write protection; 2, put the floppy disk into the floppy drive; Note: Reformatize all original files on the floppy disk . 3. Type FDFormat, show "Press Return to Start Formatting Floppy" 4, Enter, start formatting floppy disk, a series of points (...) When formatting, reproduce the prompt . Press Return to Start Formatting Floppy .. ........................................ ................ gtxa% 3.2.4.2 Remove the floppy disk in the soft disk Since the floppy drive to remove the floppy disk To use the eject command, the eject command is also used to use the CD-ROM disk from CD- Take it in the ROM drive, without parameters, use / dev / diskette as the default value parameter, type the eject command, then the floppy pops up. Note: If the flopp is not available, you can take it out by manual, and the method is inserted into the holes below the disc. 3.2.4.3 Copying UFS files into a single formatting Flip Panker This section describes the TAR command, pay attention to the TAR command is the original device name / dev / rdiskette. 1. Enter the directory where you want to copy the file; 2, will remove the write protection and format the floppy disk inserted; Note: Use the C option to destroy the original data on the floppy disk, if you want to protect the original data, you should use it The R option is said. 3. Type TAR CVF / DEV / RDISKETTE ... Specify the file to copy it into the floppy disk and overwrite the original file. Note: Emix characters (? And *) can also appear in the file name, which is used to copy multiple files. 4. Type EJECT to remove the floppy disk from the floppy drive; 5, fill in the floppy disk label. In the following example, copy the two files in the floppy disk: gtxa% CD / home / winsor gtxa% ls evaction * evataration, docevaluation.doc.backup GTXA% TAR CVF / DEV / RDISKETTE EVALUATION * A Evaluation. DOC 86 Blocks a Evaluation. DOC. Backup 84 Blocks GTXA% Eject GTXA% 3.2.4.4 Lists the files on the floppy disk: 1, insert the floppy disk into the floppy drive; 2. Type the TAR TVF / DEV / RDISKETTE T option indicates the file on the floppy disk. . The floppy disk in the following example contains 2 files: gtxa% TAR TVF / DEV / RDISKETTE RW-RW-RW-6693/10 44032 APR 23 14 54 1991 Evaluation.DOC RW-RW-RW-6693/10 44008 APR 23 14 47 1991 Evaluation.doc.Backup GTXA% Detailed in TAR (1) Manual, while copying multiple floppies should use CPIO, TAR is only available for single floppy disks. 3.2.4.5 Additional files (TAR) to a formatted floppy disk according to the following steps, can ensure that the original files on the floppy are not overwritten; 1, enter the directory containing the desired copy; After the floppy disk is inserted into the floppy drive; 3. Type TAR RVF / DEV / RDISKETTE ... Specify files to attach to the original file on the floppy. Note: The file name is allowed to appear or * such a character. 4. Type the EJECT to remove the floppy disk. 5, fill in the floppy disk label. In the following example, an additional file to the floppy disk: gtxa% CD / home / Winsor gtxa% Tar RVF / DEV / RDITTTTTE JUNK A JUNK 1 Blocks GTXA% Tar TVF / DEV / RDITTE RW-RW-RW-6693/10 44032 APR 23 14 54 1991 Evaluation.doc RW-RW-RW-6693/10 43008 APR 23 14 47 1991 Evaluation.doc.Backup RW-RW-RW-6693/1018 DEC 10 11:36 1991 JUNK GTXA% EJECT GTXA% 3.2. 4.6 From the floppy disk to copy the file (TAR) 1, enter the directory to store the file; 2, insert the floppy disk into the floppy drive; 4. Type the eject command, remove the floppy disk in the soft drive. All files on a copy of the floppy disk: gtxa% CD / home / Winsor / Evaluation GTXA% TAR XVF / DEV / RDISKETTE X Evaluation.doc, 44032 Bytes, 86 Tape Blocks X Evaluation.dos.Backup, 40008 BYtes, 84 Tape Blocks GTXA% EJECT GTXA% TAR XVF / DEV / RDISKETTE ... Command is copied from the floppy disk, and in the following example, copy all prefixed for Evaluation: gtxa% CD / Home / Winsor / Evaluations GTXA% TAR XVF / DEV / RDISKETTE Evaluation * X Evaluation.doc, 44032 Bytes, 86 Tape Blocks X Evaluation.dos.Backup, 43008 Bytes, 84 Tape Blocks GTXA% Eject GTXA% 3.2.4.7 Since the floppy disk is copied out of Bar format The bar command in the file (CPIO) SUNOS 4.x has been canceled in SunOS 5.x. In the original SunOS 4.x in the floppy disk is an archive file, it can be copied under SunOS5.x, which is used. CPIO command plus the - h bar selection item. Note: You can only copy the file with the -H bar plus -i option, instead of using this option to create BAR files, it is best to list the floppy content before copying. 1. Enter the directory to copy the file; 2, insert the floppy disk into the floppy drive; When the cpio command reminds the user's current floppy disk, then change a formatted empty disk, and the option used in the previous "CPIO command is used", these options are the same as copying, only You need to change the front of the tape drive device name to / dev / rdiskette. 3.2.5.1 Creating a UFS file system on a floppy disk (Newfs / dev / rdiskette) If you want to install a UFS floppy disk, you must first create a file system: 1, format the floppy disk; 2, enter the super user status; 3, Type newfs / dev / rdiskette, just create a UFS file system on the floppy disk, GTXA% fdformat press return to start formatting floppy. ................................................ .............. gtxa% Su Password: #NewFS / DEV / RDISKETTE # 3.2.6PCFS (DOS) File System Floppy Pan by PCFS (DOS) File System Formatted Floppy Dish available for DOS System, what is described below how to format the DOS floppy disk, and see Chapter 4 of the PCFS file system. 3.2.6.1 Formatting the PCFS (DOS) file system floppy disk formatted this floppy disk, you need to step by step: 1, insert the floppy disk into the floppy drive; Note: Reformatting will destroy the original data on the floppy disk! 2, type fdformat -d display " Press Return To Start Formatting Filppy "3, typing Enter, formatting, the system displays a series of small dots, after formatting, the prompt is displayed. GTXA% fdformat -d press return to start formatting floppy. .................................... ......................... GTXA% 3.2.6.2 Installing the PCFS floppy disk can be installed using the fdformat -d command formatted floppy disk, or Installing the PCFS floppy disk formatted under the DOS system, you can use the SUNOS utility after installing the PCFS file system, write, write, create, delete, but naming, but the file naming, the format of the PCFS file system, You can check the PCFS (7) manual. Install the PCFS file system on the floppy disk, the method is as follows: 1. Insert the floppy disk into the floppy drive; 2. Enter the super user mode; 3. Type the Mount -f PCFS / DEV / DISKETTE file system to install the specified installation point. A PCFS file system can be installed in different installation options (for example: -orw), and various options are detailed in detail in the Mount-PCFS (1M) manual. If you frequently use the PCFS floppy disk, you can add as follows: / dev / distribte-pcfs PCFS-NO RW to create a / PCFS directory, as a floppy disk installation point, if the installation point writes / etc / vfstab The user can type Mount / PCFS in the super user to install the PCFS floppy disk, once the PCFS floppy is installed, you can use all SUNOS utilities, such as CP or MV to copy the files on the floppy disk. 3.2.6.3 Removing the PCFS floppy disk After using the PCFS floppy disk, you must first remove its system, you can remove the floppy disk with EJECT, type Umount to complete the disassembly, type the eject command, floppage popup. 3.3 Hard Disk Naming Management The following sections describe the SUNOS 5.x hard disk name habits, find commands for hard disk information (DU, PRTVTOC), and how to fix and replace bad discs. 3.3.1 Hard Disk Naming Habit SUNOS 5.x Different from SunOS 4.x, this section explains new naming conventions, named logical (rather than physically) devices, SUNOS 5.x hard drives, At the same time, there is a name of the device and the original device file, regardless of whether the command is required to block the device file or the original device file, the device name is the same. SunOS 4.x requires that there is no R, SunOS 5.x, without this requirement, in the latter, each type of device file has its own subdirectory under / DVE: / DVE / DSK (block device Interface), / dev / rdsk (original device interface). Commands such as mount require the block interface device name in the / dev / dsk directory to specify a hard disk device, and newfs and other commands use the original interface device name in the / dev / rdsk directory to specify the hard disk device. Specifies which interface to use when the hard disk device name depends on the controller type based on the bus (SCSI or IPI) or direct. 3.3.1.1 Using the hard disk with a bus controller Figure 3.2 lists the hard disk name habits of the bus controller. ━━━━━━━━━━━━━━━━━━━ c c━━━━━━━━━━ c c c c━ c c c c (0 to 7) Y Drive Number T Physical Bus Target Number C Logical Controller Number ━━━━━━━━━━━━━━━━━━━━━━ 图 图 图 图 图 图 图 图 图 图 Figure 3. Dark Disk Naming Habit of Bus Controller A partition with a hard disk with a bus controller (SCSI or IPI), which can specify the device name: / dev / dsk / cwtxdysz (block interface) or / dev / rdsk / cwtxdysz (raw interface). Note: SunOS 5.x uses the word "slice" to represent a slice (represented by "S" in the device name), in fact, "film" is the other name of the hard disk partition. ━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━ 表 表 表 Table 3.6 Table 3.6 Table Distance Drive Hard Disk Equipment Name Example Device Name Description / DEV / RDSK / C0T0D0S0 The original interface corresponds to the first The first hard disk of the first hard disk of the first SCSI target address of the controller (root) / dev / rdsk / c0t0d0s / DEV / RDSK / C0T0D0S2 corresponds to the first hard disk of the first SCSI target address of the first controller. The third piece (indicating the hard disk) / dev / rdsk / c0t1d0s6 The original interface corresponds to the first disk of the first controller's second SCSI target address, the first disk of the first disk (/ usr) ━━━━━━ ━━━━━━━━━━━━━━━━━━ 下 下 下━ 下 下 下 下 下 ━ 下 一些 确 确 确 确 设备 设备:: •; If there is only 1 controller in the system, then The value of w is usually 0; • For the SCSI controller, X is the target address set by the rear switch of the component; •; Y is the drive letter connected to the target, if the controller of the hard disk is embedded, Then Y is 0; •; z is a slice (ie, the partition number), when the code is 0 to 7, when the entire hard disk is specified, the value is 2, and Table 3.5 lists the regular assignments of the partition on the hard disk with the root zone. ━━━━━━━━━━━━━━━━━━ 表 表━━━━━━━ 表 表 表 Table 3.5 Habitat Area (Tablets) Document System for File System 0 / Root file system 1 SWAP virtual memory space 2 - Whole hard drive 6 / USR executable program, program and document ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━ 3.3.1.2 Use the hard disk of the direct drive with a direct drive hard drive, there is no target item in the device name, specify the tablet of this hard disk (partition): / dev / dsk / CXDYSZ / DEV / RDSK / CXDYSZ (original interface). Figure 3.3 Indicates a naming convention for the hard disk of the direct controller, if the system has only one controller, then x is 0, using the second piece to represent the entire hard disk ━━━━━━━━━━━━━━━━━━━━━ c━━━━━━ l l l l c c l l (¢ To 7) Y Drive Number Z Longical Controller Numver ━━━━━━━━━━━━━━━━━━━ 图 图 图 图━━━━━━ 图 Figure 3.3 Direct Controller Hard Disk Naming Table 3.7 lists a few Direct controller The original device of the hard disk is named ━━━━━━━━━━━━━━━━━━━━━ 表 表 表━━━━━━━━ 表 Table 3.7 Direct controller hard disk device name device name Description / DEV / RDSK / C0D0S0 corresponds to the first hard disk of the first hard disk of the first controller, the first hard disk of the first controller corresponds to the first hard disk of the first controller ( The original interface of the entire hard disk / dev / rdsk / c0d1s6 corresponds to the first controller and the second hard disk of the seventh (/ usr) of the second hard disk, ━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━ 3.3.2 Check the hard disk usage to type DU can detect each file or directory, accounting for how many 512-bytes of hard disk blocks, if a directory contains The subdirectory, the contents of the subdirectory are also counted when the number of pieces is calculated. GTXA% du 2913 ./3.0Templates 639 ./srt 347 ./clipart 607 ./newtemplates 38 ./modemstuff 2004 ./config/art 6593 ./config 13280 GTXA% The output in the above example 512 bytes The block is in units, wants to change the megabytes (MB), which should be divided in 2048, in the first example, 13280/2048 = 6.48 mB. You can also list the output results in K -K using DU -K, using DU -S, only listing the total space size without column detail. 3.3.3 Checking the hard disk information (PRTVTOC) PRTVTOC command only effects on the partition of the allocated space, otherwise the error message of "No Such Device or Address" is displayed, and the standard partition naming agreement is displayed, then the second piece is displayed. The content of the hard disk. 1. Be superuser 2, type PRTVTOC / DEV / RDSK / CWTXDYSZ to display the specified hard disk information. gtxa% su Password: gtxa # Prtvoc / dev / rdsk / c0tld0s2 * / dev / rdsk / c0t1d0s2 Partition map * * Dimensions: * 512 byres / sector * 35 sectors / track * 6 tracks / cylinder * 210 sectors / cylinder * 1019 cylinders * 974 sccessible cylinders * * Flags: * 1: unmountable * 10: read-only * * First * Partition Tag Flags Sector 0 0 00 0 1 0 00 24150 2 0 00 0 6 0 00 74550 Sector Last Count Sector Mount Directory 24150 24149 50400 74549 204540 204530 129990 204539 What to repair bad hard drives or reload new hard drives 3.3.3.1 if the hard drive is broken if the hard disk is broken, then you can do ufsdump on the hard disk. See Chapter 4 for Ufsdump Commands. 3.3.3.2 Disproportionate the hard disk to the hard disk, if you can't run UFSDump on the hard disk, find a similar type hard disk, join the system, use the DD command to copy out the data on the bad disc, DD (1M) manual for DD (1M) manual. 3.3.3.3 Repairing bad blocks If there is a bad block on the hard disk, use the format command to fix the bad block on the disk, and the usage of the format command see the Format (1M) manual. 3.3.3.4 Ref formatting the hard disk If there is a bad block on the hard disk, reformat sometimes solve the problem, format the command of the hard disk is format, please see the format (1M) manual, please remember the formatting the hard disk will destroy the disk. All of the above data. 3.3.3.5 Replace the old hard disk If you resolve the problem, if you don't resolve the problem, you will find this bad hard drive, see the hard disk installation manual. 3.3.3.6 Join the Error Table Format, Partition, and Mark the hard disk to form the error table, format the hard disk, partition the hard disk, and mark the hard disk on the new hard disk. Note: Only the hard disk can be formatted after the error table, formatting the data on the hard disk is broken, so if the hard disk is not new, it must ensure that the data backup will be backed up before formatting. 1, becoming a super user; The Format menu of the prompt; 4. Type DEFECT 5. Type the original error table is added to the hard disk; Defect> Primary Extracring Primary DRFECT LIST ... Extraction Complete. Current Defect List Updated./ Total of 30 DefDCTS. 6 Type Quit Back to Format> Promatuer 7. Type Format to start formatting the hard disk, a hard disk formatted for 10MB of hard drive for 10 minutes, the greater the hard disk capacity, the longer formatted time; 8, when Format> prompt appears again Type partition 9, rebuild partitions matching the partition of the corrupted hard disk; 10, type the Label hard disk is tagged; 11, type quit back to the Format> prompt; 12, type quit back to the shell prompt under. GTXA% Su Password: #Format Searching for Disks ... DONE EXTRACTION Complete. of 30 Defects. Available Disk Selections: O.SD0 At ESP0 SLAVE 24 SD0: 1.SD0 AT ESP0 SLAVE 16 SD2: Specify Disk (Enter ITS Number) : 1 selecting c0t0dd0 [disk formatted] formAT MENU: disk -select a disk type'-select (define) a disk type partition'-select (define) a partition table current'-describe the current disk format'-format and analyze the disk repair'-repair a defective sector label-write label ti the disk analyze'-surface analysis defect'-defect list management backup'-search for backup labels verify'-read and display labels save'-save new disk / partition defintions inquiry '-show vendor, product and revision volname'-set 8-character volume name quit format> defect defect> primaty Extracting primary defect list ... Extraction complete. Current Defect list updated.total of 30 defects. defect> quit format> format Format> Partition Partition Menu: 0. - Change'1'partition 1. - Change' 2'Partition 3. - Change'3'Partition 4. - Change'5'Partition 5. - Change'5'Partition 6. - Change'6'Partition 7. - Change'7Partition Select - SELECT A PREDEfined Table Modify - Modify A Predefined Partition Table Name - Name THE CURRENT TABLE PRINT - Display The Current Table Label - Write Partition Map and Label To The Disk Quit Partition> Partition> Label Partition> Quit Format> Quit # 3.3.3.7 Rebuilding File System (Newfs) Hard Disk has been formatted, After the partitioning and tag, the UFS file system can be established above. When rebuilding the originally existing UFS file system, you must first remove this system (unmount). Rebuilding the file system requires the following steps: 1, becoming a super user; 2. Type the newfs / dev / rdsk / cwtxdysz system question continues. Note: The partition number in the device name must be guaranteed correctly, otherwise it will be deleted in other partitions. 3. Type "Y" confirmation, the newfs command creates a file system using the optimized default value. The following example creates a file system on / dev / rdsk / c0t3d0s7. GTXA% Su Password: #NewFS / DEV / RDSK / C0T3D0S7 Newfs: Constuct A New File System / DEV / RDSK / C0T3D0S7 (Y / N)? Y / dev / DRSK / C0T3D0S7: 163944 SEOTORS IN 506 CYLINDERS OF 9 TRACKS, 36 SECTORS 83.9MB IN 32 CYL Groups (16C / g, 2.65MB / g, 1216i / g) Super-block backups (for FSCK-B #) AT: 32. 5264. 10496. 15728. 20960. 26192. 31424. 366656. 41888. 47120. 52352. 578584. 62816. 68048. 82976. No. 88672. 103904. 109600. 114368. 119600. 124832. 140528. 145760. 150992. 156224. 161456. # 3.3 .3.8 In the Interim Mounting Point Installation File System (Mount) Type the mNT / DEV / DSK / CWTXDYSZ / MNT file system to install the hard disk, use the block device directory (/ dev / dsk), not Original device catalog. 3.3.3.9 To file system dump files (UFSRESTORE) The following steps are used to restore the latest complete backups and then restore incremental backups by the lowest level to the highest level. 1. Type CD / MNT; 2, place the tape in the write protection state; 3, insert the first volume of the 0-stage tape into the tape drive; 4, type UFSRTORE RVF / DEV / RMT / if there is a multi-volume tape to recover, then Insert the lower roll when prompted, then restore the 0-level tape; 5, remove 0 tape, insert the next lowest level tape, remember to restore from the 0-level tape until the highest level; 6, type UFSRTORE RVF / DEV / RMT / then the next level of tape is restored; 7, repeat steps 5, 6; 8, type the LS command; 9, display the file and directory list, confirm that all files have been restored; 10, type RM Restore SymTable deletes the RESTORE SYSMTABLE file created for recovery. 3.3.3.10 Self-Temporary Point Removal File System (Umount) The method is as follows: 1. Type CD / 2, type Umount / MNT to remove the file system from temporary installation. 3.3.3.11 Checking the Volume of File System (FSCK) Type FSCK / DEV / RDSK / CWTXDYSZ This command checks the file system consistency. 3.3.3.12 Do a 0-level backup of the recovery file system Since the UFSRESTORE command changes the location of the file and the allocation of Inode, the new file system should be backed up immediately. 1. Insert a new tape with write permissions into a tape drive; Patch and can be used. Chapter 4, File System Management This chapter will introduce: the type of file system, the default SunOS 5.x file system, virtual file system table (/ etc / vfstab), file system management command, how to make file system valid, test file System Data Consistency (FSCK), backup and recovery file system file system is a directory structure used to find and store files, and the term file system can have the following different meanings: • Describe the entire file down by the root directory Tree?; Describe the specific type of file system: disk file system, network file system, and pseudo file system?; Describe the data structure of the hard disk and other storage devices?; Describe some of the file trees installed in the main file tree Structure usually you can use the context to determine which meaning is specifically. SunOS 5.x system software adopts a virtual file system (VFS) structure, which provides a standard interface for different types of file systems. When the core handles basic operations, such as read, write, list files, etc., no user Or the program knows the specific file system type. The file system management command provides a public interface that can be used to manage different types of file systems, the file system management command consists of two parts: ordinary commands and special commands for each class of file systems, the ordinary commands apply to large orders Most file systems, special commands only apply to a certain type of file system. One of the important tasks of system management is to manage SunOS 5.x file systems, understand complex file systems for more efficient management of file systems, this chapter describes the following: * File system type * Default SunOS 5. X File System * Virtual File System Table (/ ETC / VFSTAB) * How to make the user's local and remote file system valid * Backup and Recovery File System 4.1 File System Type SunOS 5.x System Software Support Three Types of File System: * Disk file system * Network file system * Pseudo file system 4.1.1 Disk file system disk file system stores in physical media such as hard disk, CD-ROM, and floppy disk, and disk file system can use different formats to read and write operations, these The format is: * UFS, UNIX file system (Based on the BSD FAT File system, the BSD 4.3 TAHKE version is provided), which is the default disk file system in the SunOS 5.x system software. * HSFS, High Sierra and ISO9660 file system, High Sierra is the first CD-ROM file system, ISO9660 is an official standard, HSFS file system is used on CD-ROM, is read-only file system, SunOS 5.x HSFS support Rockridge extensions, this extension provides all UFS file system semantics and file types other than programability and hard links. * PCFS, PC file system, the file system can access data and programs on the DOS format floppy disk on the microcomputer. In the SunOS 5.x system software, there is no traditional System V (S5) file system provided by the system V version, because this file system is up to 64,000 files; the file name is up to 14 characters and allocation Limits such as quota. Each type of disk file system is typically corresponding to a particular storage medium: * UFS corresponds to the hard disk and other media (eg tape, CD-ROM, floppy disk): * HSFS corresponds to CD-ROM * PCFS corresponds to these correspondence with the floppy disk, such as: UFS file system can also be installed on a CD-ROM and a floppy disk. 4.1.2 Network File System Network File System refers to a file system that can be accessed through a network. The typical network-based file system refers to a file system installed on a system, and can be accessed by other systems. The system is: •; NFS ---- network or distributed file system •; RFS ---- Remote file sharing Sunos 5.x default distributed file system is NFS. Managing distributed file systems is implemented by shared file systems (output from server output) or to implement file systems into each system, see "Enable File System Valid" section. 4.1.3 Pseudo File System Pseudo File System is a virtual or memory-based file system, which provides access to special core information and functions, and the pseudo file system does not require file system disk space, some pseudo file systems can use physical disks. Exchange area, such as a temporary file system. 4.1.3.1 Temporary File System (TMPFS) Temporary File System (TMPFS) Use the local memory to read and write, so the file that accesses the TMPFS file system is much faster than the file in the UFS file system, the temporary file system The file is not permanent, when the file system is removed, when the system is turned off or restarted, they are automatically deleted. The default file system type in the SunOS 5.x directory is TMPFS. Like the UFS type / TMP file system, you can copy or move to the TMPFS class / TMP file system, or copy it from it. Other directories. The TMPFS file system saves the overhead of this site or network read and write temporary files, so that system performance is improved, such as compiler generation, generating a lot of temporary files, when using these files, the operating system generates a large number of disks or network inputs and Output request, use the temporary file system to save these temporary files in advance, which can significantly speed up the speed of the file creation, access, and delete. The TMPFS file system uses the exchange area as a temporary storage area. If there is no sufficient switching area with a TMPFS file system, it may generate the following two questions: * Like a general file, the TMPFS file system does not have accessible space; * Since the TMPFS application assignment switching area stores data (if necessary), some programs may not be executed because there is not enough switching area. 4.1.3.2 Cyclic File System (LOFS) Create a new virtual original file system, then use another path name to access files, for example, to install the / tmp / newroot directory (loopback mount), the entire file system, including any file system installed on the NFS server, looks like copying under / tmp / newroot, all files can be accessed by / started; or / TMP / NewRoot The path name starts to access, both of which until another file is installed into the / TMP / NewRoot or its subdirectories. 4.1.3.3 Process File System (ProCFS) Process File System (ProCFS) Resident in memory, and a list of event numbers in the / proc directory, the commands such as PS, the information, debugger or other development in the / proc directory Tools may also access the address and space of these processes via file system. The following example lists part of the / proc directory: gtxa% ls -l / proc total 144944 -rw ------- 1Root root 0 DEC 19 15:45 00000 -RW ------- 1 ROOT ROOT 196608 DEC 19 15:45 00001 -RW ------- 1Root root 0 DEC 19 15:45 00002 -RW ------ -1Root root 1028096 DEC 19 15:46 00073 -rw ------- 1Root root 1445888 DEC 19 15:46 00091 -RW ------- 1Root root 1142784 DEC 19 15:46 00093 -RW-- ----- 1 ROOT ROOT 1142784 DEC 19 15:46 00095. . . -rw ------- 1ignatz Staff 1576960 DEC 19 15:50 00226 -RW ------- 1ignatz Staff 192512 DEC 19 15:51 00236 -RW ------- 1IGnatz Staff 1269760 DEC 19 15:52 00240 -RW ------- 1ignatz Staff 6090752 DEC 19 15:52 00241 -RW ------ 1ignatz Staff 188416 DEC 19 15:52 00247 -RW ------- 1ignatz Staff 2744320 DEC 19 15:52 00256 Note: Don't delete the file in the proc directory, I hope you don't kill the process with the method of deleting / proc directories. For the way to kill the process, please see Chapter 1, Remember that the / proc directory does not take up disk space, so there is no need to delete files in the / proc directory, and the / proc directory does not require any system management. 4.1.3.4 Other types of pseudo file systems lists other types of pseudo file systems, and pay attention does not require these file systems. • FIFOFS named pipe files, used for public access to data. •; FDFS (file descriptor file system) provides file name open file, which is implemented by file descriptors. • NamefsStreams uses it to describe the file descriptor on the top of the file. • The Specfs (Special File System) provides access to special devices and block devices. • The file system used by the core when SWAPFS establishes an additional swap area with mkfile and swap command. 4.2 Sunos 5.x default file system SunOS 5.x files Start with the "/" root directory, expand down to a series of directory hierarchies, SUNOS 5.x system software has some default directory, and To put the same type of files together at a certain agreement, Table 4.1 describes the default SunOS 5.x file system and performs the corresponding instructions for each file system type. Default SunOS 5.x file system file system file system Type Description / UFS The top of the entire file tree (boot), the root also includes local and remote file systems to the installation point directory of the file tree. / ETC UFS includes system files for system management. / USR UFS includes system files and directories that can be shared with other users, only files on a certain system on / usr directory (such as: SPARC executable), can run files on all systems (such as : Online manuals) Place the / usr / share directory. / HOME NFS, UFS User Home Map, it stores user working files, default, / home is an automatically installed file system, in single-machine system, / home can be a UFS file system in local disks . / VAR UFS includes system files and directories that often changes and grow in the local system, including logs, vi, and em backup files, uucp files, emails, and calendar files. / OPT NFS, UFS optional mounting points for installing third-party manufacturers, in some systems, / OPT can be the UFS file system on this site. / TMP TMPFS temporary file, is cleared when the system is restarted or turned off. / Proc Procfs contains a list of system processes that are arranged in progress numbers. The root (/) and / usr file system is a must, the most basic command in the / usr file system (such as: mount) is also included in the root file system so that these commands can be used when the system starts to a single user state. 4.3 Virtual File System Table (/ etc / vfstab) Each system has a virtual file system table (ie / etc / vfstab), which lists all of the disk area file systems existing in the system, which also lists each The file installation point and options, SUNOS 4.x, the file system table is / etc / fstab, now / etc / vfstab instead of / etc / fstab, but the function is similar, the default file system configuration table ( / etc / vfstab Depending on the choice of system software installation, for each system, automatically install local UFS file systems, required NFS file systems, and other file systems by editing / etc / vfstab files. The following describes the contents of the / etc / vfstab table, and explains how to edit and use the file, the file system table is the Asscii file, the note line is # beginning, the following / etc / vfstab file description: There are two hard drives in the system, and Two NFS file system descriptions are installed. #More / etc / vfstab #device device mount fs fsck auto- mount #to mounto fsck Point Type OAESS MOUNT? OPTIONS / DEV / DSK / C0T0D0S0 / DEV / DSK / C0T0D0S0 / UFS L NO - PROC - .proc Proc - NO - / DEV / DSK / C0T0D0S1 - - SWAP - NO - SWAP - / TMP TMPFS - YES - / DEV / DSK / C0T0D0S6 / DEV / DSK / C0T0D0S6 / USR UFS 2 NO - / DEV / DSK / C0T3D0S7 / DEV / DSK / C0T3D0S7 / Files7 UFS 2 NO - CHEERS: /EXPORT/SVR4/, Man.ja5 - / USR / MAN NFS YES HARD CHEERS: / EXPORT / SVR4 / OpenWIN V3.JA4 - / USR / OpenWin NFS YES HARD # Note: / and / USR's automatic installation (Automount) domain description is NO because the system startup / and / usr have been installed before the mountAll command is run, if this value is defined as Yes, then the mountAll command tries to install it. These two file systems have been installed. The / etc / vfstab file must have a value, if no value (ie NO) must be filled with "-". / etc / vfstab file Domain Domain Description Device to Mount Installed devices include: * Local UFS file system block devices (such as / dev / dsk / c0t0s0) * Remote file system resource name (such as NFS file system MyServer: / export / home) Disk SWAP area name (such as / dev / dsk / c0t4d0s1) * / procalog and proc file system * HSFS type CD-ROM * PCFS and UFS class file system flopp / disabled DISKETTE, this The domain is also used to illustrate the SWAP file system device to fsck corresponding to the original (character) special device of the file system (for example: / dev / dsk / c0t0d0s0) of the domain description, defines the original interface used by FSCK, when there is no corresponding device Use "-" instructions, such as read-only file systems or network file systems. Mount Point Default installation point directory (such as / usr directory installation / dev / dsk / c0t4d0s6). FS Type is file system type by the domain. FSck Pass FSCK detection times, used to determine if the file system needs to be detected, does not detect the file system when the domain is "-", when the value of the domain is greater than 1, then check the file system; when equal to 0, check UFS file system, do not check the UFS file system, when the fsck is multiple UFS file system, and the fsck pass value is greater than 1, and the -OP selection is used, the FSCK automatically detects the file system on different discs with the highest efficiency parallel. When the FSCK pass value is 1, the file system is detected sequentially, otherwise the FSck pass value is invalid. When the Automount® system starts, if you need the mountAll command to automatically install the file system, it is YES, otherwise it is NO. Note that this domain is nothing relationship with the automatic installation software. Mount Options Installing the selection list of file system, which is separated by "," sign (no space), "-" instructions without option, please see the Mount- (1M) manual for the value of option. 4.3.1 Establishment of the file system entry The following to the step of establishing a file system table: 1. Enter the super user; 2, edit the / etc / vfstab file with the VI; 3, join the items. Divide each domain with a space or Tab key. If an item does not have a value, fill in "-"; 4. Save the file; 5, check if the installation point directory exists, there is no existence: change the directory to The place where you need to install then type MKDIR 6, type MOUNT This example will be installed on the consequence of the / dev / dsk / c0t3d0s7 panel as a UFS file system to install the / Test1 directory, install option (read / write) Default, FSCK device is / dev / rdsk / c0t3d0s7 character device, the fsck pass value is 2, indicating that the file system does not use sequential mode to detect #Device device mount fs fsck auto- mount #to mount to fsck point type pass mount? Options # / dev / dsk / c0t3d0s7 / dev / rdsk / c0t3d0s7 / test1 ufs 2 yes - The following example illustrates that the GTXA system's / export / man directory is installed as an NFS file system to / usr / man, does not have to be Note Fsck Devices and FSck Pass domains. In this case, the installation option is a RO (read-only) soft way, in order to improve reliability, the NFS file system read / written should be hard. #Device device mount fs fsck auto- mount #to mount to fsck Point Type Pass Mount? Options GTXA: / Export / Man - / USR / MAN NFS - YES RO.SOFT The following example Description The following example Description The following example Description The following example describes the CD-ROM to / hsfiles directory Under normal circumstances, the CD-ROM file is read-only, so the installation option should be set to RO. At present, the popular CDROM is automatically installed, so the Automount item is YES, because HSFS is read-only, so fsck device and fsck passes All are valuable. # DEVICE DEVICE MOUNT FS FSCK Auto- Mount #to mount to fsck Point Type Pass Mount? Options / DEV / DSK / C0T6D0S2 - / HSFILES HSFS - YES RO The following example Description The autitount item is valued on / pcfiles. Since the PCFS file system does not support FSCK because it is often installed and disassembled in the command line, the fsck device and FSCK Pass are all determined. #Device device mount fs fsck auto- mount #to mount to fsck point type pass mount? Options / dev / distribte - / pcfiles PCFS - NO RW The following example Description Mounting Root File System To Cyclic Mount Point / etc / Newroot, Automount Item For Yes, Fsck Device items, and fsck pass items are valued, the loop file system must be installed after constituting its file system, make sure the loop item is the last item in the / etc / vfstab file, so that it follows The back of the item is dependent. #Device device mount fs fsck auto- mount #to mount? Options / - / tmp / newroot LOFS - YES - 4.4 File Management Command This section will introduce the file system management command and its grammar rules, most The file system management command contains two parts: normal file system commands and special file system commands. Ordinary file system commands can be used together to the special file system section, Table 4.3 lists the normal file management commands, which are in the / usr / sbin directory, and most of them have a corresponding special file system command. Note: Use the special file system command directly if you use a file system that does not support, the normal command displays an error message :: Operation Not Applicable for FStype. 4.4.1 Ordinary Command Syntax Rules Most normal commands The syntax is: [-f] [- v] [] [- O] [] [OPERANDS] normal file system management command command Description CLRI (1M) Clear Inode DF (1M Report disk space, idle disk block, and file number FF (1M) lists a file name and statistics FSCK (1M) to detect a file system integrity, and fix the discovered Damage FSDB (1M) file system debugger FSTYP (1M) Determines the type of file system Labelit (1M) When the file system is copied to the tape, the reference to the file system is listed or provides the file system MKFS (1M) to establish a new file system Mount (1M) installation. File System and Remote Resource MountAll (1M) Installation File System NCHECK (1M) in the File System Table NCheck (1M) Generate Path Name List Umount (1M) Removing File System and Remote Resource UmountAll (1M) Removal File System Table Description All System Volcopy Generates File System Image 4.4.2 Normal File System Commands and Special File System Command Manual Ordinary File System Commands and Special File Systems have a manual, and the special command in the manual is immediately commanded. Command. View special commands, attached to the normal command name, append a loop and file system type, for example: To view the installation of the HSFS file system special command manual, type Man Mount -HSFS LOFS PCFS and PROCFS file system without Mount Special Command Manual 4.4.3 Using the file system command to determine the step of the file system type normal file system command to determine the step of the file system type is: 1. If there is a -f selection, it is determined by it. 2, by matching / etc / vfstab, items and special equipment To determine the option, for example: fsck first looks for a match with the FSck Device domain. If not found, the device field is checked. 3. The remote file system uses / etc / dfs / fStype with the default value for the remote file system using the default value described in / etc / default / fs. Ordinary File System Command Syntax Description Options Description -F Description File System Type, if you do not use this option, look for items matching the special original device or mount point in / etc / vfAult, otherwise: from / etc / default / fs Take the default value of the local file system, from / etc / dfs / fstype to take the remote file system default. -v returns the complete command line, the display line may include additional information from / etc / vfstab, with this option to verify the command line, it does not execute the command. All kinds of file systems common choice. -o a specific set of file systems, its format is: -o follows a single space, then a series of [=] pairs separated by "," and spaceless insertion. Description File System, give the installation point or device file and name of the storage file system disk, for some commands, files must be the original (character) device. For some commands, you must be a block device, about the name of the disk, see No. Three chapters. This parameter is sometimes used to make a keyword matching one item in the / etc / vfstab table, thus getting other information, most of the cases, this parameter is needed, and followed, however, when you want a command role This parameter is not required when all file systems illustrated in the / etc / vfstab file. 4.4.4 File System Type If you want to determine a file system type, you can get information from the file used by the above ordinary commands. * FS type field in file system table (/ etc / vfstab) * Use / etc / default / fs file for local file systems * Use / etc / dfs / fstypes file to find out from / etc / vfstab File system type, type GREP / ETC / VFSTAB, the installation point information is displayed as follows: gtxa% grep / tmp / etc / vfstab swap - / tmp TMPFS - YES - gtxa% If the file system item that is not available in Vfstab, The following command determines the file system type. In order to detect the installed file system type, type GREP / ETC / MNTTAB, the information of the installation point is displayed as follows: gtxa% grep / home / etc / mnttab gtxa: (PID129) / Home NFS fo, ignore, map = / etc / auto -Home, Indirect, DEV21C0004693606637 BIGRIVER: / Export / Home / Bigriver / TMP-MNT / Home / Bigriver NFS RW, DEV21C0005695409833 GTXA% or Type Mount All installed file systems and their types can be listed: gtxa% MOUNT / ON / DEV / DSK / COT3DOSO READ / WRITE ON TUE DEC 24 12:29:22 1991 / USR on / dev / dsk / cotldos6 Read / Write on Tue Dec 24 2:29:22 1991 / Proc On / Proc Read / Writ on Tue DEC 24 12:29:22 1991 / usr / man on swsvr4-50: / export / svr4-50 12:44:11 1991 / usr / openwin on swsvr4-50: / export / svr4 / OpenWinv3 Read / Write / Remoteon Mon do 30 13:50:54 1991 / 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 JAN14 / 09: 24: 53 1992 GTXA% or with the following steps: 1. Type the DEVNM original device name display Out; 2. Become a super user; 3. Type the type of FSTYP / DEV / RDSK / CWTXDysz file system is shown below: gtxa% devnm / usr / dev / dsk / cotldos6 / usr gtxa% Su Password: # fstyp / dev / r DSK / COT3DOSO UFS # 4.5 How to make the file system valid in order to make the created file system valid, you must install it. A installed file system means it is added to a mount point specified in the system directory tree and is effective. The root file system is always installed. Any other file system can be connected to the root file system or remove it from the root. Local file systems can be installed with the following steps: add one in / etc / vfstab (virtual file system table) file. A series of file systems included in / etc / vfstabs are automatically installed when the system is started in multiple user mode. The / etc / vfstab file has been introduced earlier. Install with the mount command in the command line. Before you have access to a file system, you must install the file system into the web server file system and make it a shared file system (output exported). The following will introduce how to share server files. When the file system on the server can share, the customer can install the shared file system as an NFS system below: * Add one in / etc / vfstab table so that the system When starting with multiple user mode, the file system can be installed automatically. * Use the auto installer. When the user enters or exits an automatic installation directory, the auto installer will automatically install or disassemble the corresponding file system. * Use the mount command in the command line. 4.5.1 Installing and disassembling the file system can be added to the system directory hierarchy In this process, this process is called installation (in order to install a file system: * becomes a super user. * A mount point of the local system, the installation point refers to a directory that is coupled to the installed file system. * The file system resource name to install. (Example: / usr) General, local hard drives are always included in the / etc / vfstab file, and software on the server, such as the owner on the OpenWindows online manual or server, is the installation or automatic installation in / etc / vfstab Depending on the strategy you use. When the file system is installed, as long as the file system is installed, any file or directory that exists in the installation point is no longer valid. The masked file is not permanently affected by the installation process. When the file system is disassembled, the original file or directory is restored to valid. The installation directory is preferably an empty directory so that the original file will not be shielded. The system has recorded the installed file system in the / etc / mnttab (mount table) file. You can list the contents of the MOUNT table with the CAT or MORE command. But never edit the modification of the MNTTAB file. (/ ETC / VFSTAB is editable). Here is an example of a mount table: gtxa% more / etc / mnttab / dev / dsk / cart3doso / ufs rw, suid 693186371 / dev / dsk / cotldos6 / usr ufs rw, suid 693186371 / proc / proc proc rw, suid 693186371 swap / tmp : (PID127) / NSE NFS RO, IGNORE, MAP = / etc / auto.nse, indirect, dev = 21c0002 69318449 GTXA: (PID127) / NET NFS RO, IGNORE, MAP = - Hosts, Indirect, DEV = 21C0003 693186449 GTXA : (PID127) / Home NFS RO, IGNORE, MAP = / etc / auto-home, indirect, dev = 21C0004 693186449 BIGRIVER: / EXPORT / HOME / BIGRIVER NFS RW, DEV = 21C0005 693186673 GTXA % 4.5.1.1 Installation and Disassembly File System Commands Table 4.5 lists the installation and disassembly file system commands in / usr / sbin directory. The mount command cannot install a data inconsistent read / write file system, so when the mount command or mountAll command returns an error message, you need to check the file system. Table 4.5 Installing and Removing the File System Command Command Command Description Mount (1M) Install File System and Remote Resource MountAll (1M) Install All File System Umount (1M) Removal File System and Remote Resources UmountAll (1M) Removal File System In the system table, when all file system file systems are busy, the umount command will not be dismantled. The so-called file system is busy means that the user is operating in a directory of the file system, or a program opens the file in the file system. 4.5.1.2 Find the installed file system To display the installed file system, type the mount command, then the currently installed file system will display GTXA% MOUNT / ON / DEV / DSK / C0T0D0S0 Read / WRITE / SETUID ON WED Octhood ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, / TMP on swap on the WED OCT 23 10:08:50 1991 / USR / OpenWin Hard / Remote ON WED OCT 23 10:11:08 1991 / Home On Blowup: (PID136) Read Only / Intr / map=auto.home/indirect on Wed Oct 23:11:10 1991 / Vol on Blowup: (PID136) Read Only / INTR / MAP = Auto.vol / Indirect On Wed Oct 23 10:08:50 1991 / NSE On Blowup: (PID136) Read Only / INTR / MAP = / ETC / Auto.nsE / Indirecton WED OCT 23 10:08:50 1991 GTXA% 4.5.1.3 All Files in Install / etc / vfstab file below installation / Steps to all file systems in the ETC / VFSTAB file: Enter superusers; 2. Type all local file systems in MountAll / etc / vfstabs are installed. GTXA% Su Password: # mountall # 4.5.1.4 Installing a specific type of File System Under the / etc / vfstab file, a specific type of file system installation steps, the most common is the UFS file system and network file system of local hard drives NFS . 1. Enter Super User 2, type this type of file system in MountAll -f, / etc / vfstab is installed. Below is an example of installing an NFS type file system. GTXA% Su Password # mountall -f nfs # 4.5.1.5 Installing a single file system (MOUNT) The steps of the single file system in the ETC / VFSTAB are: 1. Enter Super Users: 2, type mount gtxa% Su Password: # mount / OPT # 4.5.1.6 Disassembly All Remote File System (UmountAll -f NFS) Next is the step of disassembling the remote file system: 1, enter the super user; 2. Type UmountAll -f NFS, remove all the remote / etc / vfstab File system. GTXA% / Su Password: #umountall -f nfs # Note: If you want to remove all file systems (with umountall commands without parameters), the system can no longer be used. It must be restarted. 4.5.1.7 Removing Individual File System (Umount) cannot disassemble the installed installed directory, if you want to remove a directory being used, you must let all users transfer this directory. 1. Enter the super user; 2, if necessary, let the user transfer to the directory you want to remove; 3. Type the file system specified by umount is removed. Here is the example of finding the installation point with the mount command, and remove this installation point: gtxa% mount / on / dev / dsk / c0t0d0s0 read / write / setuid on WED OCT 23 10: 08: 501991 / USR ON / DEV / DSK / C0T0D0S6 READ / WRITE 3: 08: 501991 / PROC ON / PROC READ / WRITE / SETUID IN WED OCT 23 10:08 50 1991 / Tmp On Swap ON WED OCT 23 10:08:50 1991 / USR / OpenWin on Chem PEERS: / ONWENWIN HARD / Remote ON WED OCT 23 10:11:08 1991 / Home on Blowup: (PID136) Read Only / INTR / MAP = Auto.home / Indirect ON WED OCT 23 10: 11:10 1991 / Vol on Blowup: (PID136) Read Only / INTR / MAP = Auto.vol / Indirect On Wed Oct 23 10:08:50 1991 / Nse On Blowup: (PID136 Read Only / INTR / MAP = / ETC /auto.nse/indirecton Wed Oct 23 10:08:50 1991 [41] GTXA% Su Password: #CD / #umount / home # 4.5.2 Automated installer can implement shared file system installation through NFS, this method Automounting. Automated installer runs in the background, install or disassemble the remote directory as needed. Running the automatic installer client system, once the user accesss the remote file or directory that the automatic installer can access, auto installer Automatically install the file system to the user to access to the user system. As long as the user is in the remote directory or is using the files, the remote directory or file is installed. If there is no access to the remote file system in a certain time, it automatically The automatic installer is automatically installed or disassemble the file system as needed, in addition to the operation of entering or transferring the directory, no user is required to do any intervention. You can use the Auto installer to install some files, with / etc / vfstab file Some other files are installed with the mount command, for diskless nodes, / ETC / VFSTAB There must be / (roots), / usr, / usr / kVM in the table, and shared file systems should remain valid, so do not install / usr / share with automatic installation. The auto installer operates on the file system based on the description in the image table, which can be maintained as NIS, NIS or local files. Automatically install the programming timber to explain multiple remote locations of the file. Due to this method, when one of the servers out of the problem, the auto installer will be installed from other machines. In the image table, you can assign a weighting factor for each server, use it to determine which server to the image. The resources in the table have a high priority. When the system enters the third level (Run Level 3), the automatic installer will be automatically started. Of course, you can also start the automatic installer from the command line. Upon default, SunOS5.x system software is automatically installed / home. (How to establish and manage the content of the automatic installer has exceeded the scope of this manual). 4.5.3 Shared Server File NFS is a distributed file system that allows the machine running different operating systems to run DOS to share files, for example, running DOS systems. NFS makes the actual physical location of the file system unrelated to the user. Users can view all related files through NFS, regardless of their location. Since the NFS shared file is used, the user only needs to put a copy in one system's disk, and other systems can be accessed through the network without having to put a copy in each system. Under NFS, the remote file system does not seem to differ from the local file system. A system is called NFS server refers to some file systems on the system to share or output over a network. The server remains currently output. File system table and its access rights (such as read / write or read only). Users can share other machines (usually servers) resources, such as files, directories, or devices, etc., such as files, directories, or devices, such as files, directories, or devices, such as files, directory, or devices, can be shared with users of third-party manufacturers on other machines. When you are ready to share your resources to your resources, you must ensure that your resource is installed in other remote systems. The following method enables resource sharing: 1. Use the Share or ShareAll command. 2, add one in / etc / dfs / dfstab (distributed file system table) file. The default / etc / dfs / dfstab file gives the syntax rules and examples of resource sharing: gtxa% more / etc / dfs / dfstab #place share (1M) Commands here for automatic execution # on Entering Init State 3. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Share [-f fstype] [- d ""] [resource] # .eg; share -f nfs -o rw = engineering-d "home dirs" / export / home2 share -f nfs / var / Mail GTXA% 4.6 Checking the Data Consistency of File System (FSCK) UFS file system to track inode, the useful block and available blocks according to some internal tables, when this causes the internal table and disk data without proper synchronization (Synochronized When it is inconsistency, it is necessary to fix the file system at this time. Below is a few cases that cause the file system to destroy or inconsistency when the operating system suddenly terminates: * Power supply failure * System failure blocking * abnormal shutdown * The software error file system is serious, but Do not occur frequently, the system is automatically detected when the system starts, and the detected problem can be repaired in most cases. File system detection is implemented with the FSCK (File System Check) program. The fsck command will be assigned but not explained in the Lost Found directory, and if the directory does not exist, the FSCK is created. If there is not enough space in Lost Found, FSCK will automatically increase its space. The following cases need to be detected when the file system is required: * File system cannot be installed * Problem in the file system being used * When the file system is being used, the console window prompts a very eye-catching error message, and the system will occur seriously. paralysis. Please read the FSCK (1M) manual in detail before using FSCK. 4.6.1 Deciding whether the file system needs to detect whether the file system is required to detect: 1. Enter the super user; 2. Type the fsck -m / dev / rdsk / cwtxdysz command, the above command is in the specified file system hyper block The status flag is to determine if there is a problem with the file system, and it is further repaired. If the device parameters are omitted, all UFS file systems listed in the / etc / vfstab file are required to be detected. In the following example, the first file system needs to be detected, the second does not need to be detected: #FSCK -M / DEV / RDSK / C0T0D0S6 ** / dev / rdsk / c0t0d0s6 ufs fsck: Sanity Check: / dev / rdsk / c0t0d0s6 neseds Checking # fsck -m / dev / rdsk / c0t0d0s7 * / dev / rdsk / c0t0d0s7 * * * / dev / rdsk / c0t0d0s7 * ufs fsck: Sanity Check: / dev / rdsk / c0t0d0s7 okay # 4.6.2 Take interactively detection The following is the step of detecting the file system with interactive mode: * Enter a superuser; * Remove the file system; * Type the FSCK, / etc / vfstab file, FSCK Pass domain value greater than 0 file system is all detected, or installed Catalog or / DEV / RDSK / CWTXDysz makes inspections. Any inconsistency in the test will be displayed. The following example detects / dev / rdsk / c0t0d0s6 and correct its incorrect block count: #FSCK / DEV / RDSK / C0T0D0S6 CheckFilesys: / dev / rdsk / c0t0d0s6 * Phase1 - Check Block and Sizes IncorRect Block Count i = 2529 6 should be 2) CORRECT? y * * Phase 2-Check Pathnames * * Phase3- Check Connectivity * * Phase 4-Check Reference Counts * * Phase 5_Cylinder Groups Dynamic 4.3 FFFS 929 files, 8928 used.2851 free (75 frags, 347 Blocks.6% fragmentation) / dev / rdsk / cartoos6 file system state set to okay ***** File System WAS MODIFIED ******** 4.7 Backup and Recovery File System Backup refers to the copy of the file As a security measure when the original file is deleted or destroyed, it is usually copied to a movable medium. The error-deleted file can be easily resumed after the backup file, but the most important is to handle serious hardware failures and other catastrophic faults. The backup file is one of the most critical system management functions, and the three main reasons for the backup of the system file according to certain steps and scheduled system files: * Make sure the system is integrity of the file system; * Prevent user files from being accidentally deleted; * Important protection measures to reinstall the system or repair system. When you press the file system as scheduled, you should ensure that the backup file is restored to the appropriate current state, in addition, you may also want to transfer the backup file system from a system to another or as a document, save the file To movable media, you can move or change files on your system. Consider the following aspects of the following aspects: * Which command backup file system * Use what media * What is used? * This system is critical to the user * These files to be backed up Where is it in a separate file system? * Does these files often change? * How fast is needed when file loss or damage? * Is the backup file, can the relevant file system are often disassembled? Introduce possible backup The strategy has exceeded the scope of this manual, refer to the Cantory (DUMP) policy provided in the online manual UFSDUMP (1M) command. Here's how to use the UFSDUMP command backup file to recover files with ufsrestore commands. 4.7.1 Use the QiC-150 Box Tape Backup File System (UFSDUMP) to back up the full file system, all users must exit and enable the system into single-user mode. (See Chapter 3, "Tape Device Naming Convention"). You can make backups and recovery from the remote drive before the tape device name. The following is a grammar: / dev / rmt /. For example, the magnetizer name on the remote system GTXA is / DEV / RMT / 0, and the remote device name should be GTXA: / DEV / RMT / 0. The following steps explain how to implement a file system level (complete) backup: * Type init S. This time the system enters the single user mode, so that no user modifies the file system when the full file system is backed up. * Insert the QiC-150 tape. * Type UFSDump 0 CUF / DEV / RMT / / DEV / DSK / CWTXDYSZ. An option 0 Description 0 (all) backup. C option Description is a cassette tape; U option update the recording; F An option Description This is later the device file name. You can also type the file system in the hard disk area instead of the backup, such as replacing / files1 with C0T0D0S7. GTXA% Su Password: # init s #ufsdump 0 CUF / DEV / RMT / 0 / DEV / DSK / C0T0D0S7 DUMP: DATE The Level 0dump: WED Mar 11 10:16:53 1992 Dump: Date of Last Level 0 Dump: THE EPOCH DUMP: DUMPING / DEV / RDSK / C0T3D0S7 (/ Export / Home) To / dev / RMT / 0 Dump: mapping (pass i) [Regular Files] Dump: Estimated 956 Blocks (478KB) Dump: Writing 63 Kilobyte Records Dump: Writing 63 Kilobyte Records Dump : DUMPING (PASS III) [Directories] Dump: DUMPING (Pass iv) [Regular Files] Dump: Level O Dump Om Wed Mar 11 10:16:53 1993 Dump: 956 Blocks (478KB) ON 1 Volume Dump: Dump Is DONE # If a box can't save, the ufsdump command will remind you to change a box of new belts. Sign in commands, file system names and backup dates on tapes. 4.7.1.1 Implementing Incremental Backup Use ufsdump commands to specify different backup levels, so you can only back up the last backup, and have revised a relatively low-level file, the following steps are described in the last complete strain The process of incrementing the process: 1, enable the system into single user mode; 2. Enter superusers; 3, put the tape into the tape drive; 4. Type UFSDUMP [1-9] ucf / dev / rmt / / / / / RDSK / CTDS plus a grade number before ufsdump parameters, for example: 9-level backup, type 9UCF; 5, remove the tape and put the tag after executing the ufsdump command. 4.7.2 Recovery Backup File System UFSRESTORE commands You can copy files backed up with UFSDUMP commands to the current working directory, you can use the UFSRESTORE command to reload file systems with incremental backups after using the 0-level backup, or recover from any backup tape One or more files, the file is recovered in the original owner, the final modification time, and the mode (permission). You need to know before recovery file or file system: * Which tape or disk is required; * The device name of the backup file system, the tape device type you are using; * Tape device name (local or remote). 4.7.2.1 Deciding which backup belt must use before starting to recover files or file systems, you must decide which backup tape you use, when you need to recover all file systems, you need the latest 0-level backup band. Similarly, if some backups require the latest incremental backup belts on higher levels, the specific situation needs to be referred to the backup plan you use to determine the level and tape number you need. For example, if you do a 0-level and 9-level backup, you need a 0-level and 9-level backup band. Here is the step of deciding which with which one with a separate file or the entire file system: 2. Refer to your backup plan to find the date of the last backup, do not necessarily use the latest backup version to recover. In order to recover the appropriate version of the file, you should see the lowest backup file from the reverse direction, see the lowest level from the highest level, from the latest to see the oldest. 3. If you use the online archive file generated by the ufsdump -a command, type UFSRESTORE TA / PATH / must use the full path of the file, and the files and media stored in this time will be displayed. 4. Find the media that contains backups, you have to know that the storage media is a backup medium before the month or even years. 5, this step is optional, insert the storage medium into the drive, type UFSRESTORE TF / PATH /, for a complete path name. If a file is in the backup medium, its file name and the Inode are displayed, otherwise the display information indicates that this file is not in the medium. 6. If there are multiple backup files on a belt, you can use the -Sn option to locate and select the required backup file. For example, type UFSRESTORE XFS / DEV / RMT / 05 positions the tape on the fifth backup file and restores it. 4.7.2.2 Recovery All Backup The following steps, use the QiC-150 box tape to restore a full backup of a file system, pay attention: This process will generate a new file system and will destroy the original existence all files. system. 1. Enter the super user; 2. Type the init s system to enter the single user mode, guarantee that no one uses the file system you will recover; 3. Type the umount command to make the corresponding installation point (Mount: / files1) Disassemble; CWTXDysz reinstalls the file system of the corresponding block file device (for example: / dev / dsk / c0t0s7) to the corresponding installation point; 6. Type the CD to enter the directory you want to do to make recovery; 7, insert QiC -150 cassette; 8, type UFSRESTORE RVF / DEV / RMT / 0H to recover file system. The following example illustrates the C0T0D0S7 panel corresponding to the recovery / files1: gtxa% Su Password: #init s #umount / files1 #NewFS / DEV / RDSK / C0T0D0S7 #MOUNT / DEV / DSK / C0T0D0S7 / FILES1 #CD / Files1 #ufsRestore RVF / DEV / RMT / 0H 4.7.2.3 Interactive Recovery File Restores a single file or directory, store them into a temporary directory (for example: / var / tmp) is a good way. After confirming, the recovery operation is performed, in fact, make sure not The existing new version will be rewritten with the old version of the file on the backup. The following is the step of interactive recovery file: 1, enter the super user; 2. Write the tape write protection; 3. Put the backup belt into the tape drive; 4, type CD / VAR / TMP, if you want to store files in other In the directory, use the corresponding directory name instead / var / tmp; 5, type UFSRESTORE IF / DEV / RMT /, some prompt information and the prompt number are displayed; 6, establish a list of files to recover; 7, use the LS command column Out of the content of a directory: * Type a CD change directory * Add a directory name or file name to the list of files that will be restored, type add * To delete the directory name or file name in the list of files that will be restored, type delete * to keep the current The pattern of the directory is constant, type SetModes and type N and enter; 8, type extract, type extract, UFSRESTORE will ask which volume you use; 9, type the volume Enter, if only 1 volume, type 1 Enter, the file or directory in the list is taken and restored to the current working directory; 10. Type Quit, display the shell prompt; 11, list the recovered file or directory with the ls -l command; 12, check the file List, make sure all files or directories are restored; 13, move files to the appropriate directory with the mv command. The following example shows the process of restoring the Backup.example and Junk files from the Pubs directory: #CD / var / tmp / 0 ufsrestore> LS: Lost Found / Pubs / UfsRestore> CD Pubs Ufsrestore> LS. / pubs: .Xauthority login .profile backup.example% .Xdefaults .mtdeletelog wastebasket / core .cshrc openwin-init junk / dead.letter desksetdefaults .openwin-init.Bak backup.examples junk usrestore> add backupo.examples ufsrestore> add junk ufsrestore> setmodes set owner / mode for "."? [yn] n ufsrestore> extract you have not read any volumes yet Unless you know which volume your file (s) are on you should start with the last volume and work towards the first SPECified NEXT VOLUME #: 1 set Owner / Mode for "."? (Yn) n ufstore> quit # ls-1 Total 6 Drwxrwxt 3Sys Sys512 Mar 11 10: 36./ DrwxrwR-x 18 OOT SYS512 Mar 10 16:43 . DRWXR-XR-X2 Pubs Staff 512 Mar 11 10: 11 Pubs / # PWD # VAR / TMP # CD Pubs # ls ./ ../ backup.examples Junk # 4.7.2.4 Restore a single file from the backup band (ufsrestore) The following is the process of recovering a single file from the backup tape: 1, enter the superuser; 2, insert the backup band; 3. Type the CD / VAR / TMP into the / var / tmp, if you want to restore the backup file to a different In the directory, use the corresponding directory instead / var / TMP can be; 4. Type UFSRESTORE XF / DEV / RMT /, X option Description Whether to set the owner / mode information when copying the file or directory; 5, type n, the model of the directory remains unchanged; 6 If there is only one volume, type 1, then the file is restored to the current working directory; 7. Type the LS -L file list is displayed; 8, move the file to the appropriate directory with the mv command. Chapter 5, Managing Network Services This chapter will introduce: Check the remote system status, register with remote system (RLogin), system transfer file (RCP, FTP), manages NIS database (AdminTool). 5.1 Checking Remote System Status This section describes commands that display remote system status: RUP, PING and RCPINFO -D. 5.1.1 Determining a remote system has run how long the command RUP tells you the time and average load of the system. The system displays the host name, run time, and average load when typing this command. GTXA% RUP ASH ASH UP 59 Days, 3: 42, Load Average: 0.12, 0.12, 0.01 GTXA% If you do not follow the optional parameters after the command, you can also display some information on all remote hosts on the child online, if it is The form is displayed, and the input classification can be used using the options in the table. Table 5.1 Options for RUP Commands Options Features - H Press Host Name Alphabet Sequence Classification Display - L -Ted -T Classification by Average Load Alphabet Sequential Classification Separation, Output The alphabetical order classification by host name; GTXA% RUP -H ASH UP 1 Day, 1: 42, Load Average, 0.00, 0.31, 0.34 ELM UP 14 Days, 0 min, Load Average: 0.07, 0.01, 0.00 MAPLE UP 32 Days, 14: 39, Load Average: 0.21, 0.05 .0.00 GTXA UP 8 Days, 15: 44, Load average.O.02, 0.00.0.00 GTXA% 5.1.2 Determine if a remote system is running under operation (PING / RUP / RPCINFO-P) to determine if a remote system is In the run: * Type ping, answer "is alive". It means that this system can be accessed on the network. If information "ping: unknown host" appears, it means that this system may not exist because the name resolution system cannot find the machine. If information "ping: no answer from" appears, it means that the remote system may not run. * Type the RUP display system runtime and average load information. * Type the relevant information about RPCINFO -P and display the service. * Type rlogin and register to the remote system. * The above command is required to be allowed to allow remote system to allow information. openet% ping gtxa gtxa is alive openet% rup gtxa gtxa up 3 days, 15: 10 load average: 0.07,0.08.0.09 openet% rpcinfo-p gtxa program vers proto port service program vers proto port service 100000 3 udp 111 portmapper 100000 2 udp 111 portmapper 100000 3 rcp 111 portmapper 100000 2 tcp 111 portmapper 100007 3 tcp 1029 ypbing 100007 3 udp 1025 tobind 100021 1 tcp 1030 nlockmgr 100021 1 udp 1026 mlockmgr 100024 1 tcp 1028 status 100024 1 udp 1027 status 100021 3 tcp 1030 nlockmgr 100021 3 UDP 1026 NLOCKMGR 100020 2 TCP 4045 LLOCKMGR 100020 2 UDP 4045 LLOCKMGR 10021 2 TCP 1030 NLOCKMGR OPENET% RLOGIN GTXA Password Last Login; Mon Mar 2 10: 31 56 From CreamRella OpenEt% You can also click on the command format of ping, system display information IS alive, means that the system is accessible on the network. If a letter is displayed, "Ping: No answer from, that is, it means that there is not activated on the network. Or display information" ping: unreachable address from .... ", you must not exist in the network, because there is no route You can go to this address. gtxa% ping 129.144.52.199 129.144.52.199 is alive gtxa% ping 129.144.52.200 unknown host 129.144.52.200 gtxa% ping 129.145.52.199 ping: no answer from 129.145.52.119 gtxa% 5.2 registered to a Remote System (rlogin) The following is a registered To the remote system: 1. Type the rlogin When transmitted in ASC format, according to the type of the two systems, automatically change the newlines in the file to the carriage return and the wrap (if the file is transmitted from the UNIX system to the DOS system), or reverse (if you transfer it from the DOS system to the UNIX system ), Or constant (the same system is the same). 7. Type the PUT gtxa% ftp ftp> open clm Connected to elm 220 elm FTP server (UNIX (r) system v Release 4.0) ready Name (elm; ignatz):... ignatz 331 Password required for ignatz Password 230user ignatz logged in ftp> asc ftp > GET Quest / TMP / Quest 200 Port Command Success, 150 ASCII Data Connection For / Tmp / Quest (129. 144.52.119.133) 266 TRANSFER COMPLETE. TP> Quit 221 Goodbye GTXA% Note: You can use the mget command to copy multiple files, Details See FTP (1) Manual Chapter 6, Managing User Accounts and User Groups This chapter mainly shows how to use the Administration Tool to create and manage user accounts and user groups, which are used to edit NIS databases and local / The files in the ETC directory, and it also allows users to view information in NIS Map, but do not provide editing functions for this information. Note: Solaris 2.x provides the following SVR4 UseRadd commands: UseRadd, Userdel, Usermod, GroupAdd, GroupMod, and GroupDel. Since these commands and network relationships are not large, they are not discussed in this chapter. If you want to use these commands to manage user accounts in a stand-alone system, see the appropriate manual. 6.1 Adding and Managing User Accounts In the following segments we will show how to use the management tool to increase and delete user accounts, in Solaris 2.0, you can add users by editing the PasswD database or local / etc / passwd file, but management tools The home directory will not be created for the user. In Solaris 2.1, the User Manager provides the user with the ability to edit the PasswD database and establish the user's home directory. 6.1.1 Increasing User Account Before adding users to the network, you must first create and configure the user system, if needed, you must also install and run NIS or NIS software on the network. (Only 4.x system can be NIS services, while NIS customers can be installed with 4.x or 5.x system). Add a user needs to complete the following two steps: set the user account to provide the user with the work environment. * Edit PasswD Database * Define User Group * Establishing Home Contents * Defining User Environment * To create a password in the following sections, we will show how to complete these work. 6.1.1.1 Editing the PasswD database Before editing the Passwd database or a local / etc / passwd file, you must first become a member of the System Management Group (GID14). If you are running NIS in the system, then you must also have the right or delete NIS data. Permissions, you can use the management tool of any system on the network to change the core NIS database or the local system's etc / passwd file. Add a user, you need to know the following information: * Register (login name) * User number (UID) * Basic Group Number * Identification Information (Name, Office Location, Household Phone and Other) * Home Directory * Sign up SHELL Add users in the NIS network database or local / etc / passwd file: 1, type OpenWIN, Type Open Windows. 2. Type Admintool, start the management tool and display the AdimInstration Tool window. 3, use the mouse SELECT The Database Manager icon displays the Database Manager window. 4, select passwd database, in the Nis Named Device or None (local / etc file) with the mouse point and click the Load button to display the Passwd Database window. 5, if it is in a large In the network, you may need to search for a registration name or UID to make sure they have not been used, select Find in the View menu, type the registration name or UID in the text field, then click the Find button with the mouse, if you search Item, then the item is illuminated, otherwise "no match" information is displayed at the bottom of the Passwd Database window. 6, select the Add Entry window in the EDIT menu, showing the Add Entry window. 7, in the right text domain Type a username and user ID (UID). 8. When the user is registered for the first time, its default is not a password. If you want to select a different password status, you can select another one in the Passwd Status menu. The various items are shown in Table 6.1. 9. Type the rest in the text field, Table 6.2 describes the specific contents in each domain, and the Database Manager also provides users with online help information, users only need The arrow is moved to a tag or text domain, then press the HELP button on the keyboard to obtain a detailed description of the item. 10, after all information is input, click the Add button with the mouse to deposit them In the passwd database, if "... canNot Execute Method, Access Denied ..." is displayed, then edit the NIS group or / etc / group file, in the system administrator group (GID) ) Establish or increase your registration name. After editing the Passwd database, you also need to create a home directory and set the environment for the user, which will be described in the following sections. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 表 Table 6.1 Password Status Menu Password Status Select Password Description Password Is Cleared Each The account requires a password. When the user first registers, the system will prompt the Until First Login prompts the user input password. When entering the illegal password, the account is invalid, at this time, the user can use the designated password to talk about the account. Unlock, this type of account allows the user to have a file but cannot register the no password-rood setuid account cannot be registered directly. It allows LP or UUCP and other programs to run under an Access ONLY account, but users cannot register Normal Password is set When the account already has a password, you can choose the item, you can choose the ━━━━━━━━━━━━━━━━━━ 注意 注意 注意 注意 注意 注意 注意 注意 注意 注意 注意: A account without a password It is impossible to establish, and its password cannot be defined directly in the Database Manager and can only use NispassWd, YPPASSWD or PASSWD commands. ━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━ 表 表 Table 6.2 Passwd Database Database (PASSWD Database) Add Entry Window Domain Description User Name Use characters (including numbers) to form a unique registration name User ID Enter a 100- The unique integer between 60000 is used to identify the user passWor Status inside the system, see Table 7.1 Comment (GOOS) input optional information, such as user actual name, phone number, or the path of Home Path Enter the path of the user's home directory, generally, The path is / home /, note, in the Solaris 2.x system, the system name is no longer a part of the shell input from the user directory path: Bourne Shell is bin / sh c shell is bin / csh The Korn shell is / bin / ksh default is the Bourne Shell Group ID inputs a unique integer between 0-60000, which is used to identify the basic group to which the user belongs. Max Days Valid input port makes the maximum number of days, If the blank, the password does not fail to invalidate the number of days before the password failure to warn the number of days of the number of days of the number of days of the user from January 1, 1970. Starting until the password has been modified by the number of days (8085 Represents February 28, 1992) This domain content is the absolute date that is not allowed to modify the EXPIRATION DATE to enter the absolute date of the user account is logged out, which is starting from January 1, 1970. The number of days is represented, (such as 8050) If the domain is blank, the password does not fade with the minimum number of minimum number allowed between the password twice MAX INACTIVE DAYS Enter a account is frozen The number of days before the failure is ━━━━━━━━━━━━━━━━━━━━ 6 6 6━━━━━━━━ 6 6 6 6━━━━ 如果 If you want to increase in a group Users must edit group databases and increase user registration names in this group of member tables. This section describes how to add a user to a group, before this, first need to know user registration, user ID (UID) and group name and group ID. 1. In the Database Manager window, light the group database, select NIS or NONE (this ETC file) with the mouse and click the Load button. 2. Use the mouse to select an item you want to modify, the item is lit. Select Modify Entry from the EDIT menu, open the Modify Entry window and display the current information in the group database (or file). 3. Increase the user registration name in the member text domain, when you lose the wrong, press the RESET button to re-transfer the information. 4. After selecting modify with a mouse, a group database (or local / etc / group file) immediately changes. 5. If you want the user to belong to another group, repeat the above steps, add this user in other groups. Note: If you don't use Naming Service, you must repeat the above steps to update / etc / group files belonging to all users in the same group to edit / etc / group files on other systems. Users must return to the Load Database window and type the system name in the USE / ETC Files on Host file field. 6.1.1.3 HOME DIRECTOR The home directory is part of the file system, which assigns each user to store private files, according to the file type created by the user, and the main directory space allocated for each user It can be different, in general, you can assign a 15MB disk space for each user's home directory. The user's primary directory can be in a local file system or a remote file server, its pathname is present, such as / export / home /. Note: This is a new agreement of Solaris 2.x. The server name is no longer included in the user's home directory path, which can create a household directory for different users in a large server / export directory, such as Homel, HOME2 HOME3, etc., no matter where the user's home directory is released, they can access their home directory through name / home / installation. This section describes the mounting method of the main directory in Solaris 2.x, before this, before we assume that the user registered system is on the network, the user main directory automatically installed with Automount is accessible and uses the system to provide Share sharing commands. You can access the local user directory through the network on other systems. The installation method of the main directory has the following: * Add an item in the NIS Auto-Home database, NIS Auto-Home table, or local / etc / auto-home file, automatically install the primary directory (recommended method). * Add an item in the user system / etc / vfstab file, so that the system can install the primary directory through NFS. To support the automatic installation of the primary directory, SunOS 5.x system software sets the following in the / etc / auto-master file: / HOME / ETC / Auto-Home This item Notifies Automounter to specify the directory specified in the auto-home database Installing the local / HOME, the usage format of this item in Auto-Home is as follows:: / export / home / When the user is registered, Automounter will automatically install the specified system (on the specified path / export / home /) Go to the / home installation point of the user. This method is suitable for the primary directory in the local system, but more importantly, once the user registers Automounter in other systems, it automatically installs its home directory to the system / home installation point. Note: When the Automounter is used to install the primary directory, you cannot create any directory on the user's / home installation point. When the Automounter is running, the system will automatically identify the special state of the / home directory. Before establishing a primary directory, you must first edit the passwd database to create a user account, it requires the following information: * The user's registration name and UID * home directory is located, if the primary directory is accessible, the main directory system must Like the user's local system, on the same network segment of the network, check whether the server has enough space to create a new directory with a DF command. * The directory name of the user account, in general, the main directory can be named / export / home, can also be multiple, such as / export / home1, / export / home2, etc., under each directory Different subdirectories are established for different users (for example: / export / home /, / export / home /, / export / hom1 /, / export / hom2 /, etc.). The installation step of the primary directory is described below, which is applicable to the main directory in the local system or on the remote file server. 1. Be superuser 2, type CD / Export /, which is the name of the user's home directory, for example, want to enter directory / export / homel, type: #CD / EXPRT / HOMEL 3, type MKDir, where users are registered Name, you can build a directory that matches the user registration name, such as a user directory named Ignatz, type: #mkdir ignatz 4, type Chown, at which time the user has become the owner of the main directory, for example, for users Ignatz, type: #Chown Ignatz Ignatz 5, type ChGRP, the user is assigned to the basic group labeled in Passwd Database, for example: assignment to the STAFF group, type: #chgrp staff ignatz 6, type ChMOD 755 / export //, The user's primary directory is set to: owner is RWX, the same group member is RX, the other people in the system are RX, for example: #CHMOD 755 / Export / Honel / Ignatz Note: The following steps describe how to run SunOS 5 from one running SunOS 5. X 's server shared owner, if you want to share a main directory from the server running SunOS 4.x, you must use the export command. 1. Type Share Check the main directory is shared, you can see the following information GTXA% Su Password: #share - / export / home rw "" If you do not list the primary directory, you can create one by other steps. The main directory of system sharing, generally, can name / export / home, / export / home1, or / export / home2, etc. 2, edit the / etc / dfstab file, add the following line: Share -f NFS / EXPORT / 3, type ShareAll -f NFS. This does not need to restart the system, the system can automatically execute the Share command in the / etc / dfstab file. 4. Type PS-EF | Gerp Mountd. If the system management process mountd is running, the end, it is, and then, proceed to step 5. Below is a MountD unruly information: #ps -ef | gerp mountd root 221 218 16 18:07:25 PTS / 10: 00 GREP MOUNTD 5, type /etc/inint.d/nfs.server start, start The system management process required for shared file directory requirements. Note: If the network does not run NIS or NIS , you need to add the IP address of the primary directory server to the / etc / host name of the primary directory server, the local / etc / hosts file can be edited with Database Manager. If the hard disk quota is used, you should establish a corresponding quota for the user. After establishing the user's home directory, you can add it to the Auto-Home Database from Automounter, or use it for an item in the user system / etc / vfstab file by NFS. 6.1.1.4 Automatic installation directory must first create user main directories and Automounter, if you want to edit NIS Auto-Home database with Automounter Tool Database Manager, you must be Sysadmin Group (GID 14 The member and the appropriate permissions for establishing and deleting Auto-Home Database. As long as there is a suitable permission, you can modify the NIS Auto-Home Database or / etc / auto-home file through any system on the network. When editing the Auto-Home database, you must know the user's registration name and the home directory to install. name. The following steps apply to the primary directory established on the local system or remote file server. 1. Start the Automounter Tool and select Database Manager. 2, the default domain name in the window is ECD.EAST.SUN.COM, if this default domain name is not correct, you can enter other domain names in this field; if it is editing the auto-home file on the local system You can select None with the mouse and enter the system name at the Host Name field. 3. Select the Load button with the mouse to display the Auto-Home Database window. 4. Select the Add Entry in the EDIT menu, will display the Add Entry window. 5. Enter it in the User Name field. 6. Enter: / export // is the server name where the primary directory is located in the PATH field. 7. Use the mouse to select the Add button, the information edited above is stored in Auto-Home or the local / etc / auto-home file, when the user is registered for the first time, the primary directory will be automatically installed to / home / under. 6.1.1.5 Install the primary directory with NFS If the user's main directory is on other systems and Automounter cannot assign user space, then use NFS to install the main directory as follows: 1, becoming a super user; 2, editing / etc / vfstab Files, establish a corresponding item for the user home directory. For example, if you want to create a primary directory for user Ignatz on the server GTXA, you can add the following: GTXA: / Export / Homel / IGNSTZ - / Home / Ignatz NFS - YES RW, INTY 3, in order to establish a user system Mounting points, you can type MKDIR / HOME /. Note: The name of the main directory can be different on the server and user system, for example, the main directory name / export / home / ignatz / on the server / home / ignatz; 4, type Chown / Home / At this time, the home directory is all of the user; 5. Type ChGRP / HOME /, at this time, the user's basic group has permission to access the user's main directory; 6. Type all the items in the current vfstab file (them The Automount domain is set to YES) is started. 7. In order to verify, type the mount command to display the installed file system. 6.1.1.6 Defining User Environments To establish user accounts, you need to further define the following user environments: * Define default initialization files * Create a mail account * Setup printer 6.1.1.7 Define initial file When the user registers, the registration program will automatically generate one Series variables, such as HOME, LOGNAME, and TZ, then run the initialization file to set the system default value such as Path, date information, umask, etc., and then set some specific variables, such as modifying the PATH variable in a user initialization file. Make some applications can only be performed by the user. Every shell has its own initialization file, as shown in Table 6.3. ━━━━━━━━━━━━━━━━━━━━ 表 表 表 表 表━━━━━ 表 表 Table 7.3 Shell User Initialization Document Shell Initialization File Used C $ HOME / .LOGIN Register Define User Environment $ Home / .cshrc Shell Register Define C SHELL Required User Environment Bourne $ HOME / .PROFILE Register When User Environment Korn $ Home / .profile Registration When registering the user environment $ home /. File specified in environment variable The user environment in the registration is in the case of the user environment. ━━━━━━━━━ s━━━━━━━━━━ s━━━━━━━━━━ s━━━━ 系统 为━━ / / / / / / / 系统 / / / 系统 / Each shell is provided by the default user initialization file, as listed in Table 6.4. ━━━━━━━━━━━━━━━━━━━━━━ ━━━ Table 7.4 Initialization Files under the Default Properties SHELL File Name c /etc/skel/local.login c /etc/skel/local.cshrc Bourne or Korn /etc/skel/local.profile ━━━━━━━ ━━━━━━━━━━━━━━━━ 下 下 下 下 下━━━━━ 下 下 below is the default /etc/skel/local.login file: # @ (#) Login 1.7 89 / 09/05 SMI stty -istrip setENV TERM 'TSET -Q-' below is the default /etc/skel/local.cshrc file: # @ (#) cshrc 1.11 89/11/29 SMI umask 022 set path = / bin / usr / bin / usr / ucb / etc.) IF ($? prompt) THEN SET HISTORY = 32 End IF The following is the default /etc/skel/local.profile file: stty istrip path =.: / usr / bin / usr / ucb: / etc export path The above file defines the system's minimum environment. To simplify the initialization files for each user, you can set up as possible to default variables as possible in the / etc / skel. In order to establish an initialization file, you must first create the user's home directory and know the shell type (C, Bourne or Korn) set for the user in the PasswD database. Follow the steps below to set the user's initial file: 1, under the user's home directory Become a super user; 2, type CD //, enter the user main directory, for example, to enter the Ignatz user directory under / export / host, you can type: #CD EXPTRT / HOMEL / IGNATZ 3, type CP / ETC / SHEL / Local. *, copy all default initial files into the user directory; 4. Type ChMod 744 local. *, set the correct permissions for the initial file; 5, type chown *, use these initial files belong to all, for example: #Chown ignatz * # 6, chgrp local. *, Assign files to basic groups (such as sysadmin), which is specified for user accounts in the Passwd database, for example: #chgrp 10 local. * # 7, rename the shell initial file, if the user shell is C shell, by typing mv local.login .login; mv local.cshrc .cshrc, if the user shell is a Korn or Bourne Shell, type MV local .profile; 8. Type rm local. *, Remove all the shell initializer that has been useless; 9, install the user main directory; 10, register in the user system; 11, specify a temporary password for the user (see how Establish a "establishment password" in the password chapter); 12. Check if the user environment is set correctly; 13, edit user initialization files and modify it as needed; in order to edit user initialization files, you need to complete the following steps: 1. Set Default path, the path contains the window environment application mount point and the home directory of the user; 2. In order to change the path settings, add or modify the PATH variable, for the c shell, setPath = (. / / ... ), For example, the following lines can be added in the user's $ home / .cshrc file: setPath = (. / Usr / openwin / bin / usr / bin $ home / bin / usr / lib / usr / sbin). For Bourne or Korn shells, type PATH = /: // ...; export path. For example, you can add the following line path =.: / Usr / openwin / bin: usr / bin: $ home / bin: usr / lib; export path 4, use the eNV command to check the environment variable settings Whether it is correct, pay attention, even if the user shell is C shell's environment variable is also displayed with a Bourne or Korn shell syntax, enter MAN = S5 Environ to get more information on the Env command. $ Env home = / home / ignatz hz = 100 logname = ignatz mail = / var / mail / ignatz mansects = / 1: 1m: 1c: 1F: 1S: 1B: 2: 3: 3c: 3i: 3N: 3M: 3K: 3G: 3E: 3X11: 3XT: 3W: 3B: 4: 5: 7: 8 Path =: / usr / openwin / bin: sbin: / usr / sbin: / usr / bin: lib: usr / lib shell = bin / SH TERM = Sun Tz = EST5EDT $ 5, increasing or changing the settings of the environment variable, typing Setenv (or set =) for C shell. For example, set a historical table for 100 commands, typing Setenv History 100, for Bourne or Korn shell, you can type =; export. For example, set the user's default mail path, type MALL = / var / mail / ignatz; export mail; 6, check the UMASK settings, if you need to change it, type umask, the front of the number can be omitted, for example, File permissions are 755, type UMASK 022, and Table 6.5 lists file permissions corresponding to the octal UNASK value. ━━━━━━━━━━━━━━━━━━━ 表 表━━━━━━━━ 表 Table 6.5 UMASK Value Corresponding Permissions Eight Improved Value File Permissions 0 RWX 1 RW - 2 RX 3 R - 4 -wx 5 -w- 6 --X 7 --- (none) ━━━━━━━━━━━━━━━━━━━━━━━━ ━ LANG variables and LC environment variables determine the local habits used by Shell, these habits and backgrounds are set in initial files, which mainly include time zones, collation orders, data formats, time, exchange rates, and numbers, and LANG variables are specified. All possible cultural habits and backgrounds in the country or region, LC variables can be used singly, if LC.Collate, LC-CTYPE, LC-MSEE AGES, and LC-CTYPE, LC-MSEE AGES and LC-NUMERIC variables are set, and the local features are set, and the table 6.6 lists different regions. Value. If the system needs to support multi-byte characters (such as Japanese), you need to add the command stty cs8 defeucw command in the system initialization file (/ etc / profile, etc / login), and register. ━━━━━━━━━━━━━━━━━━━ 表 表 表━━━━━ 表 表 Table 6.6 LANG and LC variables Value Venue DE: German Fr: Frenah ISO -8995-1 ENGLISH AND ENROPEAN ITALIAN Japanese Japanese Korean Korean SV Swedish Tchinese taiwanese ━━━━━━━━━ 6━━━━━━━━ 6━━━━━━ 6 6 6 6 6━━━━ 6 6 6 6 6 6━━━━ 6 6 6 6 6 6━━━━ 6 6 1.8 Establishing the user's mail account There is a mailbox on the local system or mail server and may have a mail alias in the / etc / mail / aliase file. It points to the specific location of the mailbox, follow these steps on the mail server To set up mail customers: 1. Be super and accounts on the mail customer server system; 2. Create / VAR / MAIL installation points; 3. Edit the / etc / vfstab file and add / var / mail directory on the mail server, will Document installation When the system is restarted to be restarted, the mailbox will be automatically hung up; Companies. Note: When the information is transmitted for the first time, the Sendmail program under the / var / mail directory automatically establishes a mailbox for the user. 6.1.1.9 Creating a password is a guarantee for system security. Each user should use a combination of 6--10 characters and numbers to form a password. For changing the password and password properties, see Passwd in the manual. ), Yppassed (1), or Nispasswd (1) In the SunOS 4.x system, the encrypted password is stored in / etc / passwd file with other information about the user, in SunOS 5.x, encrypted The password and the information related to the password are stored in the Shadow Domain (or local / etc / shadow file) of the NIS PasswD database, the permissions of the shadow file are --R ------, only root users can Read the file, and only the passwd, ypasswd, and nispasswd commands can write this file. The following is an example of an / etc / shadow file: root: xzvuaelvazzsw: 8223 ::::::.Aemon NP: 6445 :::::::::::::::::::::::::::::::::::: : NP: 6445 :::::::::::: : 6445 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::用] : In order to establish or modify the password, you can use command / usr / bin / passwd, users can build and modify their own password at any time, but only root users can establish initial passwords for other users. Note: Users can define, change, and view the properties of the password, such as the duration of the password, etc. Enter a new password twice while entering a new password. 6.1.2 Managing User Account Manage User Accounts Including modifications, cancel, and freezing of user accounts 6.1.2.1 Modify user account When the user's information is changed, you can use Database Manager to edit the information in Passwd Database, the login name of the general user account. The UID does not need to be modified unless it conflicts with the existing user name or UID. In a network environment, you need to modify the Auto-Home database for your home directory when you transfer from one system to another system or from one server to another server, you need to use Database Manager to modify the Auto-Home database for your home directory. Use Passwd if you need to modify the user password. 6.1.2.2 Cancel User Account The following is to cancel the user account step 1. Remove the user item from the NIS Passwd database NIS table or / etc / passwd file; 2. From NIS Group database, NIS MAP or / ETC / Group file The username is canceled; 3. Remove or archive from the printer access or denial; 4, decide whether to delete or archive all user files; 5, delete user mail files; 6, remove from the auto-home database Users; 6.1.2.3 Frozen user accounts Sometimes, you may want to temporarily or permanently freeze a registered account. Of course, you must do this, you have to have a good reason, such as users may not use this account or you have sufficient evidence that the account is often abused or safe. The simplest method for freezing a registration account is to lock the user password in the Password database using Database Manager. In the local system, you can control the user account by setting the password period, the logout date, or the user's fixed gap control user account, and the simple method of freezing users is to temporarily change the password of the user account. 6.2 Setting and Managing User Group Group Database (Table or Local / etc / Group file) Store information about the user group, commonly referred to as a Unix group. A user group is a user collection that can share files and other system resources, for example, users of the same topic group can form a user group. Each user group has a GID number (group label number, similar to UID), which is the internal identification number of the system, one group should have a group name and a username, the user group can be defined by the following methods: * In the user account Using GID to define the user's basic group, that is, add a new GID number in the group domain of the PasswD database. * Enter the name of the group in the Group database, the second method of the GID number, and the user's behalf defines the user group than it defines a group name for each group. All users belong to a group base group, although this is not required by the system, but you must join the user to the member table of the basic group, in addition to the basic group, users can also belong to 16 additional groups, specific The implementation method is to add users to the membership of the group. The group command can be used to list all user groups containing the user, with one of the basic groups at a certain time, but the user can temporarily change the basic group using the newgrp command. Some application systems (such as file systems) only care about the basic group of users, such as file owners, account data only affect the basic group, and other application systems may consider supporting additional groups that support users, such as members of Sysadmin Group. You can use the Administration Tool to change the database. Usually we want to set user, groups, and other read / write / execute permissions on files, directory, which are security guarantees. If your basic group or attached (Secondary Group) is not enough, then you can't save Take someone else's documents, for example, a TechWrite group that can be created for technical information, and establishes appropriate permissions for the directory where the group is located, so that only the group member can modify the file in this directory. User groups can be valid for local systems or throughout the network. With the network, the user group can allow a set of users on the network to access a set of files, while other users cannot operate them. 6.2.1 Setting the domain value group database in the group database (table or local / etc / group file) contains some major domain items: * Group name * Group Number (Group ID) * Member List In addition, Group password is also one of them, but rarely uses, it is left behind, usually, usually, or only fills in an asterisk. 6.2.1.1 Set Group Name Domain This domain contains a group name, such as a college chemistry department can be named CHEM in a member, and the group name can be composed of 9 words. 6.2.1.2 Setting the Group ID Domain This domain contains a group identification number, GroupID must be unique, each Group ID is an integer between 0-65535, but usually values between 100-60000 ( The 60001 and 60002 assigned to Nobody and NoAccess, and the integers below 100 is preserved for the system default account.) When using the Administration Tool to increase the account, you must specify the user's basic group. 6.2.1.3 Setup Message This domain contains all user membership tables, and the username can be separated from the username, which must be the registration name defined in the PasswD database, as mentioned above, each user can belong to the same 17 groups. 6.2.2 Establishing the default UNIX user group SUNOS 5.X provides the following default groups: root :: 0: root other :: 1: bin :: 2: root, bin, demon sys :: 3: root, BIN, SYS, ADM :: 4: root, uucp uucp :: 5: root, tty, uucp mail :: 6: root tty :: 7: root, uucp lp :: 8: root, lp, adm nuucp :: 9: Root, Nuucp Staff :: 10 Daemon :: 12: Root, Draemon Nobody :: 60001: NoAccess :: 60002: Can join GID 14 in Nis Group database, local / etc / group file, All users in this group can create new groups using the Administration Tool 6.2.3 as system management may often establish a new user account, and must first establish the user group and GID number before the user is specifically allocated. The Administration Tool can be used to establish and maintain the network and the local user group. When using the Administration Tool to establish or edit the group account, first, you must first be a member of the SYSADMIN group (GID 14). If you are running NIS on the network, then there must be Nis The database is permissions to operate. To create a new group, you need to know the following information: * Group members have user registration names (Login Names) * group member user number (Group Name) * Group Number (Group ID) followed by the following steps NIS database or local / etc / group file Add User Group: 1. Type Administration Tool; 2, select the Database Manager icon with the mouse, display the Database Manager window; 3. Select the Group database with the mouse and select the NIS naming service or NONE (local / etc file); (The member name is separated by a comma); 7. Click the Add button with the mouse to add the group to the Group database (or the local / etc / group file). If you want to add more user groups, repeat the above Two steps. 6.2.4 Modifying or Deleting User Group When there is a new member to join or send it to the group, you need to modify the member table of the user group account, that is, add or delete the user in an existing account, when some kind After the topic is completed, the group is no longer needed, so you can delete the group, and should pay attention to avoid conflicts when reuse the deleted group GID. 6.2.4.1 Modifying a group This step is to modify a group item: 1. Select the Group button with the mouse, select NIS or NONE, and press the LOAD button to display the Group Database window; 2. Select the database name you want to modify with the mouse. 3. Select the Modify Entry item from the EDIT menu to pop up the Modify Entry window and display the current value of the group. 4. Add or delete the user name in the corresponding field, then select Modify to modify the content in the database. 6.2.4.2 Deleting a group If the group number of a group is no longer needed, you can delete the group, and remove a group followed: 1. Select Group with the mouse, select Nis or None and press the LOAD button to pop up Group Database window; 2. Select the database name that you want to delete; Cancel, if you want to delete, select the DELETE button so that the group can be removed from the group database. Chapter 7, UNIX SHELL Commands This chapter will introduce: Various shell interpreters, standard shell introduction, c shell, Korn shell. Provided to the user three command interpreters in the Solaris 2.x software environment: Standard shell (the default shell or Bourne Shell, we call the standard shell), C shell and korn shell. For each user, there is a default shell command interpreter, and other SHELL can be re-entered in the command line to re-enter another shell interpreter. This chapter first introduces three kinds of common orders, and then make some detailed details respectively. 7.1 Public Order of Various Shell This section describes the commands used by various shells ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━ Table 7.1 Basic Characteristics of Various Shell Interpreters Bourne C Korn Alias No Command Edit No Enhanced CD No History No ignore Ctrl-D No Different from Profile Initial Files Work control has no exit file without file rewrite protection without the standard shell semantic compatibility is ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━ 7 7 7.1.1 Set a certain default shell in the user database or / etc / passwd file, registering shell is set in the last column of each user's registration item, the user can use the system The management tool or edit the local / etc / passwd file to modify the registration shell, but this user must be a member of the sysadm group, that is, the user's group number (GID) should be 14. If it is running NIS , there must be established and Delete the permissions of the NIS Data Library. Below is some steps from the user to register the shell: 1. Turn on the Database Manager window from the Administration Tool as needed. 2, on the user data, press Select, then press SELECT to select NIS or Non Nis service. If you select NIS , edit the PasswD database, otherwise edit the local / etc / passwd file. 3. Click the Load button to display the user database window. 4. Press the SELECT Mouse button on the user entry you want to edit and select the Modify item from the Edit menu. 5. Modify the text domain of the shell item, / bin / sh is the standard shell, / bin / csh is c shell or input / bin / ksh as a Korn shell. 6. Click the Modify button to modify the user's default shell definition, as long as the user re-registers into the system, even the new shell. 7.1.2 Change the Shell Type (SH, CSH, KSH) in the command line If the user does not modify the user database and wants to use another shell interpreter, you can simply enter the command name of the desired shell in the command line. . For example, if you want to use C shell, you can enter CSH, the default C shell prompt is followed by a percent sign (%) after the system name. $ CSH gtxa% If you want to change to Korn shell, you can enter KSH. The default prompt of Korn Shell is $ gtxa% KSH $ 7.1.3 exits from the shell interpreter (exit) If the user enters a certain A shell interpreter, simply add the exit and the Enter key to exit the current shell interpreter and return to the original Shell interpreter. $ EXIT GTXA% 7.1.4 Clear a shell window (CLEAR) In a shell window, the user can clear the content of a shell window, and re-display the shell's prompt to the top left corner of this window, for example to clear a window. Content, you can be entered into the Clear and Enter key: gtxa% Which openwin no openwin in. / Home / ignatz / usr / deskset / bin / usr / bin / home / ignatz / bin / bin / home / bin / etc / usr / ETC / USR / ETC / USR / UCB / USR / ETC / USR / UCB / USR / BIN GTXA% Clear The display content of the window is cleared, and then the prompt is replaced at the top. 7.2 Standard shell In the Solaris 2.x software environment, standard shell (Bourne Shell) is the default shell, which is developed by Mr. Steve Bourne during the At & T Bell Lab, compact, and simple But it also provides all programming features that can implement a shell file (script) consisting of various commands and procedures. Because how to write shell files beyond the scope of this article, we don't have it here. 7.2.1 Standard shell's initial file standard shell only uses an initial execution file, its name .profile, generally placed under the Home Directory, which is specifically used to set the user's environment. When the user is registered or starts the standard shell in the command line, it is read .profile file, in general, the user uses this file to set the user find path and other environment variables. 7.2.2 Defining the standard shell environment variable For standard shell and korn shell, define the syntax of the environment variable is the same, enter command =; export, for example: $ hz = 100; Export HZ $ 7.3 c shell c shell is Mr. Bill Joy is developed during UCB work, it has been accepted by many users of UNIX. C shell is completely different from standard shell and korn shell, and has its own unique syntax rules. The most important advantage of c shell is historical functions, command editing functions, and alias. The meaning of historical functions is that c shell can store the user's recently entered command record, and the user can display these commands, or you can reuse a command as it is, and the editing function is that the user can change a command by editing; alias can be Users use short names to represent long commands that are often used, or several common commands. 7.3.1C Shell's initial file c shell uses two initialization files for setting up the user's environment variable, which is .login and .cshrc, which are also .login and .cshrc, also placed under the basic directory of the user. When the user registers, c shell first reads .login, then read the .cshrc file. When the user starts the C shell from the command line, read-only .cshrc files (C shell run control). Because the .login file is not read every time the c shell is started, the user should set the environment variable in .login, set the user's search path name in the .cshrc file. 7.3.2C Shell Environment Variable Definition Using Command SetENV, for example: GTXA% STENV Display Rogue: 0 GTXA% 7.3.3 Creating C shell alias users can define the desired alias in the .cshrc file. Building an alias for: Alias, for example, you want to write an alias (alias) this command becomes A, you can add the following line in the .cshrc file: Alias A Alias is selected from the.cshrc file. Note that if there is a space in the command line, you must cause the entire command to be used in quotation marks, the quotation marks can be double quotes, or single quotes: Alias A Alias Ah Hiostory AC Clear A LF 1S -F a LL "LS - l | Home "a la ls -aas" Source .cshrc "AF 'Find -Name Core -Print' a Copytotape" Ter CVF / DEV / RMT / 0 * "7.3.4 Sets C shell's historical function to set C shell History features, just to be entered in the command line: set history = where n can be understood as the number of commands that can be stored in the c shell. Example: GTXA% Set History = 18 GTXA% The user can set the historical function in the shell window, or set it in the .cshrc file to set "permanent" historical features. 7.3.5 Using the C shell History Function In the command line, you can display the History command, you can display the already entered command, which is the last N command you are in, n is as described in Section 7.3.4. Method is set. GTXA% History 26 PWD 27 Kermit 28 CD HOWTO 29 TAR AVF / DEV / RMT / 0 30 LS -L HOWTO * 31 CD 32 CD Config / Art 33 LS -1 34 TAR CVF / DEV / RMT / 0 35 Histoty GTXA% Want to repeat the original command, can be entered !! and Enter, please record the previous command: gtxa% History 26 PWD 27 Kermit 28 CD HOWTO 29 TAR AVF / DEV / RMT / 0 30 LS-L Howto * 31 CD 32 CD CONRIG / ART 33 LS-1 34 TAR CVF / DEV RMT / 0 35 Histoty gtxa% !! History 27 Kermit 28 CD HOWTO 29 TAR AVF / DEV / RMT / 0 30 LS-L Howto * 31 CD 32 CD CONRIG / ART 33 LS-1 34 TAR CVF / DEV RMT / 0 35 History 36 History gtxa% To repeat the last word of the last command, you can enter! $, So that the last word of the previous command can be used as the current command One variable in the line. For example, you may have entered a full range of files, then you want to use this path name as a variable, use VI to edit this file or print this file: gtxa% ls -l / home / ignatz / quest gtxa% lp! $ GTXA%! $ can be used anywhere in the command line, in the following command line, file / home / ignatz / quase will copy to / TMP directory: gtxa% ls -1 / home / ignatz / quest gtxa% CP ! $ / tmp / home / ignatz / quest / tmp gtxa% To repeat the command of a number of serial numbers in the C shell history table,,, for example: gtxa% history 29 TAR AVF / DEV / RMT / 0 30 ls -lhowto * 31 CD 32 CD Config / Art 33 LS -1 34 TAR AVF / DEV / RMT / 0 35 LS -L 36 CD 37 LP HOWTO * 38 HISTORY GTXA%! 32 CD Config / Art GTXA% 7.3.6 Setting C Shell Returns (Stty ERASE) If the user wants to turn the button from the Delete key to the Backspace key, you can enter the following command: gtxa% stty outlet ^ h GTXA% Since then, the backspace is used as a character delete key. 7.3.7 Embedding C shell for all command path variables, so when the user puts a new command in a directory, this new command is not in this table, so that c shell will not Execute this new command. C shell To solve this problem, add the user's new command to the internal table of the Find path, provide the user with the REHASH command, the user can make this new command valid: gtxa% newcommand newcommand: Command NOT FOUND GTXA% Rehash GTXA% Newcommand GTXA% 7.3.8CSHELL Historical Command Edit User You can edit commands from c shell's historical table, whose symmetric: S // Let's exemplify: gtxa% History 31 CD 32 LS 33 CD / Home / Frame3.1 34 LS 35 CD 36 TAR CVF / DVE / RMT / 0 frame3.1 37 LP Questionnaire 38 LPSTAT -T 39 Echo $ PATH 40 HISTORY GTXA%! 39: S / A / A / ECHO $ PATH.: / home / winsor: / usr / openwin / bin: / us / winsor / bin: / bin: / home / bin: / etc: / usr / etc: / usr / bin: / home / Frame3.1 / bin gtxa% In this example, Article 39 Command line The user is wrong with a letter, and then the user has changed the letters of the wrong one with the c shell editing command, and the command execution is normal. 7.4 Korn shell Korn Shell is developed by David Korn, the AT & T Bell Lab. It is a standard shell supercharge. The Korn Shell uses the standard shell's syntax, but the Korn shell itself has added many new features, and the Korn shell is provided by the C shell. More convenient command editing methods, the Korn Shell also has history and aliasing. 7.4.1Korn shell's initialization file Korn shell uses two initial files, which are stored under the base directory of the user, and its name is .profile, and., The second file name is to let the user choose to name it. The main function is to set the environment. Similar to c shell, you can select the second file name as .Kshrc, then we use .Kshrc name to explain the second file. When the user registers, the Korn Shell first reads the .profile file, and then read .Kshrc. .Kshrc mainly allows users to build habits using the Korn shell, where. KSHRC should include commands that only Korn shells can execute. The user must use the ENV environment variable to specify this. The name of the file, the Korn shell sets the command syntax of the environment variable with the standard shell: =; export, which makes this variable to the Korm Shell and all the sub-process Effective, below. KSHRC file Setting environment variables: $ env = $ home / .kshrc; export env $ Obviously, the user must set the Env's environment variable in .profile, otherwise the Korn shell will be Can't find the .kshrc file. Note that the ENV environment variable is no default setting, and the user does not set the ENV, which cannot be used. Whether it is registered, start the Korn shell in the command line, .Kshrc file must be read when the Korn shell is started. 7.4.2Korn Shell Selection Korn shell There are many variables to specify the execution of the user's environment and control command. To display the current selection setting, you can enter: $ set -o The following example shows Solaris 2.x software the default settings in case of system Korn shell: $ set -o Current option settings allexport off bgnice on emacs off errexit off gmacs off ignoreeof off interactive on keyword off markdirs off monitor off noexec off noclobber off noglop off nounset off privileged off restricted off trackall Off Verbose Off Vi Off Viraw Off Xtrace Off $ We describe the specific meaning of these default selection items in Table 7.2. ━━━━━━━━━━━━━━━━━━━━━ 表 表 表 表 表 表 表 表 表 Table 7.2 Korn Shell Options Select Default Description AlleXport Off is defined, Automatically report Variables BGNICE ON To lower priority Perform all background job Emacs Off Setting Emacs / GMACS for online editor errexit off If the command returns a pseudo value, the shell performs an Err trap and exits GNACs Off to online. Editor Ignoreeof Off When running in an interactive shell, the SHELL does not quit in the file, only to exit the shell interactive on shell automatically enters the interactive mode, so the shell prompt is immediately displayed Keyword Off shell Variable assignment syntax Put the MARKDIRS OFF in the Variable Table of Variables MarkDirs Off Display a "/" Monitor ON Enable Job Control NOCLOBBER OFF when using steering output> When using steering output> When using steering output> Read this command, do not execute it, use this command to debug the syntax of the shell file NOGLOB OFF Cancel file name expansion NOLOG OFF NounSer OFF in history file NounSer OFF When shell wants to expand the variable that has been set Displaying an error message privilrged OFF When this selection is OFF, use the actual UID and GID, if ON, set the UID and GID to start this shell RESTRICKALL Setting a restricted shell trackAll OFF as a command When the first appearance, it becomes an alias verbose OFF when reading, ie the display input vi off set the VIRAW 0FF to the online editor ViRaw 0FF specifies that only one character XTrace OFF is executed each time. Time, show them, the habitual usage of Korn shell is in this choice .kskrc according to the custom of Korn shell .Kskrc Setting in the file. To enable a choice, you can enter: set -o To cancel this selection, you can enter: set O, for example, in .Kshrc, enter: set -o vi set the online editor to vi, but if it is Below this line: Set O VI is to close the VI as a online editor. Users can also use the same syntax to set other options for the Korn Shell in the command line. 7.4.3 Creating a Korn Shell Alias Korn shell Creating the syntax of the alias is: Alias = For example, alias command Alias alias is A, its commands: $ alias a = alias $ korn shell itself with some pre-defined alias, Show this alias table, simply enter the alias command: $ alias autoload = typeset -fu false = let 0 functins = typeset -f hash = alias - history = fc -1 integer = typeSet -i nohup = nohup R = fc -e - stop-kill-stop suspend = kill -stop $ $ true =: type = because -v $ Table 7.3 Describes the meaning of these default alias. Table 7.3 Korn Shell Default Doile Name Value Definition AutoLoad TypeSet -Fu Defines an Auto Load Function False Let -0 Returns Non-zero Status, often used to generate unlimited loop functions typeset -f display function table Hash alias -t - display tracking alias Table History FC -1 lists the commands of the integer typeset -i integer variable from the history file NOHUP NOHUP Even if you exit the system (log out), continue to perform the running Job R fc-E- Repeat the previous command Stop Kill -Stop Stop Jobs Suspend Kill -stop $$ Hanging Job True; Returns a zero exit Status Type Whence-V Display Command 7.4.4 With Korn Shell's online editor Editing Command Using Korn Shell's online editor, users are The execution command can edit the current command before. The Korn Shell's online editor can be Emacs, GMACS, or VI, using the Korn shell's selection feature, use the following command: set -o or use the Editor or Visual environment variable to set the online editor. The online (or online) editor VI of the Korn Shell is a subset of the modified VI program, which automatically enters the insertion mode when using the online VI editor. User Under normal circumstances, the user does not need to use a online VI editor, and can directly enter the command and execute it. If you want to edit a command, you can enter the command mode. Users can use the standard cursor mobile command to move forward, or edit this line using the VI editing command. When the user is editing the command, press the Enter to execute this command, and the entry Escape is back to the input mode. If the user wants to edit the command line in a VI file, you can open a V command to open a file containing the command line. When you exit the VI, the command is executed, please refer to the Quick Reference Table of Chapter 2 for a common command for VI. 7.4.5 Setting the History of the Korn Shell Storage All History Commands in a file, this file is specified with the Korn shell environment variable histfile. If this environment variable is set, store it in $ home / .sh- History. Variable HISTSIZE Specifies the number of stored commands, if the user does not set this environment variable, save the recently entered 128 commands, when the maximum number of commands is reached, continue to save the new command, and put the oldest The command is removed from the historical table. To set up a historical table, type: histsize =; Export Histsize For example, the following command line sets the size of historical tables to 200: $ histicsize = 200; Export HistSize $ User can temporarily set historical tables in a shell window The size can also be "permanent" in place in the .profile or .Kshrc file. 7.4.6 History Commands to Show Korn Shell Users to display the commands in the historical table using the FC and History, because the History has default alias FC -1, so users can alternately use these two commands. The following example shows the last 16 commands in the historical table. $ History 16 PS -EL | GREP OpenWin 19 CD 20 More Questionnaire 21 Su 22 LP / etc / passwd 23 lpstat -t 24 man Ksh 25 du 26 Maker & 27 TIP-2400 5551212 28 Alias H = History 29 Find / -Name KSH -PRINT 30 DF -K 31 History $, the user can also display the same information. The History and FC commands can also have additional variables so that users can specify a display range, such as displaying the last strip or in reverse display command, see KSH manual. 7.4.7 History Commands Using Korn Shell To use the commands in the Korn shell history table, you can use: r to reuse the commands by the specified command, for example, to reuse the 27th command: $ R 27 TIP-2400 5551212 (Some information is displayed), if it is repeatedly executed the last command in the historical table, simply use R. 7.4.8 Editing Historical Commands of Korn Shell Use the FC command, the user can display a specific history command and edit this command, its syntax is: FC [-e] [- r] [] or FC- E - [= Select " E is used to specify an editor. If you do not specify an editor, use the FCEDIT environment variable, the default value of this environment variable is / bin / ed. The selection item is the command in the reverse display history table, that is, the recent command is displayed in the historical table. If the range is not specified, the last command is edited. For example, the user wants to use the last command in the historical table in the VI to edit: fc -e vi creates a file containing the last item with the historical table, as long as the user edits this command and saves these changes, Execute this command. Chapter 8, Management System This chapter will introduce: Display system proprietary information, configure additional exchange room, create local mail alias 8.1 Display system proprietary information Use this section to get system proprietary information, such as host ID number, hardware Type, processor type, OS version number, system configuration, system run, and system date and time, then explain how to set system date and time, and change system time domain. 8.1.1 Determine the host ID number (Sysdef -h) To obtain the system's host ID number, type SYSDEF -H in the command line, and the system will display the host ID. This command replaces the hostid of SunOS4.x, the HostID command can also be used. GTXA% SYSDEF -H HOSTID 554095CC GTXA% 8.1.2 Determines the hardware type (uname -m) Type uname -m, obtain the hardware type of the system, providing the SunOS4.x command Arch of similar information, there is no existence in Sunos5.x . GTXA% uname -m Sun4c gtxa% 8.1.3 Determines the processor type (uname -p) To get the system type, type uname -p, the processor type of the system is displayed, this command replaces the Mach command of SunOS. GTXA% Uname -P SPARC GTXA% 8.1.4 Determines the OS version number (uname -r) command uname -r gives OS version information GTXA% Unam -R 5.5 gtxa% 8.1.5 Display System Configuration Information (PRTCONF) To display the system Configuration information, type prtconf, and system configuration information is displayed. GTXA% Prtconf System Configuration; Sun Microsystems Sun4c Memory Size: 16 Megabytes Sun 4/65, Unit # 0 Options, Unit # 0 ZS, Unit # 0 ZS, Unit # 1 FD, Unit # 0 (no driver) Audio, Unit # 0 (no driver) sbus, unit # 0 dma, unit # 0 ESP, Unit # 0 Scsibus, Unit # s SD, Unit # 0 SD, Unit # 1 Le, Unit # 0 CGSIX, Unit # 0 auxiliary -io , Unit # 0 (NODRIVER.) ... gtxa% Display system configuration information is to type the command sysdef, the system configuration information is displayed. GTXA% sysdef hostid 530080d2 sun4c configuration devices options, unit # -1 zs, unit # 0 zs, unit # 1 fd, unit # -1 audio, unit # -1 sbus, unit # 0 DMA, Unit # 0 ESP, Unit # 0 SCSIBUS, Unit # 0 SD, Unit # 0 SD, Unit # 1 Le, Unit # 0 CGSIX, Unit # 0 auxiliary -io, unit # -1 interfacerupt -enable, unit # -1 memory-error, unit # -1 Counter-timer, unit # -1 eeprom, unit # -1 pseudo, unit # 0 lo, unit # 0 TIDG, Unit # 0 TIVC, Unit # 0 ... gtxa% 8.1.6 Determine how long is the system has run? To know how long it has been running, type the UPTime, the local system, the number of users, the average number of negative numbers, the average negative number is displayed GTXA% uptime 11:18 AM UP 5 Day (s), 16: 12 Uses, Load Average: 16.46 .15.92.15.55 gtxa% To know when the system starts, type WHO -B, the last month, day, time and other information displayed. GTXA% WHO -B SYSTEM BOOT JU1 14 08:49 GTXA% 8.1.7 Determines the Date and Time of the System (Date) To display the date and time of the system, type DATE, the date and time of the system are displayed. GTXA% Date Tue JU1 14 19:40:47 PST 1992 GTXA% 8.1.8 Setting the date and time below is the step of resetting the system date and time: 1, becoming a superuser 2, type Date, here MM is the month DD is the day, HH is, MM is division, yy is the year, so the date and time of the system are reset by the parameters you specify. GTXA% Su Password: #date Tue Ju1 14 16: 07: 01pst 1992 #date 07141552 Tue JU1 14 15:52: 00 PST 1992 # 8.1.9 Change the System Time Zone (/ etc / timezone) Time Zone in / etc / timezone file In setting, the available US time zone variables are as follows. Complete time zone variables See the USR / Share / Lib / ZoneInfo directory. US / ARIZONA US / Central US / East-Indiana US / Hawaii US / Mountain US / Pacific US / Pacific-New US / YUKON The following is the step of changing the time zone: 1, becoming a super user. 2, edit the / etc / timezone file, change the TZ =