administração de sistemas (asist)

19
1 Administração de Sistemas (ASIST) TP 1 (English version) LINUX servers installation

Upload: clare

Post on 07-Jan-2016

24 views

Category:

Documents


0 download

DESCRIPTION

Administração de Sistemas (ASIST). TP 1 (English version) LINUX servers installation. LINUX Distributions. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Administração de Sistemas (ASIST)

1

Administração de Sistemas(ASIST)

TP 1 (English version)LINUX servers installation

Page 2: Administração de Sistemas (ASIST)

2

LINUX DistributionsThe LINUX operating system kernel implements the most basic and important functions like device management, process management and memory management, it interacts with the HARDWARE directly.You can say “the kernel is the operating system”. The LINUX kernel is in constant development, its free and open source.Above all the kernel provides a stable platform for upper level software to work free from low level details.

LINUX Kernel

HARDWARE

SOFTWARE

In order to take advantage of the kernel capabilities many other auxiliary programs are required to obtain a fully functional system.Some of this auxiliary programs are critical for the system start-up, for example they provide means to load the kernel in memory and give it the control over the system. Some other provide ways to install a fresh operating system.The set KERNEL + PROGRAMS is known as “Distribution”, distributions are not all free as they may include commercial software.

Page 3: Administração de Sistemas (ASIST)

3

LINUX distributions installationMost current distributions provide high level user friendly assisted installation programs. They protect the user from questions to which they don't know the correct answers.The assisted installation solution, almost options free, has the advantage of bringing many common users to LINUX however for administrators has some disadvantages.The decisions installation programs take without asking may undermine some special propose the system may have and special requirements needed.Fortunately in most cases there is an expert mode where less decisions automatic and more questions are asked.

On the other hand almost everything can be reconfigured later after the initial installation.However the division of the disk in partitions is critical because it won’t be easy to change later, after the initial installation.

Page 4: Administração de Sistemas (ASIST)

4

Disks and partitions in LINUXIn LINUX (and UNIX in general) most HARDWARE resources are internally identified by objects in the “/dev” system folder. Disks are identified in different forms according to the kind of disk interface they use.IDE: /dev/hda /dev/hdb /dev/hdc /dev/hdd

SCSI or SATA : /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde …Most disks (not CD/DVD) are divided in partitions. Partitions are logical divisions of the disk. They are defined in a special zone in the start of the disk (MBR) called “partitions table”.

Each partition in a disk is absolutely independent of others in the same disk, each may contain totally different kind of data with different formats, it may even happen that different partitions in the same disk are used by different operating systems. For each partition there is a identifier of the format in the partition table.UNIX identifies partitions in the disk by appending a number starting with “1” for the first partition. Example: /dev/hdc2 = 2ª partition of the master disk on the second IDE controller.

Page 5: Administração de Sistemas (ASIST)

5

Partition tables – shown by “fdisk” (LINUX)HOST1# fdisk /dev/sda

Command (m for help): pDisk /dev/sda: 73.4 GB, 73407868928 bytes255 heads, 63 sectors/track, 8924 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System/dev/sda1 * 1 101 811251 83 Linux/dev/sda2 102 8924 70870747+ 5 Extended/dev/sda5 102 202 811251 82 Linux swap/dev/sda6 203 711 4088511 83 Linux/dev/sda7 712 4757 32499463+ 83 Linux/dev/sda8 4758 8797 32451268+ 83 Linux/dev/sda9 8798 8924 1020096 83 Linux

HOST12# fdisk /dev/hdaCommand (m for help): pDisk /dev/hda: 20.0 GB, 20003880960 bytes255 heads, 63 sectors/track, 2432 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System/dev/hda1 * 1 13 104391 83 Linux/dev/hda2 14 778 6144862+ 83 Linux/dev/hda3 779 1415 5116702+ 83 Linux/dev/hda4 1416 2432 8169052+ 5 Extended/dev/hda5 1416 1925 4096543+ 83 Linux/dev/hda6 1926 1990 522081 82 Linux swap/dev/hda7 1991 2432 3550333+ 83 Linux

Page 6: Administração de Sistemas (ASIST)

6

Partition table – shown in Windows

A partition is a zone of the disk defined in the partition table by a starting point and a finish point, all in between belongs to the partition.

For each partition there is a identifier in the partition table which identifies the file system format used in the partition.

Page 7: Administração de Sistemas (ASIST)

7

