Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
For More : https://www.ThesisScientist.com
UNIT 1
INTRODUCTION TO SYSTEM AND NETWORK
ADMINISTRATION
Introduction
1.1 What ...
For More : https://www.ThesisScientist.com
 What is administration? : In human–computer system administration, the
defini...
For More : https://www.ThesisScientist.com
1.3The human role in systems
 For humans, the task of system administration is...
For More : https://www.ThesisScientist.com
Network provisioning:- is the primary responsibility of engineering groups and ...
For More : https://www.ThesisScientist.com
1. So to meets above goal a management should establish policy either
formally ...
For More : https://www.ThesisScientist.com
 Dedicated computing devices that direct traffic around the Internet. Routers ...
For More : https://www.ThesisScientist.com
Figure: The basic elements of the von Neumann architecture.
3.2 Handling hardwa...
For More : https://www.ThesisScientist.com
4) Memory: Memory chips are sold on small pluggable boards. They are sold in di...
For More : https://www.ThesisScientist.com
information. The OS makes memory available to an application when required. Sim...
For More : https://www.ThesisScientist.com
4.3 what does an OS Do?
• Power On Self Test (POST)
• Resource management Suppo...
For More : https://www.ThesisScientist.com
4.5 Microsoft Windows
The Microsoft Windows family of operating systems origina...
For More : https://www.ThesisScientist.com
5.1The UNIX process model
A Process is simply an instance of a running a progra...
For More : https://www.ThesisScientist.com
4) Blocked Suspended: - the process is in secondary memory and waiting for an
e...
For More : https://www.ThesisScientist.com
The fork() call returns in both the parent and the child, and both resume their...
For More : https://www.ThesisScientist.com
message that the child has terminated (and its exit status), the process entry ...
For More : https://www.ThesisScientist.com
Operating system kernels share resources and offer services. They can be asked ...
For More : https://www.ThesisScientist.com
root 340 0.1 0.4 1792 968 ? S Jun 15 3:13 /bin/fingerd
This one was taken on a ...
For More : https://www.ThesisScientist.com
processes attempt to take control of a resource simultaneously, the kernel and ...
For More : https://www.ThesisScientist.com
since it means that static code does not have to take up valuable memory space....
For More : https://www.ThesisScientist.com
Various point considers foe host installation are:-
 Follow the OS designer‟s ...
For More : https://www.ThesisScientist.com
never possible to predict when the system will be performing a crucial operatio...
For More : https://www.ThesisScientist.com
9.3.2 Shutting down Unix
 Anyone can start a Unix-like system, but we have to ...
For More : https://www.ThesisScientist.com
 Once the disk partition containing Windows has been located, the program
NTLD...
For More : https://www.ThesisScientist.com
system will sooner or later get into deep trouble, as it assumes that the
overl...
For More : https://www.ThesisScientist.com
 The format program is used to generate a filesystem on a drive. The command
f...
For More : https://www.ThesisScientist.com
 The swap partition is now used for paging. It is virtual memory scratch space...
For More : https://www.ThesisScientist.com
To make a disk partition appear as part of the file tree it has to be mounted. ...
For More : https://www.ThesisScientist.com
2. Name of host.
3. Net interfaces and IP addresses.
4. Subscribe to NIS or NIS...
For More : https://www.ThesisScientist.com
address will be set. After various other questions, the host reboots and we can...
For More : https://www.ThesisScientist.com
such as NT or Novell Netware, where a login or domain server is used, this is a...
For More : https://www.ThesisScientist.com
.mailrc .ircrc files. these files are used in customizing a user's working envi...
For More : https://www.ThesisScientist.com
1)Password file - /etc/passwd
/etc/passwd contains 7 fields, each separated by ...
For More : https://www.ThesisScientist.com
force your users to change passwords regularly. Minimum lengths prevent them fr...
For More : https://www.ThesisScientist.com
Suggestion (Problem users). Keep a separate partition for problem users‟ home
d...
For More : https://www.ThesisScientist.com
the user’s account must be closed by altering their login shell, for instance, ...
For More : https://www.ThesisScientist.com
number of printed pages sent to the printer or the number of bytes written to t...
For More : https://www.ThesisScientist.com
host# cd /tmp
host# ls
then, because the path search looks in the current direc...
For More : https://www.ThesisScientist.com
16 Maintaining Log Files
Log files are generated by system processes to record ...
For More : https://www.ThesisScientist.com
written to from a shell or script by means of the logger command. Messages are ...
For More : https://www.ThesisScientist.com
17.1 Modes of operation :
fsck operates in two modes interactive and non intera...
For More : https://www.ThesisScientist.com
** phase 2 - Check Pathnames
** phase 3 - Check Connectivity
** phase 4 - Check...
For More : https://www.ThesisScientist.com
specialized robot to change and manage the tapes. For small sites it is also po...
For More : https://www.ThesisScientist.com
NTBackup Of course, commercial backup solutions exist for all operating systems...
For More : https://www.ThesisScientist.com
Notice how this sequence works. We start with a full dump on Monday evening,
co...
For More : https://www.ThesisScientist.com
The ability to recover from loss presupposes that we have enough pieces of the ...
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION
Upcoming SlideShare
Loading in …5
×

INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION

4,419 views

Published on

Network and system administration is a branch of engineering that concerns the operational management of human–computer systems. It is unusual as an engineering discipline in that it addresses both the technology of computer systems and the users of the technology on an equal basis.
 It is about putting together a network of computers (workstations, PCs and supercomputers), getting them running and then keeping them running in spite of the activities of users who tend to cause the systems to fail.
 A system administrator works for users, so that they can use the system to produce work. Once a computer is attached to the Internet, we have to consider the consequences of being directly connected to all the other computers in the world.
 The terms network administration and system administration exist separately and are used both variously and inconsistently by industry and by academics.
 System administration is the term used traditionally by mainframe and UNIX engineers to describe the management of computers whether they are coupled by a network or not.
 Network administration means the management of network infrastructure devices (routers and switches). Network administration is the management of PCs in a network.

Published in: Engineering
  • Be the first to comment

INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION

  1. 1. For More : https://www.ThesisScientist.com UNIT 1 INTRODUCTION TO SYSTEM AND NETWORK ADMINISTRATION Introduction 1.1 What is System and Network Administration  Network and system administration is a branch of engineering that concerns the operational management of human–computer systems. It is unusual as an engineering discipline in that it addresses both the technology of computer systems and the users of the technology on an equal basis.  It is about putting together a network of computers (workstations, PCs and supercomputers), getting them running and then keeping them running in spite of the activities of users who tend to cause the systems to fail.  A system administrator works for users, so that they can use the system to produce work. Once a computer is attached to the Internet, we have to consider the consequences of being directly connected to all the other computers in the world.  The terms network administration and system administration exist separately and are used both variously and inconsistently by industry and by academics.  System administration is the term used traditionally by mainframe and UNIX engineers to describe the management of computers whether they are coupled by a network or not.  Network administration means the management of network infrastructure devices (routers and switches). Network administration is the management of PCs in a network.  What is a system? : A system is most often an organized effort to fulfill a goal, or at least carry out some predictable behavior A system could be a mechanical device, a computer, an office of workers, a network of humans and machines, a series of forms and procedures (a bureaucracy) etc. Systems involve themes, such as collaboration and communication between different actors, the use of structure to represent information or to promote efficiency, and the laws of cause and effect A computer system is usually understood to mean a system composed primarily of computers, using computers or supporting computers. A human–computer system includes the role of humans, such as in a business enterprise where computers are widely used. The principles and theories concerning systems come from a wide range of fields of study. They are synthesized here in a form and language that is suitable for scholars of science and engineering.
  2. 2. For More : https://www.ThesisScientist.com  What is administration? : In human–computer system administration, the definition is broadened to include all of the organizational aspects and also engineering issues, such as system fault diagnosis. In this regard, it is like the medical profession, which combines checking, management and repair of bodily functions. The main issues are the following: • System design and rationalization • Resource management • Fault .handing In order to achieve these goals, it requires • Procedure • Team work • Ethical practices • Appreciation of security.  Administration comprises two aspects: technical solutions and arbitrary policies. A technical solution is required to achieve goals and sub-goals, so that a problem can be broken down into manageable pieces. Policy is required to make the system, as far as possible, predictable: it pre-decides the answers to questions on issues that cannot be derived from within the system itself. Policy is therefore an arbitrary choice, perhaps guided by a goal or a principle. 1.2 Applying technology in an environment  A key task of network and system administration is to build hardware configurations; another is to configure software systems. Both of these tasks are performed for users. Each of these tasks presents its own challenges, but neither can be viewed in isolation.  Hardware has to conform to the constraints of the physical world; it requires power, a temperate (usually indoor) climate, and a conformance to basic standards in order to work systematically. The type of hardware limits the kind of software that can run on it.  Software requires hardware, a basic operating system infrastructure and a conformance to certain standards, but is not necessarily limited by physical concerns as long as it has hardware to run on.  Today the complexity of multiple software systems sharing a common Internet space reaches almost the level of the biological. Today that strategy is less dominant, and even untenable, thanks to networking. Today, there is not only a physical environment but a technological one, with a diversity that is constantly changing. Part of the challenge is to knit apparently disparate pieces of this community into a harmonious whole.  The global view, presented to us by information technology means that we have to think penetratingly about the systems that are deployed. The extensive filaments of our inter-networked systems are exposed to attack, both accidental and malicious in a competitive jungle. Ignore the environment and one exposes oneself to unnecessary risk.
  3. 3. For More : https://www.ThesisScientist.com 1.3The human role in systems  For humans, the task of system administration is a balancing act. It requires patience, understanding, knowledge and experience. Administrators need to be the doctor, the psychologist, and – when instruments fail – the mechanic.  We need to work with the limited resources we have, be inventive in a crisis, and know a lot of general facts and figures about the way computers work.  We need to recognize that the answers are not always written down for us to copy, that machines do not always behave the way we think they should.  We need to remain calm and attentive, and learn a dozen new things a year.  Computing systems require the very best of organizational skills and the most professional of attitudes.  To start down the road of system administration, we need to know many facts and build confidence though experience – but we also need to know our limitations in order to avoid the careless mistakes which are all too easily provoked. 1.4The challenges of system administration System administration is not just about installing operating systems. It is about planning and designing an efficient community of computers so that real users will be able to get their jobs done. That means:  Designing a network which is logical and efficient.  Deploying large numbers of machines which can be easily upgraded later.  Deciding what services are needed.  Planning and implementing adequate security.  Providing a comfortable environment for users.  Developing ways of fixing errors and problems which occur.  Keeping track of and understanding how to use the enormous amount of knowledge which increases every year. 2) The Goal of System and Network Administration 2.1Goal of network administration:-  The goal of network administration is to ensures that the users of networks receive the information and technically serves with quality of services they except.  Network administration means the management of network infrastructures devices (such as router and switches)  Network administration compromises of 3 majors groups: 1. Network provisioning 2. Network operations 3. Network maintenance
  4. 4. For More : https://www.ThesisScientist.com Network provisioning:- is the primary responsibility of engineering groups and its consists of planning and design of network which is done by engineer. Network operations: - it consists of fault, configurations, traffic, all type of management and it is done by plant facilities group. Its is nerve center of network management operations. Network maintenance:- its consists of all type of installations and maintenance work. Responsibilities of Network Administration:-  It is to provide a reliable consistent and scalable network infrastructure that meets or exceeds levels and optimize enterprises assets.  To build hardware configuration  To configure software configuration  Designing of network which is logical and official  Displaying large nos of machines which can be easily upgraded later  Deciding which/ what services are needed.  Planning and implementing environments for users.  Developing a ways of fixing errors and problems when occurs.  To make user life very easy and to empower them in production of real work.
  5. 5. For More : https://www.ThesisScientist.com 1. So to meets above goal a management should establish policy either formally or informally contract service levels agreements with users. 2. From a business administration point of view, network administration involves strategic and tactical planning of engineering, operations and maintenance of network and network service for current and future needs at minimum overall costs 3. Well established communications and interactions among various groups are necessary to perform these functions 2.2 Goal of System administration:- The primary tasks of system administration is to ensures that the following things happens a) The top management is assured of efficiency in utilizations of the system resources b) The general user‟s community gets the services which they are seeking. Various tasks performed by system administrators are  Systems starts up and shutdowns  Opening and closing of users accounts  Helping users to set up there working environments  Maintaining users services  Allocating disks spaces and relocating quotas when the needs grows 3 System Components and there Managements 3.1 What is ‘the system’? In system administration, the word system is used to refer both to the operating system of a computer and often, collectively the set of all computers that cooperate in a network. If we look at computer systems analytically, we would speak more precisely about human– computer systems: Definition 1 (human–computer system). An organized collaboration between humans and computers to solve a problem or provide a service. Although computers are deterministic, humans are non-deterministic, so human–computer systems are non- deterministic. 3.1.1 Network infrastructure There are three main components in a human–computer system (see figure below) Humans: who use and run the fixed infrastructure, and cause most problems. Host computers: computer devices that run software. These might be in a fixed location, or mobile devices. Network hardware: This covers a variety of specialized devices including the following key components:
  6. 6. For More : https://www.ThesisScientist.com  Dedicated computing devices that direct traffic around the Internet. Routers talk at the IP address level, or „layer 3‟, by simple speaking.  Switches: fixed hardware devices that direct traffic around local area networks. Switches talk at the level of Ethernet or „layer 2‟ protocols.  Cables: There are many types of cable that interconnect devices: .fiber optic cables, twisted pair cables, null-modem cables etc. Fig: some of the key dependencies in system administration. The sum of these elements forms a networked community, bound by human ties and cable ties. Services depend on a physical network, on hosts and users, both as consumers of the resources and as teams of administrators that maintain them. 3.1.2 Computers  All contemporary computers in common use are based on the Eckert–Mauchly– von Neumann architecture as shown in figure below  Each computer has a clock which drives a central processor unit (CPU), a random access memory (RAM) and an array of other devices, such as disk drives. In order to make these parts work together, the CPU is designed to run programs which can read and write to hardware devices.  The most important program is the operating system kernel. On top of this are software layers that provide working abstractions for programmers and users. These consist of files, processes and services. Part of „the system‟ refers to the network devices that carry messages from computer to computer, including the cables themselves. Finally, the system refers to all of these parts and levels working together.
  7. 7. For More : https://www.ThesisScientist.com Figure: The basic elements of the von Neumann architecture. 3.2 Handling hardware To be a system administrator it is important to have a basic appreciation of the frailties and procedures surrounding hardware.  All electronic equipment should be treated as highly fragile and easily damaged, regardless of how sturdy it is.  Never insert or remove power cords from equipment without ensuring that it is switched off.  Take care when inserting multi-pin connectors that the pins are oriented the right way up and that no pins are bent on insertion. Moreover: 1) Read instructions: When dealing with hardware, one should always look for and read instructions in a manual. 2) Handling components: Modern day CMOS chips work at low voltages (typically 5 volts or lower). Standing on the floor with insulating shoes, you can pick up a static electric charge of several thousand volts. Such a charge can instantly destroy computer chips. Before touching any computer components, earth yourself by touching the metal casing of the computer. If you are installing equipment inside a computer, wear a conductive wrist strap. 3) Disks: Disk technology has been improving steadily for two decades. The most common disk types, in the workplace, fall into two families: ATA (formerly IDE) and SCSI. ATA disks are now generally cheaper than SCSI disks (due to volume sales) and excel at sequential access, but SCSI disks have traditionally been more efficient at handling multiple accesses due to a multitasking bus design, and are therefore better in multitasking systems, where random access is important.
  8. 8. For More : https://www.ThesisScientist.com 4) Memory: Memory chips are sold on small pluggable boards. They are sold in different sizes and with different speeds. A computer has a number of slots where they can be installed. When buying and installing RAM, remember  The physical size of memory plug-in is important. Not all of them fit into all sockets.  Memory is sold in units with different capacities and data rates. One must find out what size can be used in a system. 5) Lightning: strikes can destroy fragile equipment. No fuse will protect hardware from a lightning strike. Transistors and CMOS chips burn out much faster than any fuse. Electronic spike protectors can help here, but nothing will protect against a direct strike. 6) Power: failure can cause disk damage and loss of data. A UPS (uninterruptible power supply) can help. 7) Heat: Blazing summer heat or a poorly placed heater can cause systems to overheat and suddenly black out. One should not let the ambient temperature near a computer rise much above 25 degrees Centigrade. Increased temperature also increases noise levels that can reduce network capacities by a fraction of a percent. Heat can cause RAM to operate unpredictably and disks to misread/miswrite. Good ventilation is essential for computers and screens to avoid electrical faults. 8) Cold: Sudden changes from hot to cold are just as bad. They can cause unpredictable changes in electrical properties of chips and cause systems to crash. In the long term, these changes could lead to cracks in the circuit boards and irreparable chip damage. 9) Humidity: In times of very cold weather and very dry heat, the humidity falls to very low levels. At these times, the amount of static electricity builds up to quite high levels without dissipating. This can be a risk to electronic circuitry. Humans pick up charge just by walking around, which can destroy fragile circuitry. Paper sticks together causing paper crashes in laser printers. Too much humidity can lead to condensation and short circuits. 4 Operating System: Windows and UNIX variants Operating System (or shortly OS) primarily provides services for running applications on a computer system 4.1 Need for an OS: The primary need for the OS arises from the fact that user needs to be provided with services and OS ought to facilitate the provisioning of these services. The central part of a computer system is a processing engine called CPU. A system should make it possible for a user‟s application to use the processing unit. A user application would need to store
  9. 9. For More : https://www.ThesisScientist.com information. The OS makes memory available to an application when required. Similarly, user applications need use of input facility to communicate with the application. This is often in the form of a key board, or a mouse or even a joy stick (if the application is a game for instance). The output usually provided by a video monitor or a printer as some times the user may wish to generate an output in the form of a printed document. Output may be available in some other forms. For example it may be a video or an audio file. Let us consider few applications. • Document Design • Accounting • E-mail • Image processing We notice that each of the above application requires resources for • Processing information • Storage of Information • Mechanism to inputting information • Provision for outputting information • These service facilities are provided by an operating system regardless of the nature of application. The OS offers generic services to support all the above operations. These operations in turn facilitate the applications mentioned earlier. To that extent an OS operation is application neutral and service specific. 4.2 User and System View: From the user point of view the primary consideration is always the convenience. It should be easy to use an application. . The human computer interface which helps to identify an application and its launch is very useful. If we examine the programs that help us in using input devices like a key board – all the complex details of character reading program are hidden from the user. The same is true when we write a program. For instance, when we use a programming language like C, a printf command helps to generate the desired form of output. The following figure essentially depicts the basic schema of the use of OS from a user stand point. However, when it comes to the view point of a system, the OS needs to ensure that all the system users and applications get to use the facilities that they need.
  10. 10. For More : https://www.ThesisScientist.com 4.3 what does an OS Do? • Power On Self Test (POST) • Resource management Support for multi-user • Error Handling • Communication support over Network • (Optional) Deadline support so that safety critical application run and fail gracefully 4.4 UNIX UNIX is a powerful computer operating system originally developed at AT&T Bell Laboratories. It is very popular among the scientific, engineering, and academic communities due to its multi-user and multi-tasking environment, flexibility and portability, electronic mail and networking capabilities, and the numerous programming, text processing and scientific utilities available. Unix Variants This diagram shows the "family tree" of the Unix operating system. Unix-like The Unix- like family is a diverse group of operating systems, with several major subcategories including System V, BSD, and Linux. The name "Unix" is a trademark of The Open Group which licenses it for use to any operating system that has been shown to conform to the definitions that they have cooperatively developed. The name is commonly used to refer to the large set of operating systems which resemble the original Unix. Unix systems run on a wide variety of machine architectures. They are used heavily as server systems in business, as well as workstations in academic and engineering environments. Free software Unix variants, such as Linux and BSD, are increasingly popular. They are used in the desktop market as well, for example Ubuntu, but mostly by hobbyists. Some Unix variants like HP's HP-UX and IBM's AIX are designed to run only on that vendor's proprietary hardware. Others, such as Solaris, can run on both proprietary hardware and on commodity x86 PCs. Apple's Mac OS X, a microkernel BSD variant derived from NeXTSTEP, Mach, and FreeBSD, has replaced Apple's earlier (non-Unix) Mac OS. Over the past several years, free Unix systems have supplanted proprietary ones in most instances
  11. 11. For More : https://www.ThesisScientist.com 4.5 Microsoft Windows The Microsoft Windows family of operating systems originated as a graphical layer on top of the older MS-DOS environment for the IBM PC. Modern versions are based on the newer Windows NT core that first took shape in OS/2 and borrowed from OpenVMS. Windows runs on 32-bit and 64-bit Intel and AMD computers, although earlier versions also ran on the DEC Alpha, MIPS, and PowerPC architectures (some work was done to port it to the SPARC architecture). As of 2004, Windows held a near-monopoly of around 90% of the worldwide desktop market share, although this is thought to be dwindling due to the increase of interest focused on open source operating systems. It is also used on low-end and mid-range servers, supporting applications such as web servers and database servers. 5) Processes and Job Control On a multitasking computer, all work on a running program is performed by an abstraction called a process. This is a collection of resources such as file handles, allocated memory, program code and CPU registers that is associated with a specific running program. On modern operating systems, processes can contain many concurrent threads which share program resources.
  12. 12. For More : https://www.ThesisScientist.com 5.1The UNIX process model A Process is simply an instance of a running a program. A process is said to be born when program starts executions and remains alive as long as the program is active. So after execution is complete a process is said to be die. A process also has name, usually the name of the program being executed. For e.g. when you execute the grep command a process name grep is created. However a process can be considered synonymous with a program when 2 users run the same program, there one program on disks but 2 process in memory. The kernel is responsible for management of process .its determines the time and priorities that are allocated to processes so that multiple processes are able to share CPU resources. its provides a mechanisms by which a process is able to execute for a finite period of time and then relinquish control to another process. Every process has attributes so some of attributes of every process is maintained by kernel in memory in separate structure called process table Figure UNIX process state model In case of UNIX the Running state is divided into 2 states  User running state  Kernel running state. 1) New State:- the process being created 2) Ready State: - the process is waiting to be assigned to a processor. 3) Blocked State:- the process is in main memory and waiting for an events
  13. 13. For More : https://www.ThesisScientist.com 4) Blocked Suspended: - the process is in secondary memory and waiting for an event. 5) Suspend / Ready:- the process is in secondary memory but is available for execution as soon as it is loaded into memory 6) Exited State: - it is a process for which parent have decided not to waits for them after a process die for their cleaning purpose. So this process does not have any entry in process table. 7) Zombie:- it is a process for which there parent have to waits for the completions ( possibly to clean after them) and system maintain its entry in process tables 8) Preempted State:- it is a special case pf blocked state a process retaining from system calls ( hence after having run in kernel modes) to immediately blocked and put the ready process queue instead of returning ,leaving CPU to another process. All processes in UNIX are created using the fork() system call . UNIX implements through the fork() and exec() system calls an elegant two-step mechanism for process creation and execution. fork() is used to create the image of a process using the one of an existing one, and exec is used to execute a program by overwriting that image with the program's one. A call to fork() of the form: #include <sys/types.h> pid_t childpid; ... childpid = fork(); /* child's pid in the parent, 0 in the child */ ... creates (if it succeeds) a new process, which a child of the caller's, and is an exact copy of of the (parent) caller itself. By exact copy we mean that it's image is a physical bitwise copy of the parent's  The two processes obviously have two different process id.s. (pid). In a C program process id.s are conveniently represented by variables of pid_t type, the type being defined in the sys/types.h header.  In UNIX the PCB of a process contains the id of the process's parent, hence the child's PCB will contain as parent id (ppid) the pid of the process that called fork(), while the caller will have as ppid the pid of the process that spawned it.  The child process has its own copy of the parent's file descriptors. These descriptors reference the same under-lying objects, so that files are shared between the child and the parent. This makes sense, since other processes might access those files as well, and having them already open in the child is a time- saver.
  14. 14. For More : https://www.ThesisScientist.com The fork() call returns in both the parent and the child, and both resume their execution from the statement immediately following the call. One usually wants that parent and child behave differently, and the way to distinguish between them in the program's source code is to test the value returned by fork(). This value is 0 in the child, and the child's pid in the parent. Process management command  ps :To display the currently working processes  top :Display all running process  kill pid :Kill the process with given pid  killall proc: Kill all the process named proc  pkill pattern :Will kill all processes matching the pattern  bg :List stopped or background jobs,resume a stopped job in the background  fg: Brings the most recent job to foreground  fg n: Brings job n to the foreground  ps –x: gives information about currently-running processes that you own. These may be from other UNIX sessions than your current UNIX session. The name of each process is in the far right column, and the process id for each process is in the first column. (BEWARE: the options for ps vary on different flavors of UNIX and Linux! 5.2 Child processes and zombies When we start a process, the new process becomes a child of the original. If one of the children starts a new process then it will be a child of the child (a grandchild). Processes therefore form hierarchies. Several children can have a common parent. All Unix user- processes are children of the initial process init, with process ID 1. If we kill a parent, then (unless the child has detached itself from the parent) all of its children die too. If a child dies, the parent is not affected. Sometimes when a child is killed, it does not die but becomes defunct or a zombie process. This means that the child has a parent which is waiting for it to finish. If the parent has not yet been informed that the child has died, because it has been suspended itself for instance, then the dead child is not completely removed from the kernel‟s process table. When the parent wakes up and receives the
  15. 15. For More : https://www.ThesisScientist.com message that the child has terminated (and its exit status), the process entry for the dead child can be removed. Most UNIX processes go through a zombie state, but most terminate so quickly that they cannot be seen. It is not possible to kill a zombie process, since it is already dead. The only way to remove a zombie is to either reactivate the process which is waiting for it, or to kill that process. Persistent zombie processes are usually caused by software bug 5.3 The Windows process model Like UNIX, processes under Windows/NT can live in the foreground or in the background, though unlike UNIX, Windows does not fork processes by replicating existing ones. A background process can be started with start /B In order to kill the process it is necessary to purchase the Resource kit which contains a kill command. A background process detaches itself from a login session and can continue to run even when the user is logged out. Threads are the preferred method for multitasking. This means that additional functionality is often implemented as modules to existing software, rather than as independent objects. The shutdown of the whole system is normally performed from the Windows menu. Any logged on user can shut down a host. Background processes die when this happens and updates from an administrator could fail to be applied. 6 Privileged accounts Operating systems that restrict user privileges need an account which can be used to configure and maintain the system. Such an account must have access to the whole system, without regard for restrictions. It is therefore called a privileged account. In UNIX the privileged account is called root, also referred to colloquially as the super- user. In Windows, the Administrator account is similar to UNIX‟s root, except that the administrator does not have automatic access to everything as does root. Instead he/she must be first granted access to an object. However the Administrator always has the right to grant them self access to a resource .These accounts place virtually no restriction on what the account holder can do. In a sense, they provide the privileged user with a skeleton key, a universal pass to any part of the system. Administrator and root accounts should never be used for normal work: they wield far too much power. This is one of the hardest things to drill into novices, particularly those who have grown up using insecure operating systems. Such users are used to being able to do whatever they please. 7 Logs and audits
  16. 16. For More : https://www.ThesisScientist.com Operating system kernels share resources and offer services. They can be asked to keep lists of transactions which have taken place so that one can later go back and see exactly what happened at a given time. This is called logging or auditing. Full system auditing involves logging every single operation that the computer performs. This consumes vast amounts of disk space and CPU time and is generally inadvisable unless one has a specific reason to audit the system. Auditing has become an issue again in connection with security. Organizations have become afraid of break-ins from system crackers and want to be able to trace the activities of the system in order to be able to look back and find out the identity of a cracker. The other side of the coin is that system accounting is so resource consuming that the loss of performance might be more important to an organization than the threat of intrusion For some organizations auditing is important, however. One use for auditing is so-called non-repudiation, or non-denial. If everything on a system is logged, then users cannot back away and claim that they did not do something: it‟s all there in the log. Non- repudiation is a security feature which encourages users to be responsible for their actions. 8 System Performance Tuning System performance tuning is a complex subject, in which no part of the system is sacrosanct. Although it is quite easy to pin-point general performance problems, it is harder to make general recommendations to fix these.  What processes are running  How much available memory the system has  Whether disks are being used excessively  Whether the network is being used heavily  What software dependencies the system has (e.g. DNS, NFS). 8.1Resources and dependencies Since all resources are scheduled by processes, it is natural to check the process table first and then look at resource usage. On Windows, one has the process manager and performance monitor for this. On Unix- like systems, we check the process listing with ps aux. A BSD process listing looks like this: host% ps aux | more USER PID %CPU %MEM SZ RSS TT S START TIME COMMAND root 3 0.2 0.0 0 0 ? S Jun 15 55:38 fsflush root 22112 0.1 0.5 1464 1112 pts/2 O 15:39:54 0:00 ps aux mark 22113 0.1 0.3 1144 720 pts/2 O 15:39:54 0:00 more
  17. 17. For More : https://www.ThesisScientist.com root 340 0.1 0.4 1792 968 ? S Jun 15 3:13 /bin/fingerd This one was taken on a quiet system, with no load. The columns show the user ID of the process, the process ID, an indication of the amount of CPU time used in executing the program (the percentage scale can be taken with a pinch of salt, since it means different things for different kernels), and an indication of the amount of memory allocated. The SZ post is the size of the process in total (code plus data plus stack), while RSS is the resident size, or how much of the program code is actually resident in RAM, as opposed to being paged out, or never even loaded. TIME shows the amount of CPU time accumulated by the process, while START indicates the amount of clock time which has elapsed since the process started. 8.2 Hardware Disks: When assigning partitions to new disks, it pays to use the fastest disks for the data which are accessed most often, e.g. for user home directories. To improve disk performance, we can do two things. One is to buy faster disks and the other is to use parallelism to overcome the time it takes for physical motions to be executed. The mechanical problem which is inherent in disk drives is that the heads which read and write data have to move as a unit. If we need to collect two files concurrently which lie spread all over the disk, this has to be done serially. Disk striping is a technique whereby filesystems are spread over several disks. By spreading files over several disks, we have several sets of disk heads which can seek independently of one another, and work in parallel. This does not necessarily increase the transfer rate, but it does lower seek times, and thus performance improvement can approach as much as N times with N disks. RAID technologies employ striping techniques and are widely available commercially. Spreading disks and files across multiple disk controllers will also increase parallelism. Network: To improve network performance, we need fast interfaces. All interfaces, whether they be Ethernet or some other technology, vary in quality and speed. This is particularly true in the PC world, where the number of competing products is huge. Network interfaces should not be trusted to give the performance they advertise. Some interfaces which are sold as 100Mbits/sec, Fast Ethernet, manage little more than 40Mbits/sec. Ethernet collisions: Ethernet communication is like a television panel of politicians: many parties shouting at random, without waiting for others to finish. The Ethernet cable is a shared bus. When a host wishes to communicate with another host, it simply tries. If another host happens to be using the bus at that time, there is a collision and the host must try again at random until it is heard. This method naturally leads to contention for bandwidth. The system works quite well when traffic is low, but as the number of hosts competing for bandwidth increases, the probability of a collision increases in step Disk thrashing: Thrashing is a problem which occurs because of the slowness of disk head movements, compared with the speed of kernel time-sharing algorithms. If two
  18. 18. For More : https://www.ThesisScientist.com processes attempt to take control of a resource simultaneously, the kernel and its device drivers attempt to minimize the motion of the heads by queuing requested blocks in a special order. The algorithms really try to make the disks traverse the disk platter uniformly, but the requests do not always come in a predictable or congenial order. The result is that the disk heads can be forced back and forth across the disk, driven by different processes and slowing the system to a virtual standstill. The time for disk heads to move is an eternity to the kernel, some hundreds of times slower than context switching times. 8.3 Software tuning and kernel configuration Software performance tuning is a more complex problem than hardware performance tuning, simply because the options we have for tuning software depend on what the software is, how it is written and whether or not the designer made it easy for us to tune its performance. Some software is designed to be stable rather than efficient. Efficiency is not a fundamental requirement; there are other priorities, such as simplicity and robustness. Performance tuning is related to the availability or sharing of system resources. This requires tuning the system kernel. The most configurable piece of software on the system is the kernel. All Unix-like systems kernel parameters can be altered and tuned. The most elegant approach to this is taken by Unix SVR4, and Solaris. Here, many kernel parameters can be set at run time using the kernel module configuration command ndd. Others can be configured in a single file /etc/system. The parameters in this file can be set with a reboot of the kernel, using the reconfigure flag reboot -- -r For instance, on a heavily loaded system which allows many users to run external logins, terminals, or X-terminal software, we need to increase many of the default system parameters. The maxusers parameter (actually in most Unix-like systems) is used as a guide to estimating the size of many tables and limits on resources. Its default value is based on the amount of available RAM, so one should be careful about changing its value in Solaris, though other OSs are less intelligent. The file /etc/system, then looks like this: set maxusers=100 set shmsys:shminfo_shmmax = 0x10000000 set pt_cnt=128 Most Unix-like operating systems do not permit run-time configuration. New kernels have to be compiled and the values hard-coded into the kernel. This requires not just a reboot, but a recompilation of the kernel in order to make a change. This is not an optimal way to experiment with parameters. Modularity in kernel design can save us memory,
  19. 19. For More : https://www.ThesisScientist.com since it means that static code does not have to take up valuable memory space. However, the downside of this is that modules take time to load from disk, on demand. The GNU/Linux system kernel is a modular kernel, which can load drivers for special hardware at run time, in order to remain small in the memory. When we build a kernel, we have the option to compile in modules statically. Windows performance tuning can be undertaken by perusing the multitudinous screens in the graphical performance monitor and editing the values. For once, this useful tool is a standard part of the Windows system. 8.4 Data efficiency Efficiency of storage and transmission depends on the configuration parameters used to manage disks and networks, and also on the amount of traffic the devices . Some filesystem formatting programs on Unix-like systems allow us to reserve a certain percentage of disk space for privileged users. For instance, the default for BSD is to reserve ten percent of the size of a partition for use by privileged processes only. The idea here is to prevent the operating system from choking due to the activities of users. This practice goes back to the early times when disks were small and expensive and partition numbers were limited. Today, these limits are somewhat inappropriate. Ten percent of a gigabyte disk is a huge amount of space, which many users could live happily with for many weeks. If we have partitioned a host so as to separate users from the operating system, then there is no need to reserve space on user disks. Better to let users utilize the existing space until a real problem occurs. Preventative tidying helps to avoid full disks. The effect is to save us time and loss of resource availability Another issue with disk efficiency is the configuration of block sizes. Briefly, the standard unit of space which is allocated on a filesystem is a block. Blocks are quite large, usually around 8 kilobytes. Even if we allocate a file which is one byte long, it will be stored as a separate unit, in a block by itself, or in a fragment. Fragments are usually around 1 kilobyte. If we have many small files, this can clearly lead to a large wastage of space and it might be prudent to decrease the filesystem block size. If, conversely, we deal with mostly large files, then the block size could be increased to improve transfer efficiency. The filesystem parameters can, in other words, be tuned to balance file size and transfer-rate efficiency. Normally the default settings are a good compromise 9 Host management: Booting and shutting down of an Operating System 9.1 Global view, local action
  20. 20. For More : https://www.ThesisScientist.com Various point considers foe host installation are:-  Follow the OS designer‟s recommended setup? (Often this is insufficient for our purpose)  Create our own setup?  Make all machines alike?  Make all machines different? 9.2 Physical considerations of server room 1) Critical hardware needs to be protected from accidental and malicious damage. An organization‟s very livelihood could be at stake from a lack of protection of its basic hardware. Not all organizations have the luxury of choosing ideal conditions for their equipment, but all organizations could dedicate a room or two to server equipment. 2) Any server room should have, at the very least, a lockable door, probably cooling or ventilation equipment to prevent the temperature from rising above about 20 degrees Celsius and some kind of anti-theft protection. 3) Remember that backup tapes should never be stored in the same room as the hosts they contain data from, and duplicate servers are best placed in different physical locations so that natural disasters or physical attacks (fire, bombs etc.) will not wipe out all equipment at the same time. 4) Security registration should be required for all workers and visitors, with camera recorded registration and security guards. Visitors should present photo-ID and be prevented from bringing anything into the building; they should be accompanied at all times. 5) Within the server area:  A reliable (uninterruptible) power supply is needed for essential equipment.  Single points of failure, e.g. network cables, should be avoided.  Hot standby equipment should be available for minimal loss of uptime in case of failure.  Replaceable hard disks should be considered1 with RAID protection for continuity.  Protection from natural disasters like fire and floods, and heating failure in cold countries should be secured. Note that most countries have regulations about fire control. A server room should be in its own „fire cell‟, i.e. it should be isolated by doorways and ventilation systems from neighboring areas to prevent the spread of fire. 9.3 Computer startup and shutdown The two most fundamental operations which one can perform on a host are to start it up and to shut it down. With any kind of mechanical device with moving parts, there has to be a procedure for shutting it down. One does not shut down any machine in the middle of a crucial operation. With a multitasking operating system, the problem is that it is
  21. 21. For More : https://www.ThesisScientist.com never possible to predict when the system will be performing a crucial operation in the background. For this simple reason, every multitasking operating system provides a procedure for shutting down safely. A safe shutdown avoids damage to disks by mechanical interruption, but it also synchronizes hardware and memory caches, making sure that no operation is left incomplete. 9.3.1 Booting Unix  Unix systems can boot in several different modes or run levels. The most common modes are called multi-user mode and single-user mode.  In single-user mode no external logins are permitted. The purpose of single-user mode is to allow the system administrator access to the system without fear of interference from other users. It is used for installing disks or when repairing filesystems, where the presence of other users on the system would cause problems.  The Unix boot procedure is controlled entirely by the init program; init reads a configuration file called /etc/inittab.  On older BSD Unices, a file called /etc/rc meaning „run commands‟ and subsidiary files like rc.local was then called to start all services. These files were no more than shell scripts. In the System V approach, a directory called (something like) /etc/rc.d is used to keep one script per service. /etc/inittab defines a number of run-levels, and starts scripts depending on what run-level you choose.  The idea behind inittab is to make Unix installable in packages, where each package can be started or configured by a separate script. Which packages get started depends on the run-level you choose.  If the system does not boot right away, you might see the line type b) boot, c) continue or n) new command. In this case, you should type b –s  in order to boot in single-user mode. Under the GNU/Linux operating system, using the LILO OR GRUB boot system, we interrupt the normal boot sequence by pressing the SHIFT key when the LILO prompt appears. This should cause the system to stop at the prompt: Boot:  To boot, we must normally specify the name of a kernel file, normally linux. To boot in single-user mode, we then type Boot: linux single  The correct run-level should be determined from the file /etc/inittab. It is normally called S or 1 or even 1S.
  22. 22. For More : https://www.ThesisScientist.com 9.3.2 Shutting down Unix  Anyone can start a Unix-like system, but we have to be an administrator or „superuser‟ to shut one down correctly.The correct way to shut down a Unix system is to run one of the following programs.  halt: Stops the system immediately and without warning. All processes are killed with the TERM-inate signal 15 and disks are synchronized.  reboot: As halt, but the system reboots in the default manner immediately.  shutdown: This program is the recommended way of shutting down the system. It is just a friendly user-interface to the other programs, but it warns the users of the system about the impending shutdown and allows them to finish what they are doing before the system goes down.  Here are some examples of the shutdown command. The first is from BSD Unix: shutdown -h +3 "System halting in three minutes, please log out" shutdown -r +4 "System rebooting in four minutes"  The -h option implies that the system will halt and not reboot automatically.  The -r option implies that the system will reboot automatically. The times are specified in minutes.  The shutdown command allows one to switch run-levels in a very general way. To halt the system, we have to call this. shutdown -i 5 -g 120 "Powering down os...."  The -i 5 option tells SVR4 to go to run-level 5, which is the power-off state. Run  The -g 120 option tells shutdown to wait for a grace-period of 120 seconds before shutting down.  Note that Solaris also provides a BSD version of shutdown in /usr/ucb. 9.3.3 Booting and shutting down Windows  To boot the system, it is simply a matter of switching on the power.  To shut it down, one chooses shutdown from the Start Menu.  There is no direct equivalent of single-user mode for Windows, though „secure mode‟ is sometimes invoked, in which only the essential device drivers are loaded, if some problem is suspected.  The Windows boot procedure on a PC begins with the BIOS, or PC hardware. This performs a memory check and looks for a boot-able disk.  A boot-able disk is one which contains a master boot record (MBR). Normally the BIOS is configured to check the floppy drive A: first and then the hard-disk C: for a boot block.  The boot block is located in the first sector of the boot-able drive. It identifies which partition is to be used to continue with the boot procedure.  On each primary partition of a boot-able disk, there is a boot program which „knows‟ how to load the operating system it finds there.  Windows has a menu-driven boot manager program which makes it possible for several OSs to coexist on different partitions.
  23. 23. For More : https://www.ThesisScientist.com  Once the disk partition containing Windows has been located, the program NTLDR is called to load the kernel.  The file BOOT.INI configures the defaults for the boot manager.  After the initial boot, a program is run which attempts to automatically detect new hardware and verify old hardware. Finally the kernel is loaded and Windows starts properly. 10 Formatting, Partitioning and Building a File System, File System Layout 10.1 Partitioning  Disks can be divided up into partitions. Partitions physically divide the disk surface into separate areas which do not overlap.  The main difference between two partitions on one disk and two separate disks is that partitions can only be accessed one at a time, whereas multiple disks can be accessed in parallel.  Disks are partitioned so that files with separate purposes cannot be allowed to spill over into one another‟s space.  Partitioning a disk allows us to reserve a fixed amount of space for a particular purpose, safe in the knowledge that nothing else will encroach on that space. For example, it makes sense to place the operating system on a separate partition, and user data on another partition. If these two independent areas shared common space, the activities of users could quickly choke the operating system by using up all of its workspace.  Here are some practical points to consider when partitioning disks: 1. Size partitions appropriately for the jobs they will perform. Bear in mind that operating system upgrades are almost always bigger than previous versions, and that there is a general tendency for everything to grow. 2. Bear in mind that RISC (e.g. Sun Sparc) compiled code is much larger than CISC compiled code (e.g. software on an Intel architecture), so software will take up more space on a RISC system. 3. Consider how backups of the partitions will be made. It might save many complications if disk partitions are small enough to be backed up in one go with a single tape, or other backup device.  Disk partitioning is performed with a special program. On PC hardware, this is called fdisk or cfdisk. On Solaris systems the program is called, confusingly, format.  To repartition a disk, we first edit the partition tables. Then we have to write the changes to the disk itself. This is called labelling the disk.  Both of these tasks are performed from the partitioning programs. It is important to make sure manually that partitions do not overlap. The partitioning programs do not normally help us here. If partitions overlap, data will be destroyed and the
  24. 24. For More : https://www.ThesisScientist.com system will sooner or later get into deep trouble, as it assumes that the overlapping area can be used legitimately for two separate purposes.  Partitions are labelled with logical device names in Unix. As one comes to expect, these are different in every flavor of Unix. The general pattern is that of a separate device node for each partition, in the /dev directory, e.g. /etc/sd1a, /etc/sd1b, /dev/dsk/c0t0d0s0 etc. 10.2 Formatting and building file systems  Disk formatting is a way of organizing and finding a way around the surface of a disk. On a disk surface, it makes sense to divide up the available space into sectors or blocks. The way in which different operating systems choose to do this differs, and thus one kind of formatting is incompatible with another.  Making a filesystem also involves setting up an infrastructure for creating and naming files and directories. A filesystem is not just a labeling scheme, it also provides functionality. If a filesystem becomes damaged, it is possible to lose data.  Usually filesystem checking programs called disk doctors, e.g. the Unix program fsck (filesystem check), can be used to repair the operating system‟s map of a disk.  In Unix filesystems, data which lose their labelling get placed for human inspection in a special directory which is found on every partition, called lost+found.  The filesystem creation programs for different operating systems go by various names. For instance, on a Sun host running SunOS/Solaris, we would create a filesystem on the zeroth partition of disk 0, controller zero with a command like this to the raw device: newfs -m 0 /dev/rdsk/c0t0d0s0  The newfs command is a friendly front-end to the mkfs program.  The option –m 0, used here, tells the filesystem creation program to reserve zero bytes of special space on the partition.  This partition is then made available to the system by mounting it. This can either be performed manually: mount /dev/dsk/c0t0d0s0 /mountpoint/directory  or by placing it in the filesystem table /etc/vfstab.  GNU/Linux systems have the mkfs command, e.g. mkfs /dev/hda1  The filesystems are registered in the file /etc/fstab.  On Windows systems, disks are detected automatically and partitions are assigned to different logical drive names. Drive letters C: to Z: are used for nonfloppy disk devices. Windows assigns drive letters based on what hardware it finds at boot- time. Primary partitions are named first, then each secondary partition is assigned a drive letter.
  25. 25. For More : https://www.ThesisScientist.com  The format program is used to generate a filesystem on a drive. The command format /fs:ntfs /v:spare F:  would create an NTFS filesystem on drive F: and give it a volume label „spare‟. 10.4 Filesystem layout  We have no choice about the layout of the software and support files which are installed on a host as part of „the operating system‟. This is decided by the system designers and cannot easily be changed  A working computer system has several facets: 1. The operating system software distribution, 2. Third party software, 3. Users‟ files, 4. Information databases, 5. Temporary scratch space. 6. These are logically separate because: 7. They have different functions, 8. They are maintained by different sources, 9. They change at different rates, 10. A different policy of backup is required for each.  The point of directories and partitions is to separate files so as not to mix together things which are logically separate. There are many things which we might wish to keep separate: for example, 1. User home directories 2. Development work 3. Commercial software 4. Free software 5. Local scripts and databases.  One of the challenges of system design is in finding an appropriate directory structure for all data which are not part of the operating system, i.e. all those files which are locally maintained. 11 Concept of swap space, Cloning Systems. 11.1 Swap space  In Windows operating systems, virtual memory uses filesystem space for saving data to disk.  In Unix-like operating systems, a preferred method is to use a whole, unformatted partition for virtual memory storage.  A virtual memory partition is traditionally called the swap partition, though few modern Unix-like systems „swap‟ out whole processes, in the traditional sense.
  26. 26. For More : https://www.ThesisScientist.com  The swap partition is now used for paging. It is virtual memory scratch space, and uses direct disk access to address the partition. 11.2 Cloning systems  . A system administrator usually has to install ten, twenty or even a hundred machines at a time. He or she would also like them to be as far as possible the same, so that users will always know what to expect. This might sound like a straightforward problem, but it is not. There are several approaches. 1. A few Unix-like operating systems provide a solution to this using package templates so that the installation procedure becomes standardized. 2. The hard disks of one machine can be physically copied and then the hostname and IP address can be edited afterwards. 3. All software can be placed on one host and shared using NFS, or another shared file system.  Each of these approaches has its attractions. The NFS/shared filesystem approach is without doubt the least amount of work, since it involves installing the software only once, but it is also the slowest in operation for users.  In RedHat Linux we use this command , rpm -ivh package.rpm  Disks can be mirrored directly, using some kind of cloning program. For instance, the Unix tape archive program (tar) can be used to copy the entire directory tree of one host. In order to make this work, we first have to perform a basic installation of the OS, with zero packages and then copy over all remaining files which constitutes the packages we require. For example, with a GNU/Linux distribution: tar --exclude /proc --exclude /lib/libc.so.5.4.23 --exclude /etc/hostname --exclude /etc/hosts -c -v -f host-imprint.tar / 12 OS Installation, Installation and configuration of devices and drivers 12.1 Installing a UNIX disk There are several types of disk interface used for communicating with hard-disks.  ATA/IDE disks  SCSI disks  IEEE 1394 disks 12.1.1 mount and umount
  27. 27. For More : https://www.ThesisScientist.com To make a disk partition appear as part of the file tree it has to be mounted. We say that a particular filesystem is mounted on a directory or mountpoint. The command mount mounts filesystems defined in the filesystem table file. This is a file which holds data for mount to read. The syntax of the command is mount filesystem directory type (options) There are two main types of filesystem – a disk filesystem (called ufs, hfs etc.) (which means a physical disk) and the NFS network filesystem. Here are some examples, using the SunOS filesystem list above: mount -a # mount all in fstab mount -at nfs # mount all in fstab which are type nfs mount -at 4.2 # mount all in fstab which are type 4.2 mount /var/spool/mail # mount only this fs with options given in fstab (The -t option does not work on all Unix implementations.) 12.2 Installation of the operating system  The installation process is one of the most destructive things we can do to a computer. Everything on the disk will disappear during the installation process. One should therefore have a plan for restoring the information if it should turn out that reinstallation was in error.  Today, installing a new machine is a simple affair. The operating system comes on some removable medium (like a CD or DVD) that is inserted into the player and booted. One then answers a few questions and the installation is done.  Operating systems are now large so they are split up into packages. One is expected to choose whether to install everything that is available or just certain packages. Most operating systems provide a package installation program which helps this process.  In order to answer the questions about installing a new host, information must be collected and some choices made: 1. We must decide a name for each machine. 2. We need an unused Internet address for each. 3. We must decide how much virtual memory (swap) space to allocate. 4. We need to know the local netmask and domain name. 5. We need to know the local timezone. 12.2.1 Solaris  Solaris can be installed in a number of ways. The simplest is from CD-ROM. At the boot prompt, we simply type ? boot cdrom  This starts a graphical user interface which leads one through the steps of the installation from disk partitioning to operating system installation.The installation procedure proceeds through the standard list of questions, in this order: 1. Preferred language and keyboard type.
  28. 28. For More : https://www.ThesisScientist.com 2. Name of host. 3. Net interfaces and IP addresses. 4. Subscribe to NIS or NIS plus domain, or not. 5. Subnet mask. 6. Timezone. 7. Choose upgrade or install from scratch.. 12.2.2 GNU/Linux  Installing GNU/Linux is simply a case of inserting a CD-ROM and booting from it, then following the instructions.  What makes GNU/Linux installation unique amongst operating system installations is the sheer size of the program base. Since every piece of free software is bundled, there are literally hundreds of packages to choose from. This presents GNU/Linux distributors with a dilemma. To make installation as simple as possible, package maintainers make software self-installing with some kind of default configuration. This applies to user programs and to operating system services.  As with most operating systems, GNU/Linux installations assume that you are setting up a stand-alone PC which is yours to own and do with as you please.  Although GNU/Linux is a multiuser system, it is treated as a single-user system. Little thought is given to the effect of installing services like news servers and web servers. The scripts which are bundled for adding user accounts also treat the host as a little microcosm, placing users in /home and software in /usr/local. 12.2.3 Windows  The installation of Windows is similar to both of the above. One inserts a CD- ROM and boots. Here it is preferable to begin with an already partitioned hard- drive (the installation program is somewhat ambiguous with regard to partitions).  On rebooting, we are asked whether we wish to install Windows anew, or repair an existing installation. This is rather like the GNU/Linux rescue disk.  Next we choose the filesystem type for Windows to be installed on, either DOS or NTFS. There is  clearly only one choice: installing on a DOS partition would be irresponsible with regard to security. Choose NTFS.  Windows reboots several times during the installation procedure, though this has improved somewhat in recent versions. The first time around, it converts its default DOS partition into NTFS and reboots again. Then the remainder of the installation proceeds with a graphical user interface. There are several installation models for Windows workstations, including regular, laptop, minimum and custom. Having chosen one of these, one is asked to enter a license key for  the operating system. The installation procedure asks us whether we wish to use DHCP to configure the host with an IP address dynamically, or whether a static IP
  29. 29. For More : https://www.ThesisScientist.com address will be set. After various other questions, the host reboots and we can log in as Administrator. 13 User management Without users, there would be few challenges in system administration. Users are both the reason that computers exist and their greatest threat. 13.1 Issues User management is about interfacing humans to computers. This brings to light a number of issues: • Accounting: registering new users and deleting old ones. • Comfort and convenience. • Support services. • Ethical issues. • Trust management and security. 13.2 User registration One of the first issues on a new host is to issue accounts for users. The tools provided by operating systems for this task are, at best, primitive and are rarely suitable for the task without considerable modification For small organizations, user registration are a relatively simple matter. Users can be registered at a centralized location by the system manager, and made available to all of the hosts in the network by some sharing mechanism, such as a login server, distributed authentication service or by direct copying of the data. For larger organizations, with many departments, user registration is much more complicated. The need for centralization is often in conflict with the need for delegation of responsibility. It is convenient for autonomous departments to be able to register their own users, but it is also important for all users to be registered under the umbrella of the organization, to ensure unique identities for the users and flexibility of access to different parts of the organization. 13.2.1 Local and network accounts Most organizations need a system for centralizing passwords, so that each user will have the same password on each host on the network. In .fixed model computing environments
  30. 30. For More : https://www.ThesisScientist.com such as NT or Novell Netware, where a login or domain server is used, this is a simple matter. In larger organizations with many departments or sub-domains it is more difficult. Both Unix and NT support the creation of accounts locally on a single host, or „globally‟ within a network domain. With a local account, a user has permission to use only the local host. With a network account, the user can use any host which belongs to a network domain. Local accounts are configured on the local host itself. Unix registers local users by added them to the files /etc/passwd and /etc/shadow. In NT the Security Accounts Manager (SAM) is used to add local accounts to a given workstation. Principle (Distributed accounts). Users move around from host to host, share data and collaborate. They need easy access to data and workstations all over an organization. Suggestion (Passwords). Give users a common username on all hosts, of no more than eight characters. Give them a common password on all hosts, unless there is a special reason not to do so. Some users never change their passwords unless forced to, and some users never even log in, so it is important to assign good passwords initially. Never assign a simple password and assume that it will be changed. Adding/Removing users 13.2.2 Unix accounts When a new person joins an organization he is usually given an account by the system administrator. This is the login account of the user. Now a day‟s almost all Unix systems support an admin tool which seeks the following information from the system administrator to open a new account: 1. Username: This serves as the login name for the user. 2. Password: Usually a system administrator gives a simple password. The users are advised to later select a password which they feel comfortable using. User's password appears in the shadow files in encrypted forms. Usually, the /etc/passwd file contains the information required by the login program to authenticate the login name and to initiate appropriate shell as shown in the description below: bhatt:x:1007:1::/export/home/bhatt:/usr/local/bin/bash damu:x:1001:10::/export/home/damu:/usr/local/bin/bash Each line above contains information about one user. The first field is the name of the user; the next a dummy indicator of password, which is in another file, a shadow file. Password programs use a trap-door algorithm for encryption. 3. Home directory: Every new user has a home directory defined for him. This is the default login directory. Usually it is defined in the run command files. 4. Working set-up: The system administrators prepare .login and .profile files to help users to obtain an initial set-up for login. The administrator may prepare .cshrc, .xinitrc
  31. 31. For More : https://www.ThesisScientist.com .mailrc .ircrc files. these files are used in customizing a user's working environment. A natural point of curiosity would be: what happens when users log out? Unix systems receive signals when users log out. As earlier we mentioned that a user logs in under a login process initiated by getty process. Process getty identifies the terminal being used. So when a user logs out, the getty process which was running to communicate with that terminal is first killed. A new getty process is now launched to enable yet another prospective login from that terminal. The working set-up is completely determined by the startup files. These are basically .rc (run command) files. These files help to customize the user's working environment. For instance, a user's .cshrc file shall have a path variable which defines the access to various Unix built-in shell commands, utilities, libraries etc. In fact, many other shell environmental variables like HOME, SHELL, MAIL, TZ (the time zone) are set up automatically. In addition, the .rc files define the access to network services or some need-based access to certain licensed software or databases as well. To that extent the .rc files help to customize the user's working environment. 5. Group-id: The user login name is the user-id. Under Unix the access privileges are determined by the group a user belongs to. So a user is assigned a group-id. It is possible to obtain the id information by using an id command as shown below: [bhatt@iiitbsun OS]$id uid=1007(bhatt) gid=1(other) [bhatt@iiitbsun OS]$ Once an account has been opened the user may do the following: 1. Change the pass-word for access to one of his liking. 2. Customize many of the run command files to suit his needs. Closing a user account: Here again the password file plays a role. We know that /etc/password file has all the information about the users' home directory, password, shell, user and group-id, etc. When a user's account is to be deleted, all of this information needs to be erased. System administrators login as root and delete the user entry from the password file to delete the account. Disabling and/or removing user accounts.  Remove or modify entry in /etc/passwd  Remove entry in NIS/NIS+ maps  Remove $HOME/.rhosts files  Remove mail spool file  Remove from mail aliases file  Remove any cron or at jobs  Remove directory Various file contents :-
  32. 32. For More : https://www.ThesisScientist.com 1)Password file - /etc/passwd /etc/passwd contains 7 fields, each separated by ":", in the form: Login-id: password: user-id#: group-id#: User Info:home-dir:shell 2 Group file - /etc/group /etc/group contains 4 fields, each separated by a ":", in the form: group-name:password:gid:comma-separated,list,of,names 3 Shadow file - /etc/shadow etc/shadow contains 9 fields, each separated by a ":", in the form: login-id:password:lastchg:min:max:warn:inactive:expire:flag The encrypted password field might also contain the entries: NP for no password is valid *LK* meaning the account is locked until the superuser sets a password A typical /etc/shadow file might be: root:st44wfkgx33qX::::::: daemon:NP:6445:::::: The shadow password file is updated using the commands:  passwd change the password and password attributes  useradd add a new user  usermod modify a user's login information  userdel delete a user's login entry 14 Password Aging With password aging you can set minimum and maximum lengths of time for which the password is valid. Only the super user can change these values. Maximum time lengths
  33. 33. For More : https://www.ThesisScientist.com force your users to change passwords regularly. Minimum lengths prevent them from quickly changing them back. # passwd -x 40 frank 14.2.3 Windows accounts Single Windows accounts are added with the command net user username password /ADD /domain or using the GUI. The additional Resource Kit package contains tools which allow lists of users to be registered from a standard file format, with addusers.exe, but only at additional cost. Windows users begin in the root directory by default. It is customary to create a users directory for home directories. Network users conventionally have their home directory on the domain server mapped to the drive H:. There is only a single choice of shell (command interpreter) for NT, so this is not specified in the user registration procedure. Several possibilities exist for creating user profiles and access policies, depending on the management model used. 15 Controlling User Resources, Disk Space Allocation and quotas Every system has a mixture of passive and active users. Passive users utilize the system often minimally, quietly accepting the choices which have been made for them. Passive users can be a security risk, because they are not aware of their actions. Active users, on the other hand, follow every detail of system development. They frequently Find every error in the system and contact system administrators frequently, demanding upgrades of their favorite programs. Active users can be of great help to a system administrator, because they test out problems and report them actively. They are an important part of the system administration team, or community, and can also go a long way to helping the passive users. Principle (Active users). Active users need to understand that, while their skills are appreciated, they do not decide system policy: they must obey it. Even in a democracy, rules are determined by process and then obeyed by everyone. 15.1 Resource consumption Disks fill up at an alarming rate. Users almost never throw away Files unless they have to. If one is lucky enough to have only very experienced and extremely friendly users on the system, then one can try asking them nicely to tidy up their files. Most administrators do not have this luxury however. Most users never think about the trouble they might cause others by keeping lots of junk around. After all, multi-user systems and network servers are designed to give every user the impression that they have their own private machine. Of course, some users are problematical by nature.
  34. 34. For More : https://www.ThesisScientist.com Suggestion (Problem users). Keep a separate partition for problem users‟ home directories, or enforce strict quotas on them To keep hosts working it is necessary to remove files, not just add them. Quotas limit the amount of disk space users can have access to, but this does not solve the real problem. The real problem is that in the course of using a computer many flies are created as temporary data but are never deleted afterwards. The solution is to delete them. When a UNIX program crashes, the kernel dumps its image to disk in a file called core. These files crop up all over the place and have no useful purpose for most users. To most users they are just fluff on the upholstery and should be removed. A lot of free disk space can be reclaimed by deleting these files. Many users will not delete them themselves, however, because they do not even understand why they are there. Example. A useful strategy is to delete files one is not sure about only if they have not been accessed for a certain period of time, say a week. This allows users to use .les freely as long as they need to, but prevents them from keeping the .les around for ever. Cfengine can be used to perform this task 15.2 Killing old processes Processes sometimes do not get terminated when they should. There are several reasons for this. Sometimes users forget to log out, sometimes poorly written terminal software does not properly kill its processes when a user logs out. Sometimes background programs simply crash or go into loops from which they never return. One way to clean up processes in a work environment is to look for user processes which have run for more than a day. (Note that the assumption here is that everyone is supposed to log out each day and then log in again the next day – that is not always the case.) Cfengine can also be used to clean up old processes. Cfengine‟s processes commands are used to match processes in the process table (which can be seen by running ps ax on Unix). 15.3 Moving users When disk partitions become full, it is necessary to move users from old partitions to new ones. Moving users is a straightforward operation, but it should be done with some caution. A user who is being moved should not be logged in while the move is taking place, or .les could be copied incorrectly. We begin by looking for an appropriate user, perhaps one who has used a particularly large amount of disk space. Users need to be informed about the move: we have to remember that they might hard- code the names of their home directories in scripts and programs, e.g. CGIscripts. Also,
  35. 35. For More : https://www.ThesisScientist.com the user’s account must be closed by altering their login shell, for instance, before the .les are moved. 15. 4 Deleting old users Users who leave an organization eventually need to be deleted from the system. For the sake of certainty, it is often advisable to keep old accounts for a time in case the user actually returns, or wishes to transfer data to a new location. Whether or not this is acceptable must be a question of policy. Clearly it would be unacceptable for company secrets to be transferred to a new location. Before deleting a user completely, a backup of the data can be made for safe-keeping. Then we have to remove the following:  Account entry from the password database.  Personal files.  E-mail and voice mail and mailing lists.  Removal from groups and lists (e.g. mailing lists).  Removal of cron and batch tasks.  Revocation of smartcards and electronic ID codes 15.5 Disk Space Allocation and quotas In this section we shall discuss how does a system administrator manage the disk space. we stated that at the time of formatting, partitions of the disk get defined. The partitions may be physical or logical. In case of a physical partition we have the file system resident within one disk drive. In case of logical partition, the file system may extend over several drives. In either of these cases the following issues are at stake: 15.5.1 Disk quota: Disk quota can be allocated by reconfiguring the file system usually located at /etc/fstab. To extend the allocation quota in a file system we first have to modify the corresponding entry in the /etc/fstab file. The system administration can set hard or soft limits of user quota. If a hard limit has been set, then the user simply cannot exceed the allocated space. However, if a soft limit is set, then the user is cautioned when he approaches the soft limit. Usually, it is expected that the user will resort to purging files no longer in use. Else he may seek additional disk space. Some systems have quota set at the group level. It may also be possible to set quota for individual users. Both these situations require executing an edit quota instruction with user name or group name as the argument. The format of edquota instruction is shown below. edquota user-name Disk quotas mean that users have a hard limit to the number of bytes they are allowed to use on the disk. They are an example of a more general concept known as system accounting whereby you can control the resources used by any user, whether they be the
  36. 36. For More : https://www.ThesisScientist.com number of printed pages sent to the printer or the number of bytes written to the disk. Disk quotas have advantages and disadvantages. The advantage is that users really cannot exceed their limits. There is no way around this. Disk quotas are very restrictive and when a user exceeds their limit they often do not understand what has happened. Usually users do not even get a message unless they are logging in. Quotas also prevent users from creating large temporary files which can be a problem when compiling programs. They carry with them a system overhead, which makes everything run a little slower. A user may interrogate the disk space available at any time by using the df command. Its usage is shown below: df [options] [name] : to know the free disk space. where name refers to a mounted file system, local or remote. We may specify directory if we need to know the information about that directory. The following options may help with additional information: -l : for local file system -t : reports total no. of allocated blocks and i-nodes on the device. The Unix command du reports the number of disk blocks occupied by a file. Its usage is shown below: du [options] [name]... where name is a directory or a file Above name by default refers to the current directory. The following options may help with additional information: -a : produce output line for each file -s : report only the total usage for each name that is a directory i.e. not individual files. -r : produce messages for files that cannot be read or opened 16 Super user/Administrator Privileges. As we know, a privileged account has potentially dangerous consequences for the system. From this account, we have the power to destroy the system, or sabotage it. In short, the superuser‟s account should be configured to avoid as many casual mistakes as possible. There is no harm in giving Unix‟s root account an intelligent shell like tcsh or bash provided that shell is physically stored on the root partition. When a Unix system boots, only the root partition is mounted. If we reference a shell which is not available, we can render the host unbootable. The superuser‟s PATH variable should never include „.‟, i.e. the current directory. This is because it opens the system to a type of security vulnerability that can lead to accidental execution of the wrong command. For instance, suppose an ordinary user left a files called ls in the /tmp directory, and suppose the root account had the path setenv PATH .:/bin:/usr/bin If the superuser does the following
  37. 37. For More : https://www.ThesisScientist.com host# cd /tmp host# ls then, because the path search looks in the current directory first, it would find and execute the program which had been left by the user. That program then gets executed with root privileges and could be used to give the user concerned permanent privileged access to the system, for instance by installing a special account for the user which has root privileges. It should be clear that this is a security hazard. The privileged user should never log in directly (unless the system is in single user mode or on the console). The Superuser Every UNIX system comes with a special user in the /etc/passwd file with a UID of 0. This user is known as the superuser and is normally given the username root. The password for the root account is usually called simply the "root password." The root account is the identity used by the operating system itself to accomplish its basic functions, such as logging users in and out of the system, recording accounting information, and managing input/output devices. For this reason, the superuser exerts nearly complete control over the operating system: nearly all security restrictions are bypassed for any program that is run by the root user, and most of the checks and warnings are turned off.
  38. 38. For More : https://www.ThesisScientist.com 16 Maintaining Log Files Log files are generated by system processes to record activities for subsequent analysis. They can be useful tools for troubleshooting system problems and also to check for inappropriate activity. The UNIX releases are preconfigured to record certain information in log files, but configuration settings are available to increase the amount of information recorded. Log files can be very useful resources for security incident investigations. They can also be essential for prosecution of criminal activity. For these reasons log files should be periodically backed up to separate media, and precautions need to be taken to prevent tampering with the log files. It is expeced that an unauthorized intruder into a computing system will attempt to remove any trace of their activities from the system log files. For log files that tend to grow significantly in size over the course of time, it can be good practice to periodically rotate the logs. That is to say, rename the current log file to a name in a sequence, and start a new log. Here is an example of rotating a log file called mylog: $ cd /var/adm $ test -f mylog.2 && mv -f mylog.2 mylog.3 $ test -f mylog.1 && mv -f mylog.1 mylog.2 $ test -f mylog.log && cp -p mylog mylog.1 $ :>mylog 16.1 Syslog The system log is a log file that is maintained by the syslogd daemon. This log file can collect a variety of useful information, including panic conditions, data corruption, hardware errors, as well as warnings and tracking information. This log file can be
  39. 39. For More : https://www.ThesisScientist.com written to from a shell or script by means of the logger command. Messages are sent to the syslogd daemon, which processes them according to a configuration defined by a special file (such as /etc/syslog.conf). Events passed to the syslog are defined by a set of facilities and log levels. Combinations of facilities and log levels can be processed in different manners, or ignored altogether. For example, all error messages can be copied to the syslog.log file and e-mailed to the System Administrator, alerts can be printed to the console, mail debug messages can be added to a mail.log file, and so forth. The System Administrator should also be wary of misleading log messages. Users can add log entries using the logger command, and this can be employed as a prank or nuisance factor. 16.2 Newsyslog -- maintain system log files to manageable sizes newsyslog [-CFNnrsv] [-R tagname] [-a directory] [-d directory][-f config_file] [file ...] The newsyslog utility should be scheduled to run periodically . 16.3 syslogd -- log systems messages syslogd [-468ACcdknosuv] [-a allowed_peer] [-b bind_address][-f config_file] [-l [mode:]path] [-m mark_interval] [-P pid_file] [-p log_socket] The syslogd utility reads and logs messages to the system console, log files, other machines and/or users as specified by its configuration 16.4 logger -- make entries in the system log logger [-46Ais] [-f file] [-h host] [-P port] [-p pri] [-t tag] [message ...] The logger utility provides a shell command interface to the syslog system log module. 17 File System Repair fsck is a Unix utility for checking and repairing file system inconsistencies . File system can become inconsistent due to several reasons and the most common is abnormal shutdown due to hardware failure , power failure or switching off the system without proper shutdown . Due to these reasons the superblock in a file system is not updated and has mismatched information relating to system data blocks, free blocks and inodes .
  40. 40. For More : https://www.ThesisScientist.com 17.1 Modes of operation : fsck operates in two modes interactive and non interactive : a) interactive : the fsck examines the file system and stops at each error it finds in the file system and gives the problem description and ask for user response usually whether to correct the problem or continue without making any change to the file system. b)noninteractive :fsck tries to repair all the problems it finds in a file system without stopping for user response useful in case of a large number of inconsistencies in a file system but has the disadvantage of removing some useful files which are detected to be corrupt . If file system is found to have problem at the booting time non interactive fsck fsck is run and all errors which are considered safe to correct are corrected. But if still file system has problems the system boots in single user mode asking for user to manually run the fsck to correct the problems in file system 17,2Running fsck : fsck should always be run in a single user mode which ensures proper repair of file system . If it is run in a busy system where the file system is changing constantly fsck may see the changes as inconsistencies and may corrupt the file system . if the system can not be brought in a single user mode fsck should be run on the partitions ,other than root & usr , after unmounting them . Root & usr partitions can not be unmounted . If the system fails to come up due to root/usr files system corruption the system can booted with CD and root/usr partitions can be repaired using fsck. command syntax: fsck [ -F fstype] [-V] [-yY] [-o options] special 17.3 phases: fsck checks the file system in a series of 5 pages and checks a specific functionality of file system in each phase. ** phase 1 - Check Blocks and Sizes
  41. 41. For More : https://www.ThesisScientist.com ** phase 2 - Check Pathnames ** phase 3 - Check Connectivity ** phase 4 - Check Reference Counts ** phase 5 - Check Cylinder Groups 18 Backup and Restoration 3.1 Backup schemes Backup applies to individual changes, to system setup and to user data alike. In backing up data according to a regular pattern, we are assuming that no major changes occur in the structure of data .If major changes occur, we need to start backups afresh. The network has completely changed the way we have to think about backup. Transmitting copies of files to secondary locations is now much simpler. The basics of backup are these:  Physical location: A backup should be kept at a different physical location than the original. If data were lost because of fire or natural disaster, then copies will also be lost if they are stored nearby. On the other hand, they should not be too far away, or restoration time will suffer.  How often? How often does the data change significantly, i.e. how often do we need to make a backup? Every day? Do you need to archive several different versions of files, or just the latest version? The cost of making a backup is a relevant factor her  Relevant and irrelevant files: There is no longer much point in making a backup of parts of the operating system distribution itself. Today it is usually just as quick to reinstall the operating system from source, using the original CD-ROM. If we have followed the principle of separating local modifications from the system files, then it should be trivial to backup only the files which cannot be recovered from the CD-ROM, without having to backup everything.  Backup policy: Some sites might have rules for defining what is regarded as valid information, i.e. what it is worth making a backup of. Files like prog.tar.gz might not need to be kept on backup media since they can be recovered from the network just as easily. Also one might not want to make backups of teen „artwork‟ which certain users collect from the network, nor temporary data, such as browser cache files. 17.1.1 Medium Traditionally backups have been made from disk to tape (which is relatively cheap and mobile), but tape backup is awkward and difficult to automate unless one can afford a
  42. 42. For More : https://www.ThesisScientist.com specialized robot to change and manage the tapes. For small sites it is also possible to perform disk mirroring. Disk is cheap, while human operators are expensive. Many modern filesystems (e.g. DFS) are capable of automatic disk mirroring in real-time. A cheap approach to mirroring is to use cfengine: # cfengine.conf on backup host copy: /home dest=/backup/home recurse=inf server=myhost exclude=core When run on the backup host, this makes a backup of all the files under the directory /home on the host myhost, apart from core files. RAID disks also have inbuilt redundancy which allows data to be recovered in the event of a single disk crash. Another advantage with a simple mirroring scheme is that users can recover their files themselves, immediately without having to bother a system administrator. 17.1.2A backup schedule How often we need to make backups depends on two competing rates of change:  The rate at which new data are produced.  The expected rate of loss or failure. For most sites, a daily backup is sufficient. In a war-zone, where risk of bombing is a threat at any moment, it might be necessary to back up more often. Most organizations do not produce huge amounts of data every day; there are limits to human creativity. However, other organizations, such as research laboratories collect data automatically from instruments which would be impractically expensive to re-acquire. In that case, the importance of backup would be even greater. Of course, there are limits to how often it is possible to make a backup. Backup is a resource-intensive process. Suggestion (Static data). When new data are acquired and do not change, they should be backed up to permanent write-once media at once. CD-ROM is an excellent medium for storing permanent data. Backup Restore cp -ar cp -ar tar cf tar xpf GNU tar zcf tar zxpf dd dd cpio cpio dump restore ufsdump restore rdump rrestore
  43. 43. For More : https://www.ThesisScientist.com NTBackup Of course, commercial backup solutions exist for all operating systems, but they are often costly. On both UNIX and Windows, it is possible to backup filesystems either fully or differentially, also called incrementally. A full dump is a copy of every file. An incremental backup is a copy of only those files which have changed since the last backup was taken. Incremental backups rely on dump timestamps and a consistent and reliable system clock to avoid files being missed. For instance, the UNIX dump utility records the dates of its dumps in a file /etc/dumpdates. Incremental dumps work on a scheme of levels, as we shall see in the examples below. There is many schemes for performing system dumps: • Mirroring: By far the simplest backup scheme is to mirror data on a daily basis. A tool like cfengine or rsync (Unix) can be used for this, copying only the files which have changed since the previous backup. Cfengine is capable of retaining the last two versions of a file, if disk space permits. A disadvantage with this approach is that it places the onus of keeping old versions of files on the user. Old versions will be mercilessly overwritten by new ones. • Simple tape backup: Tape backups are made at different levels. A level 0 dump is a complete dump of a filesystem. A level 1 dump is a dump of only those files which have changed since the last level 0 dump; a level 2 dump backs up files which have changed since the last level 1 dump and so on, incrementally. There are commonly nine levels of dumps using the Unix dump commands. NTBackup also allows incremental dumps. The point of making incremental backups is that they allow us to capture changes in rapidly changing files without having to copy an entire filesystem every time. The vast majority of files on a filesystem do not change appreciably over the space of a few weeks, but the few files which we are working on specifically do change often. By pin- pointing these for special treatment we save both time and tapes. So how do we choose a backup scheme? There are many approaches, but the key principle to have in mind is that of redundancy. The more copies of a file we have, the less likely we are to lose the file. A dump sequence should always begin with a level 0 dump, i.e. the whole filesystem. This initializes the sequence of incremental dumps. Monday evening, Tuesday morning or Saturday are good days to make a level 0 dump, since that will capture most large changes to the filesystem that occur during the week or weekend, in the level 0 dump rather than in the subsequent incremental ones. Studies show that users download large amounts of data on Mondays (after the weekend break) and it stands to reason that after a week of work, large changes will have taken place by Saturday. So we can take our pick. Here is a simple backup sequence for user home-directories, then, assuming that the backups are taken at the end of each day:
  44. 44. For More : https://www.ThesisScientist.com Notice how this sequence works. We start with a full dump on Monday evening, collecting all files on the filesystem. Then on subsequent days we add only those files which have changed since the previous day. Finally on Saturday we go back to a level 1 dump which captures all the changes from the whole week (since the Monday dump) in one go. By doing this, we have two backups of the changes, not just one. If we do not expect much to happen over the weekend, we might want to drop the dump on Saturday. A variation on this scheme, which captures several copies of every file over multiple tapes, is the so-called Towers of Hanoi sequence. The idea here is to switch the order of the dump levels every other day. This has the effect of capturing not only the files which have changed since the last dump, but also all of the files from the previous dump as well. Here is a sample for Monday to Saturday: There are several things to notice here. First of all, we begin with a level 0 dump at the beginning of the month. This captures primarily all of the static files. Next we begin our first week with a level 3 dump which captures all changes since the level 0 dump. Then, instead of stepping up, we step down and capture all of the changes since the level 0 dump again (since 3 is higher than 2). This means that we get everything from the level 3 dump and all the changes since then too. On day 4 we go for a level 5 dump which captures everything since the last level 3, and so on. Each backup captures not only new changes, but all of the previous backup also. This provides double the amount of redundancy as would be gained by a simple incremental sequence. When it comes to Monday again, we begin with a level 1 backup which grabs the changes from the whole of the previous week. Then once a month, a level 0 backup grabs the whole thing again. 17.3.3 Recovery from loss
  45. 45. For More : https://www.ThesisScientist.com The ability to recover from loss presupposes that we have enough pieces of the system from which to reconstruct it, should disaster strike. This is where the principle of redundancy comes in. If we have done an adequate job of backing up the system, including special information about its hardware configuration, then we will not lose data, but we can still lose valuable time. Recovery plans can be useful provided they are not merely bureaucratic exercises. Usually a checklist is sufficient, provided the system administration team is all familiar with the details of the local configuration. A common mistake in a large organization, which is guaranteed to lead to friction, is to make unwarranted assumptions about a local department. Delegation can be a valuable strategy in the fight against time. If there are sufficient local system administrators who know the details of each part of the network, then it will take such people less time to make the appropriate decisions and implement the recovery plan. However, delegation also opens us up to the possibility of inconsistency – we must make sure that those we delegate to be well trained. (Remember to set the write-protect tab on tapes and have someone check this afterwards.) When loss occurs, we have to recover files from the backups. One of the great advantages of a disk mirroring scheme is that users can find backups of their own files without having to involve an administrator. For larger file recoveries, it is more efficient for a system administrator to deal with the task. Restoring from tape backup is a much more involved task. Unfortunately, it is not merely a matter of donkey work. First of all we have to locate the correct tape (or tapes) which contain the appropriate versions of backed up files. This involves having a system for storage, reading labels and understanding any incremental sequence which was used to perform the dump. It is a time-consuming business. One of the awkwardness‟s of incremental backups is that backing up files can involve changing several tapes to gather all of the files. Suggestion (URL filesystem names). Use a global URL naming scheme for all filesystems, so that the filename contains the true location of the file, and you will never lose a file on a tape, even if the label falls off. Each file will be sufficiently labeled by its time-stamp and its name. We have two choices in recovery: reconstruction from backup or from source. Recovery from source is not an attractive option for local data. It would involve typing in every document from scratch. For software which is imported from external sources (CD- ROMs or ftp repositories), it is possible to reconstruct software repositories like /usr/local or Windows‟ software directories. Whether or not this is a realistic option depends on how much money one has to spend. For a particularly impoverished department, reconstruction from source is a cheap option.

×