Skip to main content

XENIX Installation Guide for the Apple Lisa 2 May84 0

  • PublicationMac Garden Manuals
  • Date1984-05-01
  • Pages568
  • SourceXENIX_Installation_Guide_for_the_Apple_Lisa_2_May84_0.pdf
← Magazines XENIX Installation Guide for the Apple Lisa 2 May84 0
/ 568
Page 1
Loading…
Text content (OCR)
The X] ENIX” Operating System Installation Guide for the Apple Lisa 2” The Santa Cruz Operation, Inc. Information in this document is subject to change without notice and does not represent a commitment on the part of The Santa. Cruz Operation, Inc. and Microsoft Corporation. The software described in this document is furnished under a license agreement or nondisclosure agreement. The software may be used or copied only in accordance with the terms of the agreement. ©The Santa Cruz Operation, Inc., 1984 ©Microsoft Corporation, 1983 The Santa Cruz Operation, Inc. 500 Chestnut Street P.O. Box 1900 Santa Cruz, California 95061 (408) 425-7222 - TWX: 910-598-4510 SCO SACZ UNIX is a trademark of Bell Laboratories XENIX is a trademark of Microsoft Corporation Apple, Lisa 2, and ProFile are trademarks of Apple Computer Inc. Release: 68-5-24-84-1.0/1.0 Chapter 1 . ° XENIX Installation Guide 11 Overview 1 1.2 XENIXDistributionSystems 1 1.3. WhatYouNeed 1 14 BeforeYouStart 2 1.5 InstallationProcedure 3 1.5.1. StartingXENIXFromaFloppyDisk 3 1.5.2 InitializingtheHardDisk 4 1.5.3 StartingtheSystemFromtheHardDisk 6 1.5.4 CopyingtheXENIXSystemFiles 7 1.5.5 CreatingtheSuper—User Password 9 1.5.6 CreatingtheFirstUserAccount 10 1.6 TheNextStep 12 1.7 UpgradetnstallationNotes 13 17.1 UpgradeOverview 13 1.7.2 StartingXENIXFromaFloppy Disk 13 1.7.3 UpgradingtheFileSystem 14 1.7.4 StartingtheSystemFromtheHardDisk 15 1.7.5 CopyingtheXENIXSystemFiles 16 1.7.6 Restoring YourFiles 18 1.7.7 TheNextStep * 18 1.1 Overview The XENIX Operating System is a powerful multiuser, multitasking system of programs for your computer. It takes the place of your existing Operating Systemand givesyour computerthe power ofa much largerandmore expensivemachine. To do its work, the XENIX Operating System must be installed on your computer's hard disk. Thisallowsthe system totake control of your computer whenever youturnit on. The installation procedure consists of initializing your hard disk, then copying the XENIX system programs from the XENIX distribution floppydisks to the initialized hard disk. Note: “‘floppydisks”’ refers to the Sony Micro Floppydisks on which your system isdistributed. 1.2 XENIX Distribution Systems Thecomplete XENLX System isa set ofthree distribution systems: The XENIX Operating System The XENIX Text Processing System The XENIX Development System The Operating System contains the XENIX programs you need tocreate user accounts, manage filesystems and perform system maintenance tasks. The Text Processing System contains the XENIX programs uscd to create, edit, and typesct documents. The Developmen System contains the XENIX programs you need tocreate, compile, link, and debug assembly and high level language programs. You install each package separately. Installation of the XENIX Operating System is required before you can install the Text Processing or Development Systems. The software for cach System is write protected, except the Boot floppydisk of the ‘Operating System. 1.3. What You Need This guide explains howto install the XENLX Operating System. Todoso, youneced: 1. ALisacomputer with at least 512k bytes of memory Itmusthaveeither a)alOmegabyte internal harddisk or b)at least one external S megabyte ProFile™ harddisk 2. ‘TheXENIX Operating System distribution floppydisks Ifyouhavea LISA 2/10System, (which comes with an internal 10 megabyte disk), no otherconnectionsare necessary. If you have a LISA 2/5 System, (no internal hard disk), You must have at least one external S megabyte ProFile disk. The first ProFile must be connected to the built—in XENIX Installation Guide Parallel port onthe Bock of the Lisa camper Ifyou intend to install the XENIX Text and/or the XENIX Development Systems, you will also need a second ProFile hard disk. This second disk must be connected to the upper parallel port of a parallel expansion board installed in expansion slot ! ofthe Lisa computer. For details about these connections, see the hardware manuals provided with your computer and the section called ‘‘Adding a Second ProFile Disk’ in Chapter 7 of the XENIX Operations Guide. 1.4 Before You Start Before you begin the installation procedure, make sure that your computer is fully assembled and that you are familiar with its operation. Inparticular, you shouldknow: How to tum the computer on and off. How to tum the ProFile hard disk on and off. How to insert a floppydisk into a disk drive. How to reset your computer with the RESET switch. Ifyou have just assembled your computer for the first time, or if you are unsure about the four items listed above, take a few moments to review the hardware manuals provided with yourcomputer and harddisk. During the installation, you will needtousethekeyboard to enterinformation. Always type requested names and numbers exactly as shown. Begin each command at the beginning of a new line. Complete a line by pressing the RETURN key. Throughout this guide, theRETURNkey isreferredtoas: RETURN Ifyou make a typing error, you can delete the character you just typed by pressing the BACKSPACE key or by holding down the APPLE key and typing the letter ‘‘h’’. if you wish to delete everything you have typed ona line, holddown the APPLE key andtype the letter ‘“u"’. Many keys and key combinations have special meanings tothe XENIX system. These keys and key combinations have special names that are unique to the XENIX system and may or may not correspond to the keytop labels onyour keyboard. For more complete details about special XENIX keystrokes, see Chapter 1 in the XENIX OperationsGuide. 1-2 Introduction Note If your keyboard docs not have an APPLE key (a key with an apple on it), use the COMMAND key instead. 1.5 Installation Procedure The installation procedure consists of six steps. You begin the installation by starting the XENIX system from the ‘‘boot’’ floppydisk. Next, run the hdinit program to initialize the hard disk and copy important XENIX programs to it. Then you start the system again (this time from the newly initialized hard disk) and run the firsttime program to copy the rest of the XENIX system program files to the hard disk. Finally, you create the super —user password and the first user account. The following sectionstell you howto perform each step. When you have finishedthe installation, keep this guide and the distribution floppydisks in a safe place. You will needthemagainif you wish toreinstall the system for any reason. 15.1 Starting XEN1X From a Floppy Disk Starting the system is the first step of the installation procedure. To do this, you will need the distribution floppydisk labeled ‘“Boot’’. Once you have the floppydisk, follow these steps: 1. (For those with external hard disks only): Turn on the power to cach hard disk. 2. (Forthose with external hard disks only): Wait for the “‘ready"” light onthe front ofthe hard disk drive(s)to glow a steady red. 3. Turnonthepowertothecomputer. 4. — Wait foraclick (listenclosely — — the click occurs soon after youturnonthe power). 5. Hold downthe APPLE key and press the ENTER key onthe meric key pad attheright front corner of thekeyboard. The computer will first display a set of icons representing cach phase of its self—test sequence, andthendisplay twonumbered boxes. 6. Nowholddownthe APPLE key and press the number 3. The computer will display amenv of icons representing each of the peripheral devicesattached tothe system. 7. Insert the “‘Boot'’ distribution floppydisk into the floppy drive. Make sure thatthe label faces up and that you insertthe side with the auto— shutter first. 1-3 XENIX Installation Guide 1.5.2 Hold down the APPLE key and press the number 2 which should correspond tothe icon forthe floppydisk. The computer reads the XENIX boot program from the floppydisk and begins to execute it. The boot program displaysthe boot PresstheRETURNkey. The boot program reads a copy of the XENIX Operating System kernel from. the file fd(2,0)xenix and begins to execute it. To show that it isreading this file, the program displays the message: 3 £0(2,0)xenix Oncethe system beginstorun, it displays some copyright information, then the following message and boot floppy prompt: Lisa XENIX V3.0 — Boot Floppy (backspace is *h, erase line is “u) Use “‘hdinit’’ to initialize hard disk. Use ‘‘upgrade’’ to upgrade 2.3 to 3.0 xenix Initializing the Hard Disk ‘You must now initialize the hard disk with the hdinit (for ‘‘hard disk initialization’) program. This program creates a “file system”’ onthe hard disk, then copies system programs from the boot floppydisk to the new file system. If you have a second hard disk, the program also creates a file system on this disk and prepares it for receiving user's directories and files during normal XENLX operation. Toinitializethe disk or disks, follow these steps: 1-4 AInresponse tothe prompt: <BootFloppy> type: hdinit and press the RETURN key. The system reads the program from the boot floppydisk, beginsto execute it and displays the message: WARNING: This installation program will destroy the present contents of your hard disk. Do you want to continue <y/n>? Ifyou have any files onthe harddisk that you wishtosave, type: a and pressRETURN. The followingmessage appears: Aborting ... Installation At this point the system shuts down automatically, and the following messageisdisplayed: *** Normal System Shutdown *** Reboot your existing system, and after you have backed upeverything you wishto save, restart the XENIX installation procedure from the beginning. Tocontinue theinstallation, type: y and presstheRETURNkey. Next, themessage: Enter size of hard disk (S or 10): will appear. If you are installing the system on a Lisa with one 5 megabyte hard disk, the correct response is “‘5°". Lf you are installing the system ona Lisa 2/5, which has a SMB ProFile attached to the parallel interface port, the response should be “‘S"’. Fora Lisa 2/10, with an internal 1OMBhard disk, the appropriate response would be “10"". The program creates the file system and begins to copy XENIX system files toit, reporting its progressas it goes. Making file system... After the file system is made, and the initial files copied to the hard disk, the fsck utility is runto verify the contents of the harddisk and displays: ideviroot ** Phase 1 — Check Blocks and Sizes ** Phase 2 — Check Pathnames ** Phase 3 — Check Connectivity ** Phase 4 — Check Reference Counts ** Phase 5 ~ Check Free List XX files XXX blocks XXXX free Thebootblock willthenbe copiedtothehard disk: Installing hard disk Boot... When the hdinit program is finished, it stops the system, preparing it forthe nextinstallationstep. You will seethe message: Disk initialization is complete. ** Normal System Shutdown ** You are now ready to start the system from the hard disk. ‘XENIX Installation Guide Note If you are installing XENIX on a LISA 2/5, the hdinit program displays the message: drivename not on line when a profile disk is not connected to the proper parallel port or the disk’s power is not on. drivename is the name of the disk drive (e.g. pf0 or pf2). If you see the message, check the hard disk connections and make sure power is on, then press the RESET button and start 1.53 Starting the System From the Hard Disk ‘The third step in the installation procedure is to start the XENIX system by loading a copy of it from the hard disk into memory. Follow these steps: Press the On—Off button on the lower right front face of the Lisa once, to powerdownthe system. Wait Sto 1C-seconds andpressthebuttonagain. The system will first display the self—test icons, auto~ load the XENIX boot program from the hard disk then prim the prompt: boot: To load the XENIX system that has been loaded ontothe hard disk, type: Pf(0,0)xenix The computer reads a copy of the XENIX Operating System from the hard disk into memory. Once loaded, the system displays the copyright notice andthenthe message: Entering System Maintenance Mode Lisa XENIX 3.0 Hard Disk Initialization (backspace is “h, erase line is “u) The system immediately begins to execute the firsttime program, and you areready togoontothe next section. 1.5.4 Copying the XENIX System Files The firsttime program copiesthe XENLX program files from the remaining distribution floppydisks to the harddisk. It begins execution immediately after you start the system. from the hard disk, so you do not have to type its name as you did for the hdinit program. 1. The firsttime program begins by first asking if there isa second ProFile disk attached to the system, so that the software may be most efficiently distributed onthetwodisks. The system will prompt: Do you want /usr to be on a second profile <y/n>? 2. Ifyouareinstalling the system onaLISA 2/10, oronlyhave one profile disk, yourresponse should be ‘‘n’’, andyou should go ontothenext step. Otherwise, the correct response is ‘‘y’*, and the system will display the message: Before making the /usr filesystem, the second ProFile must be connected to the upper parallel port of the parallel expansion card in expansion slot #1, and the ‘ready’ light on the disk must be glowing a constant red. 1s the second disk connected and ready <y/n>? Ifthe disk is not ready, the system should be powered down, and the profile attached as described above. Installation may be resumed by going back to the beginning ofthis section. Otherwise, ifresponse is ‘‘y’’, the system will display the followingmessage: Making /usr file system on device /dev/usr ... The following software installation procedures will now load all files beginning with the path /usr onthe second profile. 3. Thenext stepistoloadin the set of XENIX Operating System floppydisks. It is very important in this procedure that the floppydisks be loaded in sequential numeric order. The next prompt willbe: Install Operating System distribution. <y/na>? type: y and presstheRETURNkcy. The program displaysthe following message: 1-7 XENIX Installation Guide For each floppy in the distribution set, insert the floppy and answer ‘y’. Type the letter ‘n’ after the last floppy. Should you ever see the message: tar: please mount new volume, then press RETURN insert the next floppy and press the RETURN key. Theénstall program will now prompt: First Floppy <y/n>? Choose the first floppydisk from the distribution set. (The floppydisks are numbered beginning with 1.) Ansert the floppydisk into the floppy drive, and type a ‘“‘y"’ followed by the RETURN key. The program copies files from the floppydisk anddisplaysthe nameofeach fileas it iscopied. Wait forthe message: Next Floppy <y/n>? Remove the first floppydisk from the floppy drive, choose the next floppydisk from the set and repeat the last step. Once the system has read this floppy, it will display: checking ownerships and permissions for XENIX run-time system ... All of the XENIX files necessary to run most application software have now been installed. You may choose to install the rest of the distribution disks later, by running the program Jetc/install Ifyou donot need the rest of the “Operating System’ files, goontothe next step. Otherwise, continue this procedure until all of the remaining “Operating System” floppydisks have been read in. From time to time, you will see other messages beginning with ‘checking ownerships and permissions’. These are issued by initialization files that are executed automatically as they arereadin from floppydisks. When all floppydisks have been copied, type ‘‘n’* and press the RETURN key when you seethe Next Floppy <y,n>? message. Whenitisdone, theprogram displaysthe following message: Operating System installation complete. The firsttime program will prompt for whether the XENIX Development System and XENLX Text Processing System are tobe installedat this time. If you have only one 5 megabyte disk, you will not have sufficient disk 10. i. 12. 1.5.5 Installation capacity to completely install either of these two packages. The complete XENIX System (all three packages) requires about 7 megabytes of disk capacity. If you wish to install them at a later time, or not at all, you should answer ‘‘n’" tothe following prompts. When you are ready to install these packages, refer to the Installation Notes at the beginning of the XENIX Programmer’ sGuide orXENIX Text Processing Guide . Ifyou choose to install either orboth ofthe optional packagesatthistime, the sequence of steps is identical to that for installing the XENIX Operating System. You may refer to step 3 in this subsection. You will be prompted with: Install Software Development distribution <y/n>? Answer “‘y’’ and install this distribution set, or answer ‘‘n’’ and goontothe next distribution set. You will then beprompted with: Install Text Processing distribution <y/n>? Again, answer “‘y’’ or ‘‘n’” depending on which XENIX distribution sets youhave purchased. The last thing the firsttime program does is initialize the lost+found directory. The message displayedis: making /lost+found directory ... Once installation of all the packages is complete, the XENIX system displays the message: Xenix Installation complete. ** Normal System Shutdown ** The system may now be rebooted from the hard disk by turning the system. off, then on again. Now that the full system has been installed, the boot sequence fromthe harddisk isas follows: boot: To boot XENIX from the hard disk, press the RETURN key. The system will respond: pf(0,0)xenix and the system will be loaded. Next the system copyright message willbe displayed andthenthe following: Type CONTROL—d to continue with normal startup: (Type the root passwd to enter system maintenance). You should now create the super—user password, as described in the following section. Creating the Soper—User Password The super—user password keeps the system safe from unauthorized use. It is 1-9 ‘XENIX Installation Guide important that you create a super~user password immediately after the system has been installed to ensure maximum protection of the system and prevent unauthorized use of the super—user account (for a complete description of the super—user, see the XENLX Operations Guide). Tocreate the super—usex password, followthese steps: 1. Pressthe RETURNkcy. The system displays message anda prompt: Entering System Maintenance Mode TERM = (lisa) PresstheRETURNkey. The screen will clear, thendisplay: Terminal type is lisa # 2. Type passwd root and presstheRETURNkey. The system displaysthe message: New password: The new password can be any sequence of letters, numbers, and/or punctuation marks, but must beat least S characterslong. 3. ‘Type the new password and press the RETURN key. The system docs not display the password as you type so type carefully. After you press the RETURN key, the system displaysthemessage: Retype new password: 4. — Type the new password once more and press the RETURN key. Make sure you type it correctly, otherwise the program will ignore the change. If you type it incorrectly, you should go back to step two of this section and start over again. The super—user password is now in place. From now on, the password will be required whenever you attempt to accessthe systemasthe super—user. Do not forget the super—user password. Restoring a forgotten super—user password requires booting the system from the XENIX Boot floppy. Refer to the chapter on “Solving System Problems’ section on ‘‘Replacing a Forgotten Password”’ in the XENIX Operations Guide. Ifnecessary, keepa copy of the password ina safe place. 1.5.6 Creating the First User Account ‘The last step in the installation istocreate the system's first user account, “‘guest”’. The “‘guest’’ account is a temporary workspace onthe system that you may usc to practice with the XENIX system. Later, after installation is complete and you are familiar with the XENIX commands, you can remove the ‘‘guest’’ account and create private 1-10 accounts for allthe users onthe system. Tocreate the firstuser account, follow these steps: 1 Type mkuser and presstheRETURNkey. The systemdisplaysthe message: Newuser Addausertothe system Doyou require detailed instructions? (y/n/q): Type ‘‘n"’ and press the RETURN key (You can examine the instructions at some other time). The system displaysthe message: Enter new user’s login name: Type: guest and press the RETURN key. The name ‘‘guest”’ is now the login name for thenewuser account. Next, the program asks fortheuser’s password. Enter password: Just press the RETURN key. This allows you to use the account without giving apassword. Next, theprogramasks fora group name. Enter group: Type group and presstheRETURNkey. Finally, the program asks forcomments. guest account and press the RETURN key. The program asks if you wish to change anything. Type ‘‘n” and press the RETURN key. The program now displays information about the new account andasks if you wish tocreate another. Type “‘n” andpresstheRETURNkcy. The new guest account is now ready. Later, when you turn to the XENIX User's Guide, you may use this account to practice logging in, making directories, and Tunning programs. XENiX Installation Guide 1.6 The NextStep Ifyou are familiar with the XENLX Operating System, you may continue with normal startup and begin working. Just hold down the APPLE key and type the letter ‘‘d’". Refer to the explanation of normal startup inthe XENIX Operations Guide if youhave problems. Ifyou are not familiar with the XENIX Operating System, we recommend that you halt the system and turn to the XENLX User’ s Guide and the XENLX Operations Guide to Jearnhowtostartthesystem, howtologin, and howtorunprograms. Tohaltthe system, followthese steps: 1. Type fetchhaltsys and pressthe RETURNkcey. The system displaysthe followingmessage: ** Normal System Shutdown ** 2. Tumoffthepowertothecomputer. 3. Turnoffthepowertotheharddisk. Make sure you see the shutdown message before you turn off the computer and hard disk. Installation 1.7‘ Upgrade Installation Notes 1.7.1 Upgrade Overview This section is intended for Lisa H owners using version 2 of the XENIX operating system who wish to upgrade to version 3.0. You will begin the upgrade procedure by starting the XENIX system from the ‘‘boot'* floppydisk. Next, you will execute the program called upgrade which will will convert the file system on the hard disk to XENIX 3.0 format, and copy important utility programs to it. Then you will start the system again (this time from the newly converted hard disk) and runthe secondtime program to copy the rest of the XENLX system program files to the hard disk. Finally, you will restore any local files you have installed since you received your version 2.3 system. The following sections tell you howto performeach step. Whenyou have finishedthe installation, keep this guide and the distribution floppydisks in a safe place. You will needthemagainif you wish toreinstall the system forany reason. 1.7.2 Starting XENIX From a Floppy Disk Starting the system is the first step of the upgrade procedure. Todo this, you will need the distribution floppydisk labeled ‘Boot’. Once you have the floppydisk, follow these steps: 1, (For those with external hard disks only): Turn on the power to cach hard disk. 2. — (Forthose with external hard disks only): Wait for the ‘‘ready"’ light onthe front ofthe hard disk drive(s)to glowa steady red. 3. | Turnonthepowertothe computer. 4. Wait foraclick (listenclosely — — the click occurs soon after youturnonthe power). 5. Holddownthe APPLEkey and pressthe ENTER key on the numeric key pad atthe right front comer of the keyboard. The computer will first display a set. of icons representing each phase of its self—test sequence, andthendisplay twomumbered boxes. 6. Nowholddownthe APPLE key and press the number 3. The computer will display amenu of icons representing each of the peripheral devices attached tothe system. 7. _ Insert the “‘Boot” distribution floppydisk into the floppy drive. Make sure thatthe label faces up and that you insertthe side with the auto— shutter first. 8. | Holddownthe APPLEkey and pressthe number 2 which should correspond tothe icon forthe floppydisk. The computer reads the XENIX boot program. 1-13 XENIX Installation Guide 1.7.3 from the floppydisk and begins to executeit. The boot program displaysthe following prompt: boot PresstheRETURNkcy. The boot program reads a copy of the version3.0 XENIX Operating System kernel from the file fd(2,0)xenix and begins to execute it. To show that it is reading this file, the program displaysthe message: 1 £d(2,0)xenix Oncethe system begins torun, itdisplays some copyright information, then the following message and boot floppy prompt: XENIX V3.0 Boot Floppy (backspace is “h, erase line is “u) Use ‘“‘hdinit"’ to initialize hard disk. Use ‘‘upgrade”’ to upgrade 2.3 to 3.0 xenix Upgrading the File System You must now convert the file system on the hard disk using the upgrade program. This program converts the file system on the hard disk to version 3.0 XENLX format, then copies system programs from the boot floppydisk to the newly converted hard disk file system. If you have a second ProFile disk, the program also converts the file system on this disk and prepares it for receiving user’s directories and files during normal XENIX operation. Toupgradethedisk or disks, followthese steps: Inresponseto the prompt: <BootFloppy> type: upgrade and press the RETURN key. The system reads the program from the boot floppydisk, begins to execute it and displaysthe message: converting file system to 3.0... A mumber of other diagnostic messages will be displayed as the program reads and writes the filesystem’s ‘‘super—block’’. Youncednotrespondto any questions; they are allansweredautomatically. The upgrade program goes on tocopy essential files tothe hard disk, make devices and install the new hard disk boot program. It also preserves your “/etcipasswd” as “‘/etc/passwd.SA VE”, then copies inthe new password file. Upgrade displays one—linemessages, suchas: copying files to hard disk ... twkeep you informed ofits progress. 2. Upgrade When the upgrade program is finished, it halts the system, in preparation forthenextinstallation step. You will see the message: ** Normal System Shutdown ** ‘Youare nowready tostart the system from the harddisk. Note if you are installing XENIX on a LISA 2/5, the hdinit program displays the message: drivename not on line when a profile disk is not connected to the proper parallel port or the disk’s power is not on. drivename is the name of the disk drive (e.g. pf0 or pf2). If you see the message, check the hard disk connections and make sure power is on, then press the RESET button and start the installation procedure from the beginning. 4 Starting the System From the Hard Disk The next step inthe upgrade procedure is to start the XENLX system by loading acopyof it from thehard disk intomemory. Followthese steps: 1 Press the On—Off button on the lower right front face of the Lisa once, to powerdownthe system. Wait Sto 10 seconds and pressthe buttonagain. The system will first display the self—test icons, auto— load the XENIX boot program from the hard disk then print the prompt: boot: Toload the XENIX system that has been copied ontothe hard disk, type: p£(0,0)xenix The computer reads a copy of the XENIX Operating System from the hard disk into memory. Once loaded, the system displays the copyright notice and thenthemessage: Entering System Maintenance Mode TERM = (lisa) PresstheRETURNkcy. Thedisplay screenclearsand shows: XENIX Installation Guide 1.7.5 Terminal type is lisa Backup your files, then run /secondtime If you have installed any of your own files on the disk, take this time to archive them to floppydisks. A useful tool for this purpose is tar; see the manual page tar(C) in C section of the XENIX Reference if you are unfamiliar with its operation. You must use format blank floppydisks before usingthem. You can format blank disks by using the diskutil utility. Tousediskuti type: /diskutil —f /devirfd You need not archive the file ‘‘/etc/passwd’’; the upgrade program has preservedacopy of your old file in‘‘/etc/passwd.SAVE"’. Once youhave backedupall ofyour files, typethe command ‘secondtime followedby RETURN. Copying the XENIX System Files The secondtime program copies the XENIX program files from the remaining distribution floppydiskstothehard disk. 1 The secondtime program begins by asking if there is a second ProFile disk attached to the system, so that the software may be most efficiently distributed onthetwodisks. The system will prompt: Do you want /usr to be on a second profile <y/n>? If you are installing the system on a LISA 2/10, or only have one ProFile disk, yourresponse shouldbe ‘‘n’’, andyou should goontothe nextstep. Otherwise, the correct response is ‘‘y’’, and the system will display the message: Before making the /usr filesystem, the second ProFile must be connected to the upper parallel port of the parallel expansion card in expansion slot #1. Is the second disk connected and ready <y/n>? Ifthe disk is not ready, the system should be powered down, and the ProFile attached as described above. Then turn on power tothe second ProFile, and wait forthe “‘ready”’ light toglowaconstant red, indicating that its self—test hascompleted. Installation may beresumed by going back to thebeginning ofthis section. Ifthe disk isready, you should answer “‘y"’, andthe system will display the following message: converting /usr file system to 3.0... During the rest of the upgrade procedure, files beginning with the path /usr Upgrade willbe installed onthe second ProFile. ‘The next step isto load in the set of XENIX Operating System floppydisks. It is very important in this procedure that the floppydisks be loaded in sequential numeric order. The next prompt willbe: Install Operating System distribution. <y/n>? type: y and press theRETURNkey. The programdisplaysthe following message: For cach floppy in the distribution set, insert the floppy and answer ‘‘y’’. Type the letter ‘‘n’’ after the last floppy. Should you ever see the message: tar: please mount new volume, then press RETURN insert the next floppy and press the RETURN key. ‘The install program will now prompt: First Floppy <y/n>? Choose the first floppydisk from the distribution set. (The floppydisks are numbered beginning with 1.) Insert the floppydisk into the floppy drive, and type a ‘‘y’’ followed by the RETURN key. The program copies files from the floppydisk, displaying the nameofeach fileas it is copied. Wait for themessage: Next Floppy <y/n>? Choose the next floppydisk from the set and repeat the last step. Once the systemhasread this floppy, it will display: checking ownerships and permissions for XENIX run-time system ... All of the XENIX files necessary to run most application software have now been installed. You may choose to install the rest of the distribution disks later, by running the program Jetclinstall. Ifyou donot need the rest of the XENIX Operating System files, goontothe next step. Otherwise, continue this procedure until all of the remaining ‘XENIX Operating System floppydiskshave beenreadin. Fromtimetotime, you will see other messages beginning with ‘‘checking ownerships and permissions’. These are issued by initialization files that are executed automatically as they are read in from floppydisks. When all floppydisks have been read in, type ‘‘n’’ and press the RETURN key when you seethe XENIX Installation Guide Next Floppy <y,n>? message. 8. The last thing the secondtime program does is initialize the lost+found directory. Themessagedisplayedis: making /lost+-found directory ... 9. Onceinstallation ofall the packagesiscomplete, the XENIX system displays themessage: XENIX Installation complete. ** Normal System Shutdown ** 10. The system should now be rebooted from the hard disk by turning the system off, then on again. Now that the full system has been installed, the boot sequence from the hard disk isas follows: boot: To boot XENIX from the hard disk, press theRETURNkey. The system will respond: pf(0,0)xenix and the system will be loaded. Next a copyright message and some configuration information will be displayed and then the following: Type CONTROL—d to continue with normal startup: (Type the root passwd to emter system maintenance). You should nowrestore filesthat you had backedup. 1.7.6 Restoring Your Files Press the RETURN key to enter system maintenance mode. Locate the floppydisks with your personal files, and reinstall these files onto the hard disk. Use the df command tomakecertain you have enough disk space forthe restorations. If you have modified the file /erc/passwd since you received your version 2 XENIX system, you will have to edit the new 3.0/etc/passwd file nowresident onthe hard disk. Use the text editor vi (or some other editor) and ‘‘Yank’” entries, line by line, from Jetc/passwd. SAVE (your old password file), and ‘‘put’’ them in /etc/passwd, being careful not to duplicate user id numbers. Each of the 3.0 entries is necessary to assure correct ownership of the new XENIX system files. 1.7.7 TheNextStep Since you are familiar with the XENIX Operating System, you may contime with normal startup and begin working. Just hold down the APPLE key and type the letter “«d’". Refertothe explanation of normal startup in the XENIX Operations Guide if you have problems. 1-18 Upgrade Tohahthesystem, follow these steps: 1. Type fetchhaltsys and presstheRETURNkey. The systemdisplaysthe followingmessage: ** Normal System Shutdown ** 2. Tummoffthe powertothe computer. 3. Tumoffthe powertothe harddisk. Make sure you see the shutdown message before you turn off the computer and hard disk. The XENIX” Operating System Operations Guide for the Apple Lisa 2” The Santa Cruz Operation, Inc. Information in this document is subject to change without notice and does not represent a commitment on the part of The Santa Cruz Operation, Inc. and Microsoft Corporation. The software described in this document is furnished under a license agreement or nondisclosure agreement. The software may be used. or copied only in accordance with the terms of the agreement. ©The Santa Cruz Operation, Inc., 1984 ©Microsoft Corporation, 1983 The Santa Crus Operation, Inc. 500 Chestnut Street P.O. Box 1900 Santa Cruz, California 95061 (408) 425-7222 - TWX: 910-598-4510 SCO SACZ UNIX is a trademark of Bell Laboratories XENIX is a trademark of Microsoft Corporation Apple, Lisa 2, and ProFile are trademarks of Apple Computer Inc. Release: 68-5-24-84-1.0/1.0 Contents Auaone ReRN ov Rone Ye Peeyew w ey AuavKE BADR 8 pera 4.5 Introduction Installing XENIX 1 Overview 1 The System Manager | The Super—User Account 2 The Keyboard 2 Using This Guide 3 Starting and Stopping the System Introduction 1 Starting the Sytem 1 Logging In as the Super—User 2 Stopping the System 3 Preparing XENIX for Users Introduction 1 Adding a User Account 1 Changing a User's Password 4 Removing a User Accoumt 10 Using File Systems Introduction 1 Managing File Ownership 7 System Security 8 Using XENIX Accounting Features 9 Maintaining File Systems 1 Introduction 1 2 Maintaining Free Space 1 3 File System Integrity 6 Backing Up File Systems 1 Introduction 1 2 Strategies for Backups 1! 3 Using the sysadmin Programs 1 4 Using the tar Command ef Using Peripheral Devices 7.1 Introduction 1 7.2. Using Muhiple Screens 1 7.3 Adding a Terminal 2 7.4 Changing Serial Line Operation 3 7.5. Setting the Terminal Type “5 ~ 7.6 Removing a Terminal 6 7 Adding a Second Profile Disk 6 8 Adding Other Profile Disks 8 9 Adding a Parallel Lineprinter 9 10 Adding a Serial Lineprinter 9 11 Supporting Modems and Terminals 12 Adding a Tecmar Serial Catd 12 Solving System Problems 8 8.1 Introduction 1 8.2 Restoring a Nonechoing Terminal 1! 8.3 Freeing a Jammed Lineprinter 1 8.4 Stopping a Runaway Process 2 8.5 Replacing a Forgotten Password 3 8.6 Removing Hidden Files 3 8.7 Restoring Free Space 4 8.8 Restoring Lost System Files 4 8.9 Restoring an Inoperable 8.10 Recovering from a System 4 8.11 Changing XENIX Initialization 5 10 Building a Micnet Network 9 9.1 Introduction 1 9.2 Planning a Network 1 9.3 Building a Network 5 9.4 Starting the Network II 9.5 Testing a Micnet Network 12 XENIX Special Device Files 1 Introduction 1 2 File System Requirements 1 3 Special Filenames 1 4 Block Sizes 1 A.S Gap and Block Numbers 2 A.6 Terminal and Network Requirements 2 DEPEDEowhe w pS euauauoe i) Chapter 1 Introduction 1.1 InstallingXENIX 1 1.2 Overview 1 13 TheSystemManager 1 14 TheSuper—UserAccount 2 1.5 TheKeyboard 2 1.6 UsingThisGuide 3 Introduction Ll Installing XENIX. To install the XENIX Operating System on your computer forthe first time, you should refer tothe XENIX Installation Guide found in the front of this binder. It provides you with step—by—step instructions on howto install the distribution floppies for all three XENIX packages (Operating System, Development System, and Text Processing System), how toinitialize yourhard disk, andhow tocreate the superuser password. If you purchased the XENIX Development System and Text Processing packages separately from the XENIX Operating System, you should refer to the Installation Notes included with those packages. The notes explain how to use the /etc/install utility to install the distribution floppies. 1.2 Overview ‘The XENIX Operating System is a powerful system of programs which allow you to accomplish a full spectrum of tasks, from developing high~level and assembly language programs to creating, editing, and typesetting documents. In many cases, the XENIX system uses the full resources of your computer, giving it the power of a much larger machine. To keep this powerful machine running smoothly, the XENIX system requires careful control of its operation and aregular schedule of maintenance. This guide explains how to operate and maintain the XENIX operating system on your computer, ensuring maximum performance with the least number of system problems. Asa special feature, this guide also describes how to expand a XENIX system with a Micnet network. A Micnet network allows serial communication between all the XENIX systems in your work environment. The Micnet programs and commands include the netut®l program, which is used to install the network, and the mail, rep, and remote commands, which are used to pass messages, files, and commands over the network. 1.3. The System Manager Every XENIX system should have at least one person in charge of system maintenance and operation. In this guide that person is called the system manager. It is the system manager's duty to ensure the smooth operation of the system and to perform for other userstasks that require special privileges. Since a XENIX system may consist of anywhere from a single computer to dozens of computers connected ina network, the system manager's job can be aonce~a—week task or a full—time job. No matter what the size of the system, the system manager should faithfully perform each required maintenance task, since sloppy maintenance canaffectthe performance of the XENIX system. All tasks in this guide are presented from the system manager’s point of view, but many of them may be accomplished by an ordinary user. Since some of the tasks dramatically change the system's operation. we recommend that the system manager perform these tasks whenever possible. This can prevent unwanted or.unnecessary changestothe system. XENIX Operations Guide 1.4 The Super—User Account ‘The super—user account is a special account for performing system maintenance tasks. It permits the system manager unusual privileges that ordinary users do not have, such as accessing all files in the system and executing privileged commands. Many of the tasks presented in this guide require that the system manager be logged in as the super—user. To do this, the system manager must know the super—uscr password created during the installation of the XENIX system (see the XENIX InstallationGuide). Users who are authorized to act as the super—user, including the system manager, should log inasthe super—user only whennecessary to perform system maintenance task. Evenif the system manager is the only personusing the system, he should create auser account for himself and usc it for day—to—day work, reserving the super—uscr account for system maintenance tasksonly. ‘The number of individuals who are given the super —user password should be kept toa minimum. Misuse of the super—user powers by naive users can resuh in lost data, programs, andeventhe XENIX system itself. 1.5 The Keyboard Many keys andkey combinationshave special meaningsto the XENIX system. These keys and key combinations have special names that are unique to the XENLX system and may or may not correspond to the keytop labels on your keyboard. To help you find the special keys, the following table shows which keys on the Lisa terminal correspond to XENIX system keys. In this table, a hyphen (—) between keys means “thold downthe firstkey while pressing the second.” XENIX Name Lisa Keytop Action BREAK Apple-—C ‘Stops current action and returns to the shell. This key is also called the INTERRUPT key. BACKSPACE Backspace Deletes the first character to the left of thecursor. CNTRL-D Apple-D Signals the end of input from the keyboard; alsoexitscurrent shell. CNTRL-H Apple-H Deletes the first character to the left of thecursor. Alsocalled the ERASE key. CNTRL-Q Apple-Q Starts printing after ithasbeen stopped withCNTRL-S. CNTRL-S Apple-S Stops printing at the standard output device (doesnot stop the program). CNTRL-U Apple-U Deletes all characters on the current line. Alsocalled theKILL key. Introduction Apple—\ Quits current command and creates a core file (Recommended for debugging only). ESCAPE Clear Exits the current mode; for example, exitsinsert mode when intheeditor vi. Note If your keyboard does not have an key (a key with an apple on it), use the COMMAND key instead. 1.6 Using This Guide The tasks presented in this guide range from very simple tasks requiring very little knowledge about XENIX to quite complex tasks requiring extensive knowledge about XENLX and your computer. Tohelp you complete atask, each chapter explains the tools and knowledge you need to complete the tasks described in that chapter. In some cases you may be required to seck instruction in another manual, such as the XENIX User’ s Guide . In most cases, however, following the instructions will be sufficient. Chapter | introducesthis guide. Chapter 2 explains how to start and stop the XENIX system and how to log in as the super—user, the XENLX system's special system manager account. Chapter 3 explains how tocreate accounts forthe users who work on your system, how toassign groups, andhow tomanage user IDs. Chapter 4 explains how to create and mount file systems, how to set permissions, and howtokeepthesystemsecure. Chapter 5 explains how to maintain free space on the root file system and other file systems. Chapter 6 explains how to create backup copies of the root file system and other file systems. Chapter7 explains howtoaddterminalsand otherperipheral devices tothe system. Chapter 8 explains how to solve system problems such as a jammed lineprinter or a forgottenpassword. Chapter9 explains how tocreate a multiple system mailing network with Micnet. Appendix A presents a list of the XENIX system special files and explains how touse these files whencreating and maintaining file systems. XENIX Operations Guide Appendix B lists the most commonly used XENIX system directories and files. Chapter 2 Starting and Stopping the System 24 Introduction 1 2.2 StartingtheSystem 1 2.2.1 Bootingthe OperatingSystem 1 2.2.2 CleaningtheFileSystem 2 2.2.3 Choosing the ModeofSystem Operation 2 2.3 LoggingInastheSuper—User 2 2.4 StoppingtheSystem 3 24.1 UsingtheshutdownCommand 3 24.2 UsingthehaltsysCommand 4 Starting and Stopping the System 2.1 Introduction This chapter explains how to start and stop the XENIX system. It also explains howto log inasthe super—user. 2.2 Starting the System ‘Starting a XENIX system requires more than just turning on the power. The first stepis to install the XENIX Operating System on your computer. Refer to the XENIX Installation Guide for instructions on how to do that. You must also perform a series of steps to initialize the system for operation. Starting the system requires: — _ Bootingthe operating system — Cleaningthe file system (ifthe system was improperly stopped) — — Choosingthe mode of systemoperation The following sections describe each of these procedures. 2.2.1 Booting the Operating System The first step in starting the system is to boot the operating system from the harddisk. Follow these steps: 1. Tum on power to the hard disk. If you have two hard disks, turn on the powertoboth. 2. Wait for the ‘‘ready”” light on the front of the hard disk drive(s) to glow a steady red. 3. Tumonpowertothe computer. 4. The computer displays sclf—test icons (as when XENIX was first installed onthe computer). It then loads the XENIX “bootstrap” program from the hard disk, and the program displays themessage: Xenix boot 5. Pressthe key. The system will display pf (0,0) xenix and the boot strap program loads the XENIX operating system from thehard disk, Whenthe system is booted. it displays information about itself and checks to sceif the “root file system" (i.e. all files and directories onthe hard disk)is clean. Ifitisclean, youmay choose the mode of operation. Ifnot, the system requires you toclean the file system before choosing. ro i XENIX Operations Guide 2.2.2 Cleaning the File System You mustcleanthe file system whenever you see the the message: Proceed with cleaning (y or n)? while booting the system. The system displays this message if it was not stopped properly (i.c., as described in the section ‘‘Stopping the System’). The XENIX operating system requiresaclean file systemto perform itstasks. Toclean the file system, type y (for ‘‘yes"") and press the key. The system cleans the file system, repairing damaged files or deleting files that cannot be repaired, and reports onits progress aseach step is completed. At some point, itmay ask ifyou wish tosalvageafile. Alwaysanswer by typing yand pressing the key. When cleaning is complete, the system usually asks you to choose the mode of operation, but itmay alsodisplay the message: ** Normal System Shutdown ** Ifit displays thismessage, you must reboot the system. Youcandothisby pressingthe RESET button and repeating the steps given inthe previous section. (You willnothave toturnon the power totheharddisk(s)orcomputer.) 2.2.3 Choosing the Mode of System Operation You may choose the mode of XENIX operation as soonas you see the message: Type CONTROL—d to continue with normal startup, (or give the root password for system maintenance): The system hastwo modes: normal operation and system maintenance mode. Normal operation is for ordinary work on the system. This is the mode you should choose to allow multiple users to log in and begin work. System maintenance mode is a specialized mode reserved for work to be done by the system manager. It docs not allow multiple users. To choose normal operation, press the key. The system displays a startup message and begins torunthe special command file/etc/re described in Chapter 7. To choose system maintenance mode, type the super—user's password (sometimes called the “‘root password") and press the key. The system displays the message of the day and the super—user’s prompt (#). The commands in the /etc/rc file are not executed. (Choose system maintenance mode only if you must do system maintenance work that requiresallother userstobe off the system.) 2.3 Logging In as the Super—User Many system maintenance tasks required that you log inas the super ~user before you may perform the task. For example, you must be logged in as the super—userto stop the system as described in the next section. Before you may log inas the super—user, you need the super—user password. You also need to see the ‘“login:"* message on your terminal's scrcen. Ifyou do not see the message, pressthe key. 2-2 Starting and Stopping the System Tologinasthe super—user, followthese steps: 1. Typethesuper—user'sloginname: root and pressthe key. 2. Typethe super—user’s passwordand pressthe key. The system opens the super—user account and displays the message of the day and the. super—user prompt (#). Take reasonable care when you are logged in as the super—user. In particular, you should be very careful when deleting or modifying files or directories. Avoid using wildcard designators in filenames and frequently check your current working directory. Even small errors can cause annoying and unwanted changes to the system and user files. Insome cases, amistake may cause irretrievable damagetoa file. You may leave the super—user account at any time by pressing 2.4 Stopping the System Stopping the XENIX system takes more than just turning off the computer. You must prepare the system to be stopped by running cither the shutdown or the haltsys command. The following sections describe cachcommand. 2.41 Using the shutdown Command The shutdown command is the normal way to stop the system and should be used wheneverthe system isin normal operation mode. It wars other usersthat the system is abouttobe stopped and givesthem an opportunity to finish their work. Tostopthe system withtheshutdown command, followthese steps: 1. Log inas the super—user (see the section ‘Logging in as Super—User”* in this chapter). The system opens the super—user account and displays the message of theday andthe super—user'sprompt. 2. Type: Jetc/shutdown, and press the key. The system loads the shutdown command. The command asks for the number of minutes before you wish to stop the computer. 3. Type a number from 0 to 15 and press the key. The system displays a warning message at each terminal, asking logged in users to finish their workand log out. As soonasallusersare logged out or the specifiedtime has elapsed, the system closesallaccounts, displays the message: ** Normal System Shutdown ** and stops. Youmay nowtumoffthe computer and hard disk. XENIX Operations Guide 2.4.2 Using the haltsys Command ‘The haltsys command may be used to halt the system immediately. In general, it should be used only when no other users are on the system or when the system isin system maintenancemode. Tostopthe system with the haltsyscommand, follow these steps: 1, Loginasthe super—user (not required when in sy stem maintenance mode). ‘The system opens the super—user account and displays the message of the day andthe super~—user prompt. 2. Type: Jetchaltsys and pressthe key. The system displaysthe message: ** Normal System Shutdown ** and stops, Youmay nowtumoffthe computer and harddisk. Chapter 3 Preparing XENIX for Users 3.1 Introduction 3-1 3.2 AddingaUser Account 3-1 3.3 Changing aUser'sPassword 3-4 3.4 ForcingaNewPassword 3-5 3.5 CreatingaGroup 36 3.6 Changing aUser’sLoginGroup 3-7 3.7 ChangingaUserID 3-8 3.8 Removing aUser Account 3-10 Preparing XENIX for Users 3.1 Introduction User accounts help the XENIX system manager keep track of the people using the system, and control their access to the system’s resources. Ideally, each user should have a user account. Each account has a unique “login name” and “password” with which the user enters the system, and a “home directory”’ where the user does his work. It is the system manager's job to create accounts for all users on the system. Itis also the manager’s job to maintain user accounts by changing user passwords, login groups, and user IDs when necessary. This chapter explains how to: — Adduser accounts to the system — Change an account's password — Force new passwords — . Create agroup — — Change an account’s login group — Changean account's user ID — Remove user accounts from the system The following sections describe each in detail. 3.2 Adding a User Account You may add a user account to the system with the mkuser program. The program creates a new entry in the XENIX system’s /ete/p 1d file. This entry contains information about the new user, such as login name and initial password, that the system uses to let the user log in and begin work. The program also creates a home directory for the user, a mailbox for use with the mail command, and a .profile file which contains XENIX commands that are executed when the user logs in. To create a new user account, follow these steps: 1. Loginas the super-user. 2. Type 31 XENIX Operations Guide 3-2 mkuser and press the RETURN key. The system displays the following message: Newuser Add a user to the system Do you require detailed instructions? (y/n/q): Type the letter y (for “‘yes”), if you want information about the program, otherwise type the letter (for ‘'no”). (Type (for “quit””) only if you wish to stop the program and return to the system.) When the program continues, it asks you you to enter the new user’s loginname: Enter new user’s login name: The login name is the name by which XENIX will know the user. It is usually a short version of the user’s actual name, typed in lowercase letters. For example, either “johnd” (a first name and last initial) or “jdoe” (a first initial and last name) is acceptable for the user John Doe. Type the new name, and press the RETURN key. The program asks you for the initial password: Enter password: The initial password is the password you assign to the new user. The user will use the initial password to enter his account for the first time. Once in the account, the user should create a new password for himself, one that is hard to guess. (See the section “Changing Your Password” in the XENIX User's Guide.) Type the password carefully, and press the RETURN key. After you have entered the password, the program asks for the group name: Enter group: ‘The group name is the name of the group of users to which the user will belong when he logsin. Users in a group have access toa common set of files and directories. The group name is optional. If not given, the the XENIX system’s common group “group” (with group ID 50) is used. Preparing XENIX for Users Type the group name, and press the RETURN key. If you do not wish to enter a group name, just press the RETURN key. After you have entered the group, the program asks for a comment: Please enter Comment >- > Acomment is information about the new user, such ashis department and phone extension. Although, the comment is optional, it is useful if the finger command is often used to display information about users. If given, the comment must be no more than 20 characters long, including spaces, It must not contain any colons(:). The example John Doe, 123 shows the recommended form for a comment. ‘Type the comment. Make sure it is 20 charactersor less. If you do not wish to enter a comment, just press the RETURN key. The program now shows what you have typed and the special user entry that it has created for the new user. This entry is copied to the special system file /ete/ passwd. The entry shows the login name, the password (encrypted), the user ID, the group ID, the comment, the user’s home directory, and the startup program. Items in the entry are separated by colons (:). (For a full description of each item, see passwd(M) in the XENIX Reference Manual.) ‘The program then gives you an opportunity to change the user name, password, group, or comment: Do you want to change anything? (y/n/q): Type the letter y (for “‘yes”) and press the RETURN key, if you wish to change something. Type n (for “‘no”) and skip tostep 10 if you wish to complete the new account. (Type q, for “quit”, only if you wish to leave the program and abort the new account.) If you type y in step 8, the program asks for the item you wish to change: username password group comment Type the name of the item you wish to change, then type the new item. The program changes the item and returns to step 8. 33 XENIX Operations Guide 10. i. Once you type nin step 8, the program displays the message: Password file updated followed by a description of the actions it has taken to add the new user account to the system. The program then asks if you wish to add another user to the system. Type yit you wish to add another user. Otherwise, type nto stop the program andreturn to the super-user prompt. A user can log into a new account as soon asit is created. See the XENIX User's Guide for details. 3.3 Changing a User’s Password Normally, an ordinary user can change the password of his own account with the passwd command (see the XENIX User's Guide). Sometimes, however, it may be necessary for the super-user to change the password for him, for example, if the user has forgotten his password and cannot get into the account to change it. The super-user may change the password of any user (including himself) with the passwd command. To change a password, follow these steps: 4, Log in as the super-user. Type passwd login-name (where login-name is the user’s login name) and press the RETURN key. The command displays the message: New password: Type the new password and press the RETURN key. The command does not display the password as you type it, so type carefully. The command asks you to type the password again: Retype new password: Type the password again and press the RETURN key. To see how an ordinary user can change his own password with the pasewd command, see the RETURN User’s Guide. 34 Preparing XENIX for Users 3.4 Forcing a New Password From time to time, a user account may need a higher level of security than ordinary. Since the security of any account depends its password, it is important to keep the password as secret as possible. One way to provide greater security is to force users to change their passwords on aregular basis. You can force users to change their passwords by using the pwadmin command. This command automatically dates each password and requires the user to provide a new password when the specified number of weeks have passed. The command also requires users to wait a minimum number of weeks before allowing them to restore their previous password. To use the pwadmin command, you must log in as the super-user. You also need to choose a minimum number of weeks that a user must wait before changing his password and a maximum number of weeks that a user may go without changing the password. A common pair of minimum and maximum values is 2 and8. To set the minimum and maximum dates, type: pwadim -min num -max num login-name where num is a number in the range 1 to 68, and login-name is simply the login name of the user whose password you are administering. Ifyou are unsure of the current minimum and maximum values for a password, you can display them by typing: pwadmin -d login-name This command does not change the current values. Ifyou wish to force a user to change his password immediately, type: pwadmin -f login-name The user is asked on his next login to supply anew password. When a password no longer requires extra security, you can remove the current minimum and maximum values for the password by typing: pwadmin -n login-name The system will no longer prompt for changes. 35 XENIX Operations Guide 3.5 Creating a Group Agroup is a collection’of users who share a common set of files and directories. The advantage of groups is that users who have a common interest in certain files and directories can share these files and directories without revealing them to others. Initially, all users belong to the common system group named “group”, but you can create new groups by modifying the XENIX system file /ete/groupusing a XENIX text editor. To create a new group, you need to choose a group name and a group identification number (group ID). You also need to make a list of the usersin the new group. The group name may be any sequence of letters and numbers up to eight characters long, and the group ID may be any number in the range 0 to 65535. Both the group name and ID must be unique, i.e., they must be not be the same as any existing group name or ID. To create a new group, follow these steps: 1. Loginas the super-user. 2. Display the contentsof the /ete/groupfile by typing: cat /etc/group and pressing the RETURN key. The cat command displays the contents of the /ete/groupfile. The file contains several entries, each defining the group name, group ID, and users for a group. Eachentry has the form: group-name::group-ID: users The users are shown as a list of login names separated by commas (,). For example, a typical file may look like this: ‘I:demo sys: group::50:johnd,suex 3. Check the /ete/group file entries to see that the group name and ID you have chosen are unique. 4. If the group name and ID are unique, invoke a XENIX text editor (see the XENIX User’s Guide) and specify /ete/groupas the file to edit. 5. Locate the last line in the file, then insert the new entry in the form given above. For example, if you wish to create a group named “shipping” with group ID “142” and users “johnd”, “marym”, and “suex”, type: 3-6 Preparing XENIX for Users shipping::142:johnd,marym,suex 6. Exit the editor. To make sure you have entered the. group names correctly, use the grpcheck command to check each entry in the /ete/group file. If the new entry is free of errors, no other changesto the file are required. You can create any number of new groups. Each group may have any number of members. Furthermore, any user may be a member of any number of groups. Multiple group membership is especially convenient for users who _have interests that span a variety of areas. If'a user is a member of several groups, he can gain access to each group by using the newgrp command. See the XENIX User’s Guide for details. 3.6 Changing a User’s Login Group When a user logs in, the system automatically places the user in his “login group”. This is the group given by the group ID in the user’s /ete/ passwd file entry (see the section “Adding a User Account” in this chapter). You can change the user’s login group by changing the group ID. To change the group ID you need the group ID. of the new login group, and you need to know how tousea XENIX text editor (see the XENIX User’s Guide). To change the group ID, follow these steps: 1... Loginas the super-user. 2. Use the cd command to change the current directory to the /ete directory. Type: ed fete 3. Use thecp command to make a copy of the /ete/pasewdfile. Type: cp passwd passwd+ 4, Invoke atexteditor and specify /etc/passwd+ asthe file to edit. 5. Locate the desired user’s password entry. Each entry begins with the user’s login name. 6. Locate the user's group ID number in the user’s password entry. Itis the fourth item in the entry. Items are separated by colons (:). For example, the entry 37 XENIX Operations Guide marym:9iKlwp:205:50:Mary March, 122:/usr/marym:/bin/sh hasgroup ID “50”. 7. Delete the old group ID and insert the new one. Be sure you do not delete any other portion of the user’s password entry. 8. Exit the editor. 9. Use the mv command tosave the old /ete/pasewd file. Type: my passwd passwd- 10. Use the mv command to make the edited file the new /ete/paseword file. Type: mv passwd+ passwd You can make sure you have entered the new login group correctly by using the pwcheck command. If the new entry is correct, no other changes to the file are required. You must not change the group IDs for system accounts such as “cron” and “root, System accounts are any accounts whose user IDs are less than 200. The user ID is the third item in the passwordentry. Note that changing a user's login group does not change the “group ownership” of his files. Group ownership defines which group has access to a user’s files. If users in the new group wish to access the user’s files, you must change the group ownership with the chgrp (for ‘change group”) command. For details, see the section “Changing Group Ownership” in Chapter 4. 3.7 Changing a User ID Sometimes it is necessary to change the user ID in a user's account entry to allow a user to access files and directories transferred from other computers. In particular, if a user has different accounts on different computers and frequently transfers files and directories from one computer to another, then the user IDs in each of his account entries must be made the same. You can make them the same by modifying the account entriesin the /ete/ passwd file. To change a.user ID, follow these steps at every computer for which the user has an account: 1. Loginas the super-user. 2. Use the ed command to change the current directory to the /ete directory. Type: 38 Preparing XENIX for Users ed /ete 3. Use theep command to make acopy of the /ete/passwdfile. Type: cp passwd passwd+ 4. Invoke a XENIX text editor and specify /etc/pasewd+ as the file to edit. 5. Locate the user’s account entry. Each entry begins with the user’s loginname. 6. Locate and substitute the current user ID. The ID is the third item in the entry. For example, the entry marym:9iK lwp:205:50:Mary March, 122:/usr/marym:/bin/sh hasuser ID “205”. 7. Exit the text editor. 8 Use the mv command tosave the old /ete/pasewdfile. Type: mv passwd passwd- 9. Use the mv command to make the edited file the new /ete/passwdfile. Type: mv passwd+ passwd No other changes to the file are required. In most cases, you can change the user ID to the same number as the user’s most-used account. But the new number must be unique at every system for which the user has an account. If there is any conflict (for example, if the number already belongs to another user on one of the systems), you must choose a new number. You can choose any number greater than 200. Just make sure it is unique, and that you copy it to all systems on which the user has an account. Once a user’s ID has been changed, you must change the “‘user ownership” of the user’s files and directories from the old user ID to the new one. You cando this with the chown (for “change owner”) command described in Chapter 4, “Using File Systems.” For example, to change the ownership of johnd’s home directory, type: chown johnd /usr/johnd Note that you may use the find command described in Chapter 6, “Backing Up File Systems,” to locate all files and directories with the user’sold user ID. 3-9 XENIX Operations Guide 3.8 Removing a User Account It is sometimes necessary to remove a user account from the system. You can remove a user account with the rmuser program. The program deletes the user’s entry from the /etc/pasewd file and removes the user’s home directory and mailbox. Before you can remove the user account, you must remove all files and directories from the user’s home directory, or move them to other directories. Ifyou wish to save the files, you may use the tar command to copy the files toa floppy disk (see the section “Copying Files toa tar Disk” in Chapter 6). Toremove a user account, follow these steps: 3-10 Log inas the super-user. Type: ed /usr/login-name and press the RETURN key to change to the user’s home directory. The login-name must be the user’s login name. Make sure that you have made copies of all important files and directories in the user’s home directory. Use the rm (fer “remove”) command to remove all files and directories from the user’s home directory. This includes any files that begin with a period (.). Directories can be removed by using the -r (for recursive”) option of the rm command. For example, the command rm -r bin removes the directory named bin and all files within this directory. After removing all files and directories, make sure the user’s mailbox isempty. Type: cat /ust/spool/mail/login-name and press the RETURN key, where login-name is the user’s login name. If the mailbox contains text, then type: eat /dev/null >/usr/spool/mail/login-name and pressthe RETURN key. Preparing XENIX for Users 6. When the user’s home directory and mailbox are empty, type: ed /usr and press the RETURN key. The user's home directory cannot be removed until you have moved to another directory. 1. Type: rmuser and press the RETURN key. The program displays a message explaining how to remove a user: ***rmuser-remove a user from the system**** Press ENTER when you are ready. ‘The program asks for the login name of the user you wish to remove: Enter name of id to be removed. 8. Type the user's login name. You should now see the message: Removing user name from the system. CONFIRM? (y/n/q): 9. Type y (for “yes”) to remove the user from the system. Otherwise type n (for ‘‘no”’) to stop the removal, or g (for ‘‘quit”) to stop the program. The program removes the user’s entry from the /etc/pasewd file, the user’s mailbox, . profile file, and home directory. The program displays the message: User name removed from the system The program now gives you a chance to remove another user: Do you want to remove another user? (y/n/q): 10. Type y to remove another user. Otherwise, type n or q to stop the program. Note that the rmuser program will refuse to remove an account that has a system name, suchas “‘root”’, “‘sys”, “‘sysinfo”, “cron”, or “uucp”, or asystem ID (user ID below 200). Also, the program cannot remove a user account if the user’s mailbox still has mail in it, or if the user’s home directory contains files other than. profile. 311 Chapter 4 Using File Systems 4.1 42 4.3 44 4.5 46 Introduction 1 FileSystems 1 4.2.1 CreatingaFileSystem 1 4.2.2 MountingaFileSystem 2 4.2.3 UnmountingaFileSystem 3 4.2.4 FormattingFloppyDisks 3 Permissions 4 4.3.1 DisplayingPermissions 4 4.3.2 ChangingPermissions 5 4.3.3. ChangingtheFileCreationMask 6 ManagingFileOwnership 7 44.1 ChangingUserOwnership 7 4.4.2. ChangingGroupOwnership 7 SystemSecurity 8 4.5.1 PhysicalSecurity 8 4.5.2 AccessSecurity 8 4.5.3 EncryptingTextFiles 9 4.5.4 ProtectingSpecialFiles 9 Using XENLX AccountingFeatures 9 4.6.1 Starting ProcessAccounting 10 4.6.2 Changing AccountingFiles 10 4.6.3 Displaying AccountingInformation 11 Using File Systems 41 Introduction This chapter describes one of themost importamt responsibilities of a system manager: controlling and recording users’ access to the files and directories on the system. it introduces file systems, permissions, system security, and process accounting. 4.2 File Systems Afile system isthe XENLX system's way of organizing storage onmass storage devices such as hard and floppy disks. A file system consists of program and dala files, directories, andthe information needed to locate andaccessthese items. Each XENIX system has at least one file system. This file system is called the ‘‘root™” file system and is represented by the symbol ‘‘/*". The root fiels system contains allthe ‘XENLX program and data files and usually contains all the user directoricsas well. A XENIX system may also have other file systems, for example, a file system that contains only user directories or application programs. Such file systems must be specifically created by auscrand thenmounted ontothe system. You cancreate a file system with the mkfs command. This command sets the size and format of the file system and may also copy some files to the new system. You can mount a file system with the mount command. Once mounted, you may access the files and directories in the file system as easily as files and directories in the root file system. (The root file system is permanently mounted. ) When you are finished with a file system, you canunmount it withthe umountcommand. One reason for creating new file systems isto expand the available storage space of the system. Each mounted file system adds.its free space to the system's total storage space. Youmay create anew file systemon ahardor floppy disk, mount it, and then use its free space for your work, leaving the limited space in the root file system for XENIX system files. Another reason for creating new file systems isto establish a collection of floppy disks. that contain application programs and data files. You may then mount and unmount file systems andusethe programs and files accordingto your needs. The following sectionsexplain howtocreate anduse file systems. 4.21 Creating a Fille System ‘You can create a file system on a Boppy disk with the mkfs command. You need a formatted floppy disk, the special filename of a floppy disk drive, the disk block size, and special numbers called the gap andblock numbers. A floppy disk can be formatted by following the instructions inthe section “Formatting Floppy Disks” inthis chapter. The special filenames for the disk drives, the disk block size, and the gap and block numbers depend onthe specific system and are givenin Appendix A. Note that if a file system already exists on the disk, it will be destroyed by this procedure. Forthisreason, be particularly careful not to create anew file system onthe root filesystem. If youdestroy theroct file system, you will have toreinstall the XENIX system. XENIX Operations Guide Tomakea filesystemona floppy disk, follow these steps: 1. Login. You do not have to be logged in as the super—user touse the mkfs command. 2. Inserta formatted floppy disk into a floppy disk drive. Make sure there is no read—onlytabonthedisk jacket. 3. Type Jetchmkfs specialfile blocksize gap block (where specialfile blocksize ,gap , and block are supplied by you) and press the key. The system automatically creates the file system. If it discovers data already onthe disk, the system displays the message: mkfs: specialfile contains data. Overwrite? (y/n): Ifyou are sure the disk contains nothing that you want to save, type y and press the key to overwrite the data and continue creating the file system. Otherwise, typen. If youtypeend, no file systemiscreated. For example, the following command creates a file system on the floppy disk drive /devifd with blocksize 800 and gapand block numbers and 16. Jetchmkfs /dev/fd 800 2 16 4.2.2 Mounting a File System ‘Once you have created file system, you can mount it with the mount command. To mount a file system you need the the special filename of a floppy disk drive and the name of the directory onto which the file system is to be mounted. The special filename ‘ofthe disk drive containing the disk with the file system dependson the specific system and is given in Appendix A. The directory to receive the file system may be any directory as long as it is empty (contains no files) and is not your current working directory. Note that the directory /mnr is specifically reserved for mounted file systems. Tomounrta file system, followthese steps: 1. Loginasthe super—user. 2. Insertthedisk containing the file system imtoa floppy disk drive. 3. Type the appropriate mount command and press the key. The command shouldhavethe form Jetchmount specialfile directoryname where specialfileis the special filename of the disk drive and directoryname is the name of the directory to receive the file system. If the disk has a read-only tab, make sure you include the switch ‘‘—r"’ at the end of the command. For example, the following command mounts a file system on a disk in the disk drive Idevifd ontothe directory named /account. 4-2 Using Fie Systems Jetc/mount /dev/fd /account: Remember to make sure that the specified directory is empty before issuing the command. Ifthecommanddisplaysthe message: mount: Structure needs cleaning use the fsck commandtoclean the file system and try to mount it again (see the section “File System Integrity’* in Chapter 5). Ifthe command displays the message: mount: Device busy either the file system has already been mounted and cannot be mounted twice, ora user is currently inthe directory in which you wishtomount the file system. Tocheck that the file system was properly mounted, use the cd command to change to the directory containing the mounted system and the 1] command to list the contents. ‘The command displays the files and directories (ifany) inthe filesystem. Besuretouse theed commando leavethe directory after finishing your workin it. Note that frequently used file systems can be mounted automatically when startingthe system by appending the appropriate mount commands to the /etc/rc file. See the section ‘Changing the/etc/rc File"’ inChapter 8 for details. 4.2.3 Unmounting a File System You can unmount a mounted file system with the umount command. Unmounting a file system does not destroy its contents. It merely removes access to the files and directories inthe file system. Tounmount amounted filesystem, type: Jetchumount specialfile and press the key. The specialfile is the name of the special file corresponding tothe disk drive containing the disk with the file system. The command empties the directory that previously contained the file system and makes the directory and the corresponding disk drive available for mounting another file sy stem. For example, the following command unmounts a file system from the disk drive Idevifa: /etchumount /dev/fd Before unmounting a file system, make sure that no files or directories are being accessed by programs being run by you or by other users. The umount command displaysthe message: umount: Device busy if youoranother useris currently inthe directory containing the file system. 4.2.4 Formatting Floppy Disks You can format floppy disks with the format(C) program. Formatted disks are required whenever you createa file systemand when you back upa file system with the sysadmin program (see Chapter6, ‘File System Backups"’). XENIX Operations Guide In general, the system manager should format spare floppy disks in advance. To format a floppy disk, follow these steps: 1, Type format -v and pressthe key. The —v flag specifies verbose (or interactive)mode. 2. formatwillrespond insert disk 3. Afterthe programhas finished formatting the disk, it will prompt: type <RETURN> to format another disk, ‘gq’ to quit Ifyou wish, you may use the ~f flag to format your disks. The program formats the givenfile. The defaultdeviceis/dew/rfd. The command format —f /devinrfd formatsthe disk using the no— eject device. Note that formatting removes alll data from the disk, so if you are formatting adisk that already contains data, makesure thatthe datais nothing you wishto save. 4.3. Permissions Permissions are the way the XENIX system controls access to all the files and directories. In XENIX, an ordinary user may access those files and directories for which he has permission. All other filesand directoriesare inaccessible tohim. There are three different levels of permissions: user, group, and other. User permissions apply to the owner of the file; group permissions apply to users who have the same group ID asthe owner, and other permissions apply toall other users. 43.1 Displaying Permissions You can display the permission settings for all the files in a directory with the 1 |. This command lists the permissions along with the name of the file’s owner, the size (in bytes), and the date and time the file was last changed. The command display has the following format: —rw-rw-——— J johnd group 11515 Nov 17 14:21 filel ‘The permissions are shown as a sequence of ten characters on the left of the display. ‘The sequence is divided into four fields. The first field (the “‘type’” field) has a single character, the other fields (“‘user"’, ‘“‘group’’, and “‘other’’, have three characters each. Using File Systems = we ow- == type user group other ‘Thecharactersinthe ficldshave the following meanings: Inthe “type” field: 4 Indicatestheitemisadirectory = Indicatestheitemisanordinary file b _Indicatesthe itemisa device special block VO file ¢ _ Indicatestheitemisadevice special character /O file Inthe“‘user”’, “group”, and “other” fields: Indicates read permission. Read permission for a file means you may copy or display the file. Read permission for adirectory means you may display thefiles inthat directory. w Indicates write permission. Write permission for a file means you may change ormodify the file. Write permission for a directory means you may create files orsubdirectories withinthat directory. x Indicates execute permission (for ordinary files) or search permission (for directories). Execute permission for a file means you may invoke the fileasyou woulda program. Execute permission for a directory means you may enterthat directory with the ed command. — Indicatesnopermission. For example, the permissions —Twxrwxrwx indicate an ordinary file with full read, write, and execute access for everyone (user, group, and other). The permissions indicate an ordinary file with read and write access for the useronly. The permissions drwxr—x-—X indicate a directory with search access for everyone, read access for the user and group, and write access for only theuser. 43.2 Changing Permissions When you create a file, the XENIX system automatically assigns the following permissions: XENIX Operations Guide TIwrrn or ‘Thismeans the everyone may read the file, but only the user may write toit. When you create adirectory, the systemassigns the permissions: drwxr—xr-x ‘This means everyone may search and read the directory and the user may create files and directories withinit. You can change the permissions of a file or a directory with the chmod (for ‘change mode") command. This command requires that you tell it how to change the permissions of a specific file or directory. You do so by indicating which levels of permissions you wish tochange (user “u", group “gor other ‘‘o""), how you wish dd‘ +" oF remove “*—""), and which permissions you wish to write “‘w"',orexccute ‘*x"*). Forexample, the pattern: adds execute permission for the user andthe pattern go-w removes write permission for group and other. ‘Thecommand hasthe form: chmod pattern name where name is one or more file or directory names. For example, to change the permissions of the file “‘receivables” from “*—rw—1——r— tmrw- = type: chmod go-r receivables and pressthe key. After using chmod use the ] command to check the results. If you have made a mistake, usechmod againtocorrect the mistake. 43.3. Changing the File Creation Mask The file creation mask is a special number, kept by the system, that defines the permissions givento every file and directory created by auser. Initially, the mask has the valuc022 which means every file receivesthe permissions sawn and every directory receivesthe permissions drwxs—xr-x You canchange the mask and the i byusingtheumaskcommand. ‘The umask commandhasthe form: umask value ial permissions your files and directoriesreceive, where value is athree—digit number. Thethrec digits represent user, group, and cther permissions, respectively. The value of adigit defines which permission Using File Systems digit permission 0 Read, write, execute, and search 1 Read and write 2 Read, execute, and search 3 Read 4 Write, execute, and search 5 Write 6 Execute and search 7 No permissions Forexample, the command umask 177 sets the file creation mask so that all files and directories initially have read and write permission for the user and no permissions forall others. 4.4 Managing File Ownership ‘Whenever a file is created by a user, the system automatically assigns “‘user ownership” of that file to that user. This allowsthe creator to access the file according, to the ‘‘user’’ permissions. The system also assigns a ‘group ownership" tothe file. The group ownership defines which group may access the file according to the “group” permissions. The group is alwaysthe same grouptowhichthe userbelonged whenhe created the file. Only one user and one group may have ownership of a file at any time. (These arethe owners displayed by the ] command.) However, you may change the ownership of a file at any time withthe chown and chgrp commands. 441 Changing User Ownership Youcanchange the user ownership of a file with the chowncommand. The command hasthe form: chown login name files where login name is the name of the new user and files is the names of the files to be changed. Forexample, thecommand chown johnd projects. june changes the current owner of the file projects. junetojohnd. The chown command is especially useful after changing the user ID ofa user (seethe section “Changing a User'sID"inChapter3). Youmustbe logged inasthe super—usertouse thiscommand. 44.2 Changing Group Ownership You can change the group ownership of a file with the chgrp command. The commandhasthe form: XENIX Operations Guide cherp group name files where group name is the name of a group given inthe /etc/group file and files are the names ofthe files you wish to change. Forexample, the command chgrp shipping projects.june changes the group ownership of the file projects. June tothe groupnamed shipping. The chgrp command is especially useful if you have changed the login group of auser (see the section ‘*Changing a User's LoginGroup”’ in Chapter 3). 4.5 System Security Every system, no matter what its size, should have some form of protection against unauthorized access to the computer, disks, and system files. The folhuwing sections suggest ways for a system managerto protect the system. 45.1 Physical Security ‘Youcan protect the physical components of the computer, especially system disks, by takingthese steps: 1. Keepunessential personnel out of the work area. 2. Organizeand lock upall disks andtapes whennot inuse. They should not be stored with the computeritself. 3. Keep disks away from magnetism, direct sunlight, and severe changes in temperature. 4. Donotuse ball point pensto write labels ondisks. 5. Make backup copies of all floppy disks (sce the section ‘Copying Floppy Disks” inthischapter). 4.5.2 Access Security You can protect the system against access by unauthorized individuals by taking these steps: 1. Reminduserstolog out of their accounts before leaving the terminal. 2. Discourage users from choosing passwords that are easy to guess. Passwords should be at least six characters long and include letters, digits, and punctuation marks. 3. Keepthe super—user password secret fromall but necessary personnel. Using File Systems 45.3. Encrypting Text Files You can usually ensure both the privacy and safety of files by setting the appropriate permissions and maintaining system security. However, these methods cannot protect files from unauthorized individuals who have logged in as the super—user. You can protect files from an unauthorized super—user by using the crypt command to encrypt the file. Encryption changes the contents of the file into meaningless characters. The encryption is carried out by means of a key which you supply. The process can bereversed, and the file returned to normal, by giving the same key. For example, to encrypt the contents of the file projects. june and store the encrypted file inthe file projects. secret, type: crypt <projects. june >projects. secret and pressthe key. The command asks forthekey with the message: Enter key: Type a string of characters (it may be up to eight characters long) and press the key. The program encryptsthe file. Torestore the encrypted file projects. secret and display it onthe screcn, type: crypt <projects.secret and press the key. The command asks for the key. Type the same key you used to encryptthe data and pressthe key. The program displaysthe restoreddata. 4.5.4 Protecting Special Files Youcanprevent ordinary users from gaining direct access to the data and program files ‘on the system’s hard and floppy disks by protecting the system’s special files. The XENIX special files, inthe /dev directory, are used primarily by the system to transfer data to and from the computer's hard and floppy disks as welll as other devices, butcan alsobe used by ordinary usersto gain direct accesstothese devices. Since direct access bypasses the system's normal protection scheme and allows ordinary users to examine and change all files in the system, it is wise to protect the special filestoensure system security. To protect the XENIX special files, log in as the super—user and use the chmod command to set appropriate permissions. For example, to disallow any access by ordinary users, set the permissions of such special files as /devimem, /devikmem, ddeviroot , and /dev/usr to read and write access for the super—user only. Notethatyou must not change the permissions for the tty files. 4.6 Using XENIX Accounting Features The XENIX system provides a set of commands that allow the system manager to perform ‘‘process accounting”. Process accounting is a simple way to keep track of the amount of time each user spends on the system. The process accounting commands keep a record of the number of processes (i.c., programs) invoked by a user, how long each process lasts, and other information suchas how oftenthe process accessesl/O devices, and how big the processisinbytes. XENIX Operations Guide Process accounting is helpful on systems where users are being charged for their accesstime, but it may also be used to develop a detailed record of system, command, and systemresource usage. There are several commands which may be used to do process accounting. Ofthese, the most useful are accton and acctcom. The accton command starts and stops Process accounting. When invoked, the command records pertinent information about each process invoked by logged in usersto the file named /usr/adm/pacct. The ‘acctcom command is used to display the information. The command has several switches for displaying different types of accounting information. 4.6.1 Starting Process Accounting You can start process accounting with the accton command. Process accounting can be startedat anytime. Typically, it is started when the systemitselfis started. Before accounting canbe started, the file /usr/adm/pacct must be created, if it docs not already exist. Tocreate the file, follow these steps: 1. Loginasthe super—user. 2. Usetheedcommandtochangethe working directory to/usr/adm . Type: ed Ausr/adm 3. Usethecpcommandtocreate the /usr/adm/ pacct file. Type: cp /devinull pacct 4. Usethechmod command tochange the file permissions. Type: chmod 644 pacct Use the chowncommandtochange the file’sownership. Type: chown adm pacct 5. Usethechgrpcommandtochange the file’s group ownership. Type: chgrp adm pacct Once the /usr/adm/pacct file is created, you may start process accounting by typing: accton /usr/adm/pacct ‘The system immediately begins to copy process accounting informationtothe file. 4.6.2 Changing Accounting Files Process accounting is usually conducted over a set time period, such asa day. At the end of each period the accounting information is saved and the accounting started again with anew file. This prevents disruption of the process accounting and provides aclean file with which tostart each new accounting period. ‘Tochangethe processaccounting file, follow these steps: Chapter 5 Maintaining File Systems 5.1 Introduction 5-1 5.2 Maintaining FreeSpace 5-1 5.2.1 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 Strategies for Maintaining FreeSpace 5-1 DisplayingFreeSpace 5-2 Sending a System-Wide Message 5-2 Displaying Disk Usage 5-3 Displaying Blocks by Owner 5-3 Mailing a Message toaUser 5-3 Locating Files 5-4 Locating coreand Temporary Files 5-5 ClearingLogFiles 5-5 5.2.10 Expanding the FileSystem 5-6 5.3 FileSystem Integrity 5-6 5.3.1 Repairing theFileSystem 5-6 5.3.2 Automatic File System Check 5-7 Maintaining File Systems 5.1 Introduction File system maintenance, an important task of the system manager, keeps the XENIX system running smoothly, keeps the file systems clean, and ensures adequate space for all users. To maintain the file systems, the system manager must monitor the free space in each file systen, and take corrective action whenever it gets too low. This chapter explains the file system maintenance commands. These commands report how much space is used, locate seldom-used files, and remove or repair damaged files. 5.2 Maintaining Free Space The XENIX system operates best when at least 15% of the space in each file system is free. In any system, the amount of free space depends on the size of the disk containing the file system and the number of files on the disk. Since all disks have a fixed amount of space, it is important to carefully control the number of files stored on the disk. If a file system has less than 15% free space, system operation usually becomes sluggish. If no free space is available, the system stops any attempts to write to the file system. This means that the user’s normal work on the computer (creating new files and expanding existing ones) stops. The only remedy for a file system which has less than 15% free space is to delete one or more files from the file system. The following sections describe strategies for keeping the free space available. 5.2.1 Strategies for Maintaining Free Space The system manager should regularly check the amount of free space of all mounted file systems and remind users to keep their directories free of unused files. You can remind users by including a reminder in the message of the day file /etc/motd. (See the section “Changing the /ete/motd File” in Chapter 8). If the amount of free space slips below 15%, the system manager should: 1. Send asystem-wide message asking users to remove unused files. 2. Locate exceptionally large directories and files, and send mail to the owner asking him to remove unnecessary files. 3. Locate and remove temporary files and files named core. 51 XENIX Operations Guide 4, Clear the contents of system log files. Finally, if the system is chronically short of free space, it may be necessary to create and mount an additional file system. 5.2.2 Displaying Free Space You can find out how much free space exists in a particular file system with the df (for ‘‘disk free”) command. This command displays the number of “blocks” available on the specific file system. A block is512 characters (or bytes) of data. The df command has the form: df spectalfile where epecialfile can be the name of a XENIX special file corresponding to the disk drive containing the file system (see Appendix A, “XENIX Special Device Files”). Ifyou do not give a special filename, then the free space of all normally mounted file systemsisgiven. For example, to display the free space of the root file system /dev/root, type: af /dev/root and press the RETURN key. The command displays the special filename and the number of free blocks. You may compute the percentage of free space by comparing the displayed value with the total number of blocks in the file system. See Appendix A, “XENIX Special Device Files,” for a list of the total blocks. 5.2.3 Sending a System-Wide Message If free space is low, you may send a message to all users on the system with the wall (for “write to all”) command. This command copies the messages you type atyour terminal to the terminals of all users currently logged in. Tosend a message, type: wall and press the RETURN key. Type the message, pressing the RETURN key to start a new line if necessary. After you have typed the message, press the CNTRL-D key. The command displays the message on all terminals in the system. To leave the wall command, press the CNTRL-D key. This removes the link to other terminals. 52 Maintaining File Systems 5.2.4 Displaying Disk Usage You can display the number of blocks used within a directory by using the du command. This command is useful for finding excessively large directories and files. The du command hasthe form: du directory The optional directory must be the name of a directory in a mounted file system. If you do not give a directory name, the command displays the number of blocks in the current directory. For example, to display the number of blocks used in the directory /usr/johnd, type: du /ust/johnd and press the RETURN key. The command displays the name of each file and directory in the /usr/johnddirectory and the number of blocks used. 5.2.5 Displaying Blocks by Owner You can display a list of users and the number of blocks they own by using the quot (for “quota”) command. The command has the form: quot epecialfile The epecialfile must be the name of the special file corresponding to the disk drive containing the file system (see Appendix A, “XENIX Special Devices Files”). For example, to display the owners of files in the file system mounted on the disk drive /deo/fdl, type: quot /dev/fd1 and press the RETURN key. The command displays the users who have files in the file system and the number of blocks in these files. 5.2.6 Mailing a Message to a User If a particular user has excessively large directories or files, you may senda personal message to the user with the mail command. 53 XENIX Operations Guide To begin sending a message through the mail, type mail login-name © and press the RETURN key. The login-name must be the login name of the recipient. To send a message, type the message, press the RETURN key, and then press the CNTRL-D key. If the message has more than one line, press the RETURN key at the end of each line. The mail command copies the message to the user’s mailbox, where he may view it also by using the mail command. See the XENIX User’s Guide for details. 5.2.7 Locating Files You may locate all files with a specified name, size, date, owner, and/or last access date by using the find command. The command is useful for locating seldom-used and excessively large files. The find command has the form: find directory parameters The directory must be the name of the first directory to be searched. (It will also search all directories within that directory.) The parameters are special names and values that tell the command what to search for (see find(C) in the XENIX Reference Manual for complete details). The most useful parameters are: -name file -atime number -print The “name” parameter causes the command to look for the specified file. The “-atime” parameter causes the command to search for files which have not been accessed for the number of days. The ‘-print” parameter causes the command to display the locations of any filesit finds. For example, to locate all files named core in the directory /uer, type: find /usr -name core -print and press the RETURN key. The command displays the locations of all files it finds. 54 Maintaining File Systems 5.2.8 Locating core and Temporary Files You can locate core, and temporary files with the find command. A core file contains a copy of a terminated program. The XENIX system sometimes creates such a file when a program causes an error from which it cannot recover. A temporary file contains data created as an intermediate step during execution of a program. These files may be left behind if a program contained an error or was prematurely stopped by the user. The name of a temporary file depends on the program that created it. In most cases, the user has no use for either core or temporary files and they can be safely removed. When searching for core or temporary files, it is a good idea to search for files which have not been accessed for a reasonable period of time. For example, to find all core files in th

Showing the first 100000 of 791604 characters.

mp.ls