Partitions formattingThe main advantage of creating partitions in a disk is that each of them can be used without any concern about other partitions usage.A partition cam be used by a operating system to store data, most often organized in folders and files. The way data is organized and stored in the partition is known as file system format.

There are several file system formats. Currently Microsoft Windows uses mostly NTFS, but the old FAT can also be used. In Linux the current standard file system formats are EXT2 and EXT3.The file system stores several information about the objects it holds, namely the location of their data in the partition and their properties like name and ACL. All this information about objects is stored on structures in the partition itself. The process of creating those structures is known as formatting.

After formatting a partition it will appear to be completely empty and ready to store new data.

Page 8: Administração de Sistemas (ASIST)

8

File system accessThe way operating systems provide access to file systems resident in different portions of different disks varies, in DOS/Windows systems drive letters are used with this purpose. Letters “A:” and “B:” are normally reserved for floppy disks, so the first disk file system typically gets the “C:” letter.

In Linux (and Unix in general) another principle is used, one file system (partition) is chosen to be the root file system. Other file systems of any kind can latter be integrated on the root file system by a operation called mounting.Mounting creates logical associations controlled by the operating system between empty folders and file systems stored in other disks and partitions.

After the mounting any request to the originally empty folder will be redirected by the operating system.

/ (root)

/etc

/mnt

/usr /usr/local

/mnt/cdrom1 /dev/hdb

/dev/sda1

/dev/hda2

Mounting

Page 9: Administração de Sistemas (ASIST)

9

Partitions and file systems planningAutomatic installation programs try to find the best partition

and file system configuration, to achieve this they perform a small analysis o the disk size and features.

In most cases the decisions taken will be the correct ones, however the installation program lacks the knowledge about the exact final purpose of the system.

Due to this lack of knowledge some decisions might reveal later to be wrong.Fortunately in most cases an opportunity is given to change the method in order for the user to be able to do things his way.

In the sample by directly managing the partition table. In other cases by selection on of several partitions model.

Page 10: Administração de Sistemas (ASIST)

10

Partitions sizeBecause later will be hard to change the partitions sizes, the best would be to have them with the correct size in the initial installation.We can state that the best efficiency in disk usage is achieved by using a single partition for the entire disk. That's true because partitions create static limits which he system cant overcame, situations may rise in which one partition is full and other partitions on the same disk are almost empty . However on the safety point of view this limits might be a good thing, they provide a way to keep different parts of the system independent on disk storage. If on part of the system (sub-system) fills it partition than wont disturb other sub-systems.For instance, if user areas (homes) are placed in a separate partition then if a users fills his work area, that wont affect the system because it doesn’t depend on that partition.

(but it would affect other users because the partition is shared between them )

Page 11: Administração de Sistemas (ASIST)

11

Partition size and quotasIn order to make the disk storage of each user independent form other users creating a partition for each user is not reasonable.

The way to achieve that purpose is the quota system, when active the kernel will keep a constant control on the space each user or group is taking in the partition.

Quotas can be defined at partition level only

Because quotas work at partition level, the way partitions are created will affect how many different quota subsystems may exist.

Several quota subsystems may be required, for instance:

- User area quota (home) - WEB area quota

- E-MAIL quota - System partition quota

For each a different partition will be required.

Other point against homes in the system partition is that when a user’s quota is exhausted he wont be able to make any use of the system.

Page 12: Administração de Sistemas (ASIST)

12

Root partition sizingThe purpose of the root partition is to provide a base for the kernel startup, it must contain all the necessary files for the initial boot. Only latter it will be possible o mount other file systems.The root partition must have enough space to keep all the base operating system, including objects that will most likely grow during the system's lifetime, for instance log files, configuration files and installed software.

Due to the current disk sizes its senseless to use root partitions smaller than 8 gigabytes, in the future smaller sizes could become a problem.Increasing the available disk space its simple, disk are cheap

and one can always be added. The administrator may then create new partitions, format and finally mount them on the existing root file system. Finally some cosmetic may be required in order for folders appear to be on the right place, symbolic links will solve that.

Page 13: Administração de Sistemas (ASIST)

13

In other words, when talking about servers, the central memory (RAM) should be such that virtual memory won't be used very often. Given that principle there is no point in having very big swap capacity. As a reference value its usual to create a swap partition with a size equal to the system’s RAM..

Swap partition sizing

The SWAP partition is used to implement virtual memory. Because disks are very slow when compared with real memory, virtual memory should be seen as a last resource solution that avoids “out of memory” errors.

