📄 6.t
字号:
.\" Copyright (c) 1980, 1986, 1988, 1993 The Regents of the University of California..\" All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)6.t 8.1 (Berkeley) 7/27/93.\".ds LH "Installing/Operating \*(4B.ds CF \*(Dy.Sh 1 "System operation".PPThis section describes procedures used to operate a \*(4B UNIX system.Procedures described here are used periodically, to reboot the system,analyze error messages from devices, do disk backups, monitorsystem performance, recompile system software and control local changes..Sh 2 "Bootstrap and shutdown procedures".PPIn a normal reboot, the system checks the disks and comes up multi-userwithout intervention at the console.Such a rebootcan be stopped (after it prints the date) with a ^C (interrupt).This will leave the system in single-user mode, with only the consoleterminal active.(If the console has been marked ``insecure'' in.Pn /etc/ttysyou must enter the root password to bring the machine to single-user mode.)It is also possible to allow the filesystem checks to completeand then to return to single-user mode by signaling.Xr fsck (8)with a QUIT signal (^\|\e)..PPTo bring the system up to a multi-user configuration from the single-userstatus,all you have to do is hit ^D on the console. The systemwill then execute.Pn /etc/rc ,a multi-user restart script (and.Pn /etc/rc.local ),and come up on the terminals listed asactive in the file.Pn /etc/ttys .See.Xr init (8)and.Xr ttys (5) for more details.Note, however, that this does not cause a filesystem check to be done.Unless the system was taken down cleanly, you should run``fsck \-p'' or force a reboot with.Xr reboot (8)to have the disks checked..PPTo take the system down to a single user state you can use.DS\fB#\fP \fIkill 1\fP.DEor use the.Xr shutdown (8)command (which is much more polite, if there are other users logged in)when you are running multi-user.Either command will kill all processes and give you a shell on the console,as if you had just booted. Filesystems remain mounted after thesystem is taken single-user. If you wish to come up multi-user again, youshould do this by:.DS\fB#\fP \fIcd /\fP\fB#\fP \fI/sbin/umount -a\fP\fB#\fP \fI^D\fP.DE.PPEach system shutdown, crash, processor halt and rebootis recorded in the system logwith its cause..Sh 2 "Device errors and diagnostics".PPWhen serious errors occur on peripherals or in the system, the systemprints a warning diagnostic on the console.These messages are collectedby the system error logging process.Xr syslogd (8)and written into a system error log file.Pn /var/log/messages .Less serious errors are sent directly to.Xr syslogd ,which may log them on the console.The error priorities that are logged and the locations to which they are loggedare controlled by.Pn /etc/syslog.conf .See.Xr syslogd (8)for further details..PPError messages printed by the devices in the system are described with thedrivers for the devices in section 4 of the programmer's manual.If errors occur suggesting hardware problems, you should contactyour hardware support group or field service. It is a good idea toexamine the error log file regularly(e.g. with the command \fItail \-r /var/log/messages\fP)..Sh 2 "Filesystem checks, backups, and disaster recovery".PPPeriodically (say every week or so in the absence of any problems)and always (usually automatically) after a crash,all the filesystems should be checked for consistencyby.Xr fsck (1).The procedures of.Xr reboot (8)should be used to get the system to a state where a filesystemcheck can be done manually or automatically..PPDumping of the filesystems should be done regularly,since once the system is going it is easy tobecome complacent.Complete and incremental dumps are easily done with.Xr dump (8).You should arrange to do a towers-of-hanoi dump sequence; we tuneours so that almost all files are dumped on two tapes and kept for atleast a week in most every case. We take full dumps every month (and keepthese indefinitely).Operators can execute ``dump w'' at login that will tell them what needsto be dumped(based on the.Pn /etc/fstabinformation).Be sure to create a group.B operatorin the file.Pn /etc/groupso that dump can notify logged-in operators when it needs help..PPMore precisely, we have three sets of dump tapes: 10 daily tapes,5 weekly sets of 2 tapes, and fresh sets of three tapes monthly.We do daily dumps circularly on the daily tapes with sequence`3 2 5 4 7 6 9 8 9 9 9 ...'.Each weekly is a level 1 and the daily dump sequence levelrestarts after each weekly dump.Full dumps are level 0 and the daily sequence restarts after each full dumpalso..PPThus a typical dump sequence would be:.br.ne 6.TScenter;c c c c cn n n l l.tape name level number date opr size_FULL 0 Nov 24, 1992 operator 137KD1 3 Nov 28, 1992 operator 29KD2 2 Nov 29, 1992 operator 34KD3 5 Nov 30, 1992 operator 19KD4 4 Dec 1, 1992 operator 22KW1 1 Dec 2, 1992 operator 40KD5 3 Dec 4, 1992 operator 15KD6 2 Dec 5, 1992 operator 25KD7 5 Dec 6, 1992 operator 15KD8 4 Dec 7, 1992 operator 19KW2 1 Dec 9, 1992 operator 118KD9 3 Dec 11, 1992 operator 15KD10 2 Dec 12, 1992 operator 26KD1 5 Dec 15, 1992 operator 14KW3 1 Dec 17, 1992 operator 71KD2 3 Dec 18, 1992 operator 13KFULL 0 Dec 22, 1992 operator 135K.TEWe do weekly dumps often enough that daily dumps always fit on one tape..PPDumping of files by name is best done by.Xr tar (1)but the amount of data that can be moved in this way is limitedto a single tape.Finally if there are enough drives entiredisks can be copied with.Xr dd (1)using the raw special files and an appropriateblocking factor; the number of sectors per track is usuallya good value to use, consult.Pn /etc/disktab ..PPIt is desirable that full dumps of the root filesystem bemade regularly.This is especially true when only one disk is available.Then, if theroot filesystem is damaged by a hardware or software failure, youcan rebuild a workable disk doing a restore in thesame way that the initial root filesystem was created..PPExhaustion of user-file space is certain to occurnow and then; disk quotas may be imposed, or if youprefer a less fascist approach, try using the programs.Xr du (1),.Xr df (1),and.Xr quot (8),combined with threateningmessages of the day, and personal letters..Sh 2 "Moving filesystem data".PPIf you have the resources,the best way to move a filesystemis to dump it to a spare disk partition, or magtape, using.Xr dump (8),use.Xr newfs (8)to create the new filesystem,and restore the filesystem using.Xr restore (8).Filesystems may also be moved by piping the output of.Xr dumpto.Xr restore .The.Xr restoreprogram uses an ``in-place'' algorithm thatallows filesystem dumps to be restored without concern for theoriginal size of the filesystem. Further, portions of afilesystem may be selectively restored using a method similarto the tape archive program..PPIf you have to merge a filesystem into another, existing one,the best bet is to use.Xr tar (1).If you must shrink a filesystem, the best bet is to dumpthe original and restore it onto the new filesystem.If youare playing with the root filesystem and only have one drive,the procedure is more complicated.If the only drive is a Winchester disk, this procedure may not be usedwithout overwriting the existing root or another partition.What you do is the following:.IP 1.GET A SECOND PACK, OR USE ANOTHER DISK DRIVE!!!!.IP 2.Dump the root filesystem to tape using.Xr dump (8)..IP 3.Bring the system down..IP 4.Mount the new pack in the correct disk drive, ifusing removable media..IP 5.Load the distribution tape and install the newroot filesystem as you did when first installing the system.Boot normallyusing the newly created disk filesystem..PPNote that if you change the disk partition tables or add new diskdrivers they should also be added to the standalone system in.Pn /sys/<architecture>/stand ,and the default disk partition tables in.Pn /etc/disktabshould be modified..Sh 2 "Monitoring system performance".PPThe.Xr systatprogram provided with the system is designed to be an aid to monitoringsystemwide activity. The default ``pigs'' mode shows a dynamic ``ps''.By running in the ``vmstat'' modewhen the system is active you can judge the system activity in severaldimensions: job distribution, virtual memory load, paging and swappingactivity, device interrupts, and disk and cpu utilization.Ideally, there should be few blocked (b) jobs,there should be little paging or swapping activity, there shouldbe available bandwidth on the disk devices (most single arms peakout at 20-30 tps in practice), and the user cpu utilization (us) shouldbe high (above 50%)..PPIf the system is busy, then the count of active jobs may be large,and several of these jobs may often be blocked (b). If the virtualmemory is active, then the paging demon will be running (sr willbe non-zero). It is healthy for the paging demon to free pages whenthe virtual memory gets active; it is triggered by the amount of freememory dropping below a threshold and increases its pace as free memorygoes to zero..PPIf you run in the ``vmstat'' modewhen the system is busy, you can findimbalances by noting abnormal job distributions. If manyprocesses are blocked (b), then the disk subsystemis overloaded or imbalanced. If you have several non-dmadevices or open teletype lines that are ``ringing'', or user programsthat are doing high-speed non-buffered input/output, then the systemtime may go high (60-70% or higher).It is often possible to pin down the cause of high system time bylooking to see if there is excessive context switching (cs), interruptactivity (in) and per-device interrupt counts,or system call activity (sy). Cumulatively on one ofour large machines we average about 60-200 context switches and interruptsper second and about 50-500 system calls per second..PPIf the system is heavily loaded, or if you have little memoryfor your load (2M is little in most any case), then the systemmay be forced to swap. This is likely to be accompanied by a noticeablereduction in system performance and pregnant pauses when interactivejobs such as editors swap out.If you expect to be in a memory-poor environmentfor an extended period you might consider administrativelylimiting system load..Sh 2 "Recompiling and reinstalling system software".PPIt is easy to regenerate either the entire system or a single utility,and it is a good idea to try rebuilding pieces of the system to buildconfidence in the procedures..LPIn general, there are six well-known targets supported by
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -