Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 22

1.

Linux/Unix Introduction
Lets Understand

pictesolutions

Linux/Unix Introduction:1
Linux is a modern, flexible, and mature operating system. Although it started life on the Intel platform, it has since been ported to many other platforms such as Amiga, DEC Alpha, Apple Power PC, Sun workstations, and others. Linux boasts many other features: Multitasking - Linux is a true preemptive multitasking operating system. All processes run independently of each other and leave processor management to the kernel. Networking - Linux supports a multitude of networking protocols. Interoperability - Linux can interoperate with Windows 9x/NT/NT 2000, Novell, Mac, and most other versions of UNIX. Multi-user - Linux can handle multiple users simultaneously logged on to one machine. Advanced memory management Traditional UNIX systems used swapping to manage memory, where the entire memory structure of a program was written to disk when the system began running low on memory. Linux uses paging, a method that intelligently allocates memory, when system memory is running low, by prioritizing memory task pictesolutions 2

Linux/Unix Introduction:2
Linux currently supports up to 64GB of RAM. Multiple file systems Linux must be installed on Extended 2 Linuxformatted partitions, but if certain other OS file systems already exist on the same host, Linux will support several of these file system formats as well, including DOS/Windows, OS/2, and Novell. This is just another interoperability feature provided by Linux.

pictesolutions

2. Overview of Linux/Unix File System Hierarchy Standard (FHS)


Unix/Linux Architecture

pictesolutions

FHS
Red Hat is committed to the Filesystem Hierarchy Standard (FHS), a collaborative document that defines the names and locations of many files and directories. The FHS document is the authoritative reference to any FHScompliant file system, but the standard leaves many areas undefined or extensible. This section is an overview of the standard and a description of the parts of the file system not covered by the standard. Compliance with the standard means many things, but the two most important are compatibility with other compliant systems and the ability to mount a /usr/ partition as read-only because it contains common executables and should not be changed by users. Since the /usr/ directory is mounted read-only, it can be mounted from the CD-ROM or from another machine via a readpictesolutions

only NFS mount

FHS Organization
The directories and files noted here are small subsets of those specified by the FHS document. Refer to the latest FHS document for the most complete information. The /dev/ Directory The /dev/ directory contains file system entries which represent devices that are attached to the system. These files are essential for the system to function properly. The /etc/ Directory The /etc/ directory is reserved for configuration files that are local to the machine. Below are some important files which resides under /etc/ directory: /etc/passwd :- contains all the local users information /etc/system :- it is a system configuration file which helps to boot the server.
6

pictesolutions

FHS Organization
The /lib/ Directory The /lib/ directory should contain only those libraries that are needed to execute the binaries in /bin/ and /sbin/. These shared library images are particularly important for booting the system and executing commands within the root file system. The /mnt/ Directory The /mnt/ directory is for temporarily mounted file systems, such as CD-ROMs and fioppy disks. The /opt/ Directory The /opt/ directory provides storage for large, static application software packages. All the third party software/application will be installed under this directory.

pictesolutions

Standard directories the system administration utility files most commonly used UNIX commands

/etc /bin

/usr
/dev /lib /tmp

System related files


all device files library files for C compiler temporary storage /

etc bin pictesolutions

usr

dev

lib

tmp

FHS Organization
The /proc/ Directory The /proc/ directory contains special files that either extract information from or send information to the kernel. Due to the great variety of data available within /proc/ and the many ways this directory can be used to communicate with the kernel The /sbin/ Directory The /sbin/ directory is for executables used only by the root user. Local-only system administration binaries should be placed into /usr/local/sbin."

pictesolutions

FHS Organization
The /var/ Directory The FHS states /var/ is for: "...variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files."

pictesolutions

10

FHS Organization
System log files such as messages/ and lastlog/ go in the /var/log/ directory. The /var/lib/rpm/ directory also contains the RPM system databases. Lock files go in the /var/lock/ directory, usually in directories particular for the program using the file. The /var/spool/ directory has subdirectories for various systems that need to store data files