Because Linux can manage several swap partitions at the same time, as far as there is free space in a disk it’s always possible to increase the swap space by adding new swap partitions.

Page 14: Administração de Sistemas (ASIST)

14

File system type The Linux operating system supports a wide variety of file systems, currently the most used is ext3 (third extended file-system).

Most Linux installation programs of current distributions defaults to ext3.

As for disk partitions, distribution installation programs provide a way to interact and select other kind of file system to be used. Some interesting alternatives to ext3 are ReiserFS and XFS.

All this modern file systems are journaling file systems, they log changes made to the disk, in case of system crash the system wont have to check the hole disk, only the areas where changes where happening.

This means than after a system crash the time required to bring the system up again will be very short when compared with non journaling file systems like ext2.

Page 15: Administração de Sistemas (ASIST)

15

Initial root and modulesEven tow a file system is supported by the Linux kernel than doesn’t mean it can be used as initial root.

Because Linux supports a very wide range of features, their support cant be all include in the kernel as it would grow to big.

Some kernel features require kernel modules kept in separate files (kernel loadable module - KLM).

The loading of a module requires a working file system to hold the module file, this means the initial root file system must be fully supported by the kernel, the support cant be provided by a module. One way to overcome this limitation is the use of a initial ram disk as temporary root file system, the required modules can be placed in the ram disk. Later the root file system can be changed to a real disk partition.

Current distributions kernels fully support ext2 and ext3 without modules, however the same is not necessarily true for other files systems like ReiserFS and xfs.

Page 16: Administração de Sistemas (ASIST)

16

Formatting detailsThe file system formatting operations uses specific programs, for example with the base name “mkfs” followed by the file system type, like “mkfs.ext3” or “mkfs.ext2”.

mke2fs [ -c | -l filename ] [ -b block-size ] [ -f fragment-size ] [ -g blocks-per-group ] [ -i bytes-per-inode ] [ -j ] [ -J journal-options ] [ -N number-of-inodes ] [ -n ] [ -m reserved-blocks-percentage ] [ -o creator-os ] [ -O feature[,...] ] [ -q ] [ -r fs-revision-level ] [ -E extended-options ] [ -v ] [ -F ] [ -L volume-label ] [ -M last-mounted-directory ] [ -S ] [ -T filesystem-type ] [ -V ] device [ blocks-count ]

Automatic Linux installation programs call this external programs with the arguments tuned up for the partition characteristics, namely its size and kind of use it will have.Among the arguments some may affect the performance, for instance higher values for bock-size and bytes-per-inode may increase performance for some applications. In the sample above the “-T” option allows a generic specification about the size of the files it is intended to store. The command will then automatically define the best values for other important arguments.

Page 17: Administração de Sistemas (ASIST)

17

Network interface configuration

In a server the best solution for interface configuration is static and manually defined

Dynamic network configuration, typically by using the DHCP protocol, creates a external dependency for the system. If the DHCP server is not working the our server wont work either. If possible all dependencies like this should be avoided in a server system.Manual static network configuration requires cooperation between the server administrator and the network administrator, the later will have to provide the required information:

- IP address + network mask + default gateway

- Local DNS domain name and local name servers addressesThe major disadvantage of static manual configuration is the

need to manually change the server configuration each time the network administrator makes a change on that information.

Page 18: Administração de Sistemas (ASIST)

18

Install modes for LINUX Linux distributions provide several ways to perform the installation. The installation process is itself based on a Linux kernel.

The typical way to start the installation is to boot the machine from a bootable CD/DVD. Because the installation system is Linux based, any technique than can be used to start Linux can be used to start the installation process as well. For instance a directly for DOS/WINDOWS or using a boot EPROM.

Because distributions want to as complete as possible, nowadays they have become quite large with up to a 20 CD’s, however most of the software include wont be installed.

The so called “network installation” requires just a CD or even smaller support media, after starting the installation system it uses the network (connected to the internet) to get the requested from public storage places created to this purpose.

Page 19: Administração de Sistemas (ASIST)

19

Linux installation - hardware The wide variety and constant development of the hardware is the responsible for many of the problems in the installation process.

Very recent hardware may not be fully supported by Linux, even by he latest distributions.

Anyway the correct procedure should be to chose the hardware for the operating system and not the way around. Most Linux distributions provide listings of compatible and tested hardware.

Another available option is the acquisition of a box ready to work, hardware and preinstalled operating system.

Disk controllers may present a problem, if they aren't supported by the installation system then the installation becomes impossible.