pictesolutions

11

FHS Organization
/usr/local/ in Red Hat Linux In Red Hat Linux, the intended use for the /usr/local/ directory is slightly different from that specified by the FHS. The FHS says that /usr/local/ should be where software that is to remain safe from system software upgrades is stored. Since system upgrades from under Red Hat Linux performed safely with the rpm command and graphical Package Management Tool application, it is not necessary to protect files by putting them in /usr/local/. Instead, the /usr/local/ directory is used for software that is local to the machine. For instance, if the /usr/ directory is mounted as a read-only NFS share from a remote host, it is still possible to install a package or program
under the /usr/local/ directory.

pictesolutions

12

File Locations
Special File Locations Red Hat Linux extends the FHS structure slightly to accommodate special files. Most files pertaining to the Red Hat Package Manager (RPM) are kept in the /var/lib/rpm/ directory. The /var/spool/up2date/ directory contains files used by Red Hat Update Agent, including RPM header information for the system. This location may also be used to temporarily store RPMs downloaded while updating the system. Another location specific to Red Hat Linux is the /etc/sysconfig/ directory. This directory stores a variety of configuration information. Many scripts that run at boot time use the files in this directory. Finally, one more directory worth noting is the /initrd/ directory. It is
empty, but is used as a critical mount point during the boot process

.
13

pictesolutions

File Locations
The sysconfig Directory The /etc/sysconfig/ directory is where a variety of system configuration files for Red Hat Linux are stored. Here we will outline some of the files found in the /etc/sysconfig/ directory. The information here is not intended to be complete, as many of these files have a variety of options that are only used in very specific or rare circumstances

pictesolutions

14

File Locations
Files in the /etc/sysconfig/ Directory The following files are normally found in the /etc/sysconfig/ directory: |- amd |- apmd |- arpwatch |- authconfig |- cipe |- clock |- desktop |- dhcpd |- firstboot |- gpm |- harddisks |- hwconf |- i18n
15

pictesolutions

File Locations
|- identd |- init |- ipchains |- iptables |- irda |- keyboard |- kudzu |- mouse |- named |- netdump |- network |- ntpd |- pcmcia |- radvd |- rawdevices
16

pictesolutions

File Locations
|- redhat-config-securitylevel |- redhat-config-users |- redhat-logviewer |- samba |- sendmail |- soundcard |- spamassassin |- squid |- tux |- ups |- vncservers |- xinetd Note: If some of the files listed are not present in the /etc/sysconfig/ directory, then the corresponding program may not be installed.
17

pictesolutions

3. Linux/Unix Resource Monitoring

pictesolutions

18

Resource Monitoring
Resource Monitoring Commands Red Hat Linux comes with a variety of resource monitoring tools. While there are more than those listed here, these tools are representative in terms of functionality. The tools are: top (and GNOME System Monitor, a more graphically oriented version of top) vmstat The sysstat suite of resource monitoring tools Let us look at each one in more detail. free The free command displays system memory utilization.

pictesolutions

19

Resource Monitoring
top While free displays only memory-related information, the top command does a little bit of everything. CPU utilization, process statistics, memory utilization top does it all. In addition, unlike the free command, top's default behavior is to run continuously; there is no need to use the watch command. The display is divided into two sections. The top section contains information related to overall system status uptime, load average, process counts, CPU status, and utilization statistics for both memory and swap space. The lower section displays process-level statistics, the exact nature of which can be controlled while top is running.
pictesolutions 20

Resource Monitoring
vmstat For a more concise view of system performance, try vmstat. Using this resource monitor, it is possible to get an overview of process, memory, swap, I/O, system, and CPU activity in one line of numbers:

pictesolutions

21

Resource Monitoring
pstree Gives a hierarchical structure of all currently running processs:

pictesolutions

22

You might